diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:07:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:07:56 +0000 |
commit | f36202620b428c45a1c8d91743727c9313424fb2 (patch) | |
tree | 14928d8970ba4890a6370aca4c38fc832d45f21f | |
parent | 0294ba5648d889e48ffee8ddad25944e258940ae (diff) |
Notes
1043 files changed, 54279 insertions, 42621 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 29eef8f35dbcc..39ff0a29dcdf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ 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() # Add path for custom modules set(CMAKE_MODULE_PATH @@ -23,7 +27,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(libcxx CXX C) set(PACKAGE_NAME libcxx) - set(PACKAGE_VERSION 6.0.0svn) + set(PACKAGE_VERSION 7.0.0svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") @@ -68,7 +72,7 @@ set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) if (WIN32) set(ENABLE_FILESYSTEM_DEFAULT OFF) endif() -option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a" +option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++fs.a" ${ENABLE_FILESYSTEM_DEFAULT}) option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) @@ -93,11 +97,26 @@ set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING "Define suffix of library directory name (32/64)") option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) +cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY + "Install the static libc++ library." ON + "LIBCXX_ENABLE_STATIC;LIBCXX_INSTALL_LIBRARY" OFF) +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) -set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.") +cmake_dependent_option(LIBCXX_INSTALL_FILESYSTEM_LIBRARY + "Install libc++fs.a" ON + "LIBCXX_ENABLE_FILESYSTEM;LIBCXX_INSTALL_LIBRARY" OFF) + +if (FUCHSIA) + set(DEFAULT_ABI_VERSION 2) +else() + set(DEFAULT_ABI_VERSION 1) +endif() +set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VERSION} CACHE STRING "ABI version of libc++.") option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." 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.") @@ -123,6 +142,7 @@ if (LIBCXX_CXX_ABI STREQUAL "default") ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include ${LLVM_MAIN_SRC_DIR}/../libcxxabi/include NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH ) if (LIBCXX_TARGETING_MSVC) # FIXME: Figure out how to configure the ABI library on Windows. @@ -135,6 +155,9 @@ if (LIBCXX_CXX_ABI STREQUAL "default") elseif (APPLE) set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") set(LIBCXX_CXX_ABI_SYSTEM 1) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt") + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1") else() set(LIBCXX_CXX_ABI_LIBNAME "default") endif() @@ -146,13 +169,21 @@ endif() # cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT. option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF) +cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY + "Statically link the ABI library to static library" ON + "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF) + +cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY + "Statically link the ABI library to shared library" ON + "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF) + # Generate and install a linker script inplace of libc++.so. The linker script # will link libc++ to the correct ABI library. This option is on by default # on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' # is on. This option is also disabled when the ABI library is not specified # or is specified to be "none". set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF) -if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY +if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none" AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "default" AND PYTHONINTERP_FOUND @@ -202,6 +233,7 @@ option(LIBCXX_ENABLE_MONOTONIC_CLOCK This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) option(LIBCXX_HAS_MUSL_LIBC "Build libc++ with support for the Musl C library" OFF) option(LIBCXX_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF) +option(LIBCXX_HAS_WIN32_THREAD_API "Ignore auto-detection and force use of win32 thread API" OFF) option(LIBCXX_HAS_EXTERNAL_THREAD_API "Build libc++ with an externalized threading API. This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF) @@ -273,6 +305,10 @@ if(NOT LIBCXX_ENABLE_THREADS) message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set " "to ON when LIBCXX_ENABLE_THREADS is also set to ON.") endif() + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "LIBCXX_HAS_WIN32_THREAD_API can only be set to ON" + " when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() endif() @@ -287,6 +323,19 @@ if (LIBCXX_HAS_EXTERNAL_THREAD_API) "and LIBCXX_HAS_PTHREAD_API cannot be both" "set to ON at the same time.") endif() + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" + "and LIBCXX_HAS_WIN32_THREAD_API cannot be both" + "set to ON at the same time.") + endif() +endif() + +if (LIBCXX_HAS_PTHREAD_API) + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_PTHREAD_API" + "and LIBCXX_HAS_WIN32_THREAD_API cannot be both" + "set to ON at the same time.") + endif() endif() # Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE @@ -329,7 +378,7 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT) endif() endif() -if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) +if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) message(FATAL_ERROR "Conflicting options given. LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with LIBCXX_ENABLE_ABI_LINKER_SCRIPT") @@ -352,19 +401,29 @@ 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") -if (LLVM_LIBRARY_OUTPUT_INTDIR) + +string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + ${PACKAGE_VERSION}) + +if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(DEFAULT_INSTALL_PREFIX lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/) + set(DEFAULT_INSTALL_HEADER_PREFIX lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_HEADER_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) +elseif(LLVM_LIBRARY_OUTPUT_INTDIR) set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) else() set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) endif() + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") -set(LIBCXX_INSTALL_PREFIX "" CACHE STRING +set(LIBCXX_INSTALL_PREFIX ${DEFAULT_INSTALL_PREFIX} CACHE STRING "Define libc++ destination prefix.") -if (NOT LIBCXX_INSTALL_PREFIX MATCHES "^$|.*/") - message(FATAL_ERROR "LIBCXX_INSTALL_PREFIX has to end with \"/\".") -endif() +set(LIBCXX_INSTALL_HEADER_PREFIX ${DEFAULT_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}) @@ -597,7 +656,7 @@ if (LIBCXX_STANDALONE_BUILD) endif() # Configuration file flags ===================================================== -if (NOT LIBCXX_ABI_VERSION EQUAL "1") +if (NOT LIBCXX_ABI_VERSION EQUAL DEFAULT_ABI_VERSION) config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION) endif() config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE) @@ -613,6 +672,7 @@ config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THRE 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_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC) config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME) diff --git a/CREDITS.TXT b/CREDITS.TXT index 88d923a48e913..46a06c6eab089 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -101,7 +101,7 @@ E: nico.rieck@gmail.com D: Windows fixes N: Jon Roelofs -E: jonathan@codesourcery.com +E: jroelofS@jroelofs.com D: Remote testing, Newlib port, baremetal/single-threaded support. N: Jonathan Sauer diff --git a/NOTES.TXT b/NOTES.TXT index f0597de64ae88..24d245d437cc8 100644 --- a/NOTES.TXT +++ b/NOTES.TXT @@ -26,3 +26,4 @@ to libc++. 1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`. 2. Update `test/libcxx/double_include.sh.cpp` to include the new header. 3. Create a submodule in `include/module.modulemap` for the new header. +4. Update the include/CMakeLists.txt file to include the new header. diff --git a/appveyor-reqs-install.cmd b/appveyor-reqs-install.cmd index 43655d5612a80..a4160110aa5fc 100644 --- a/appveyor-reqs-install.cmd +++ b/appveyor-reqs-install.cmd @@ -9,7 +9,7 @@ cd C:\projects\deps :: Setup Compiler ::########################################################################### if NOT EXIST llvm-installer.exe ( - appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-6.0.0-r316086-win32.exe -FileName llvm-installer.exe + appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r325576-win32.exe -FileName llvm-installer.exe ) if "%CLANG_VERSION%"=="ToT" ( START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM" diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 8211ebd009a77..f557d4aea39ab 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -59,6 +59,7 @@ if (LIBCXX_BENCHMARK_NATIVE_STDLIB) -DBENCHMARK_ENABLE_TESTING:BOOL=OFF) endif() + #============================================================================== # Benchmark tests configuration #============================================================================== @@ -67,7 +68,7 @@ set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx) set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native) set(BENCHMARK_TEST_COMPILE_FLAGS - -std=c++14 -O2 + -std=c++17 -O2 -I${BENCHMARK_LIBCXX_INSTALL}/include -I${LIBCXX_SOURCE_DIR}/test/support ) diff --git a/benchmarks/ContainerBenchmarks.hpp b/benchmarks/ContainerBenchmarks.hpp index dc268e7ebca3c..509e3d23ed9aa 100644 --- a/benchmarks/ContainerBenchmarks.hpp +++ b/benchmarks/ContainerBenchmarks.hpp @@ -3,7 +3,7 @@ #include <cassert> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" namespace ContainerBenchmarks { diff --git a/benchmarks/GenerateInput.hpp b/benchmarks/GenerateInput.hpp index 9d5adac4af4f1..8c97f5881f1ed 100644 --- a/benchmarks/GenerateInput.hpp +++ b/benchmarks/GenerateInput.hpp @@ -29,14 +29,16 @@ inline std::default_random_engine& getRandomEngine() { return RandEngine; } + inline char getRandomChar() { std::uniform_int_distribution<> LettersDist(0, LettersSize-1); return Letters[LettersDist(getRandomEngine())]; } template <class IntT> -inline IntT getRandomInteger() { - std::uniform_int_distribution<IntT> dist; +inline IntT getRandomInteger(IntT Min = 0, + IntT Max = std::numeric_limits<IntT>::max()) { + std::uniform_int_distribution<IntT> dist(Min, Max); return dist(getRandomEngine()); } diff --git a/benchmarks/algorithms.bench.cpp b/benchmarks/algorithms.bench.cpp index 745cc17271843..86315390e0d2c 100644 --- a/benchmarks/algorithms.bench.cpp +++ b/benchmarks/algorithms.bench.cpp @@ -2,7 +2,7 @@ #include <vector> #include <cstdint> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include "GenerateInput.hpp" constexpr std::size_t TestNumInputs = 1024; @@ -59,4 +59,4 @@ BENCHMARK_CAPTURE(BM_Sort, single_element_strings, getDuplicateStringInputs)->Arg(TestNumInputs); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/benchmarks/filesystem.bench.cpp b/benchmarks/filesystem.bench.cpp index f7949a163a7f1..3e4956059151a 100644 --- a/benchmarks/filesystem.bench.cpp +++ b/benchmarks/filesystem.bench.cpp @@ -1,17 +1,14 @@ -#include <experimental/filesystem> - -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include "GenerateInput.hpp" #include "test_iterators.h" - -namespace fs = std::experimental::filesystem; +#include "filesystem_include.hpp" static const size_t TestNumInputs = 1024; template <class GenInputs> void BM_PathConstructString(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; const auto in = gen(st.range(0)); path PP; for (auto& Part : in) @@ -21,14 +18,15 @@ void BM_PathConstructString(benchmark::State &st, GenInputs gen) { const path P(PP.native()); benchmark::DoNotOptimize(P.native().data()); } + st.SetComplexityN(st.range(0)); } BENCHMARK_CAPTURE(BM_PathConstructString, large_string, - getRandomStringInputs)->Arg(TestNumInputs); + getRandomStringInputs)->Range(8, TestNumInputs)->Complexity(); template <class GenInputs> void BM_PathConstructCStr(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; const auto in = gen(st.range(0)); path PP; for (auto& Part : in) @@ -45,7 +43,7 @@ BENCHMARK_CAPTURE(BM_PathConstructCStr, large_string, template <template <class...> class ItType, class GenInputs> void BM_PathConstructIter(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; using Iter = ItType<std::string::const_iterator>; const auto in = gen(st.range(0)); path PP; @@ -60,6 +58,7 @@ void BM_PathConstructIter(benchmark::State &st, GenInputs gen) { const path P(Start, End); benchmark::DoNotOptimize(P.native().data()); } + st.SetComplexityN(st.range(0)); } template <class GenInputs> void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) { @@ -70,14 +69,14 @@ void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) { BM_PathConstructIter<forward_iterator>(st, gen); } BENCHMARK_CAPTURE(BM_PathConstructInputIter, large_string, - getRandomStringInputs)->Arg(TestNumInputs); + getRandomStringInputs)->Range(8, TestNumInputs)->Complexity(); BENCHMARK_CAPTURE(BM_PathConstructForwardIter, large_string, - getRandomStringInputs)->Arg(TestNumInputs); + getRandomStringInputs)->Range(8, TestNumInputs)->Complexity(); template <class GenInputs> void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; const auto in = gen(st.range(0)); path PP; for (auto& Part : in) @@ -89,14 +88,15 @@ void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) { } benchmark::ClobberMemory(); } + st.SetComplexityN(st.range(0)); } BENCHMARK_CAPTURE(BM_PathIterateMultipleTimes, iterate_elements, - getRandomStringInputs)->Arg(TestNumInputs); + getRandomStringInputs)->Range(8, TestNumInputs)->Complexity(); template <class GenInputs> void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; const auto in = gen(st.range(0)); path PP; for (auto& Part : in) @@ -109,13 +109,14 @@ void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) { } benchmark::ClobberMemory(); } + st.SetComplexityN(st.range(0)); } BENCHMARK_CAPTURE(BM_PathIterateOnce, iterate_elements, - getRandomStringInputs)->Arg(TestNumInputs); + getRandomStringInputs)->Range(8, TestNumInputs)->Complexity(); template <class GenInputs> void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) { - using namespace fs; + using fs::path; const auto in = gen(st.range(0)); path PP; for (auto& Part : in) @@ -135,4 +136,28 @@ void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) { BENCHMARK_CAPTURE(BM_PathIterateOnceBackwards, iterate_elements, getRandomStringInputs)->Arg(TestNumInputs); -BENCHMARK_MAIN() +static fs::path getRandomPaths(int NumParts, int PathLen) { + fs::path Result; + while (NumParts--) { + std::string Part = getRandomString(PathLen); + Result /= Part; + } + return Result; +} + +template <class GenInput> +void BM_LexicallyNormal(benchmark::State &st, GenInput gen, size_t PathLen) { + using fs::path; + auto In = gen(st.range(0), PathLen); + benchmark::DoNotOptimize(&In); + while (st.KeepRunning()) { + benchmark::DoNotOptimize(In.lexically_normal()); + } + st.SetComplexityN(st.range(0)); +} +BENCHMARK_CAPTURE(BM_LexicallyNormal, small_path, + getRandomPaths, /*PathLen*/5)->RangeMultiplier(2)->Range(2, 256)->Complexity(); +BENCHMARK_CAPTURE(BM_LexicallyNormal, large_path, + getRandomPaths, /*PathLen*/32)->RangeMultiplier(2)->Range(2, 256)->Complexity(); + +BENCHMARK_MAIN(); diff --git a/benchmarks/string.bench.cpp b/benchmarks/string.bench.cpp index ef89239168832..8a09e738d9b62 100644 --- a/benchmarks/string.bench.cpp +++ b/benchmarks/string.bench.cpp @@ -2,7 +2,7 @@ #include <vector> #include <cstdint> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include "GenerateInput.hpp" constexpr std::size_t MAX_STRING_LEN = 8 << 14; @@ -46,4 +46,25 @@ static void BM_StringFindMatch2(benchmark::State &state) { } BENCHMARK(BM_StringFindMatch2)->Range(1, MAX_STRING_LEN / 4); -BENCHMARK_MAIN() +static void BM_StringCtorDefault(benchmark::State &state) { + while (state.KeepRunning()) { + for (unsigned I=0; I < 1000; ++I) { + std::string Default; + benchmark::DoNotOptimize(Default.c_str()); + } + } +} +BENCHMARK(BM_StringCtorDefault); + +static void BM_StringCtorCStr(benchmark::State &state) { + std::string Input = getRandomString(state.range(0)); + const char *Str = Input.c_str(); + benchmark::DoNotOptimize(Str); + while (state.KeepRunning()) { + std::string Tmp(Str); + benchmark::DoNotOptimize(Tmp.c_str()); + } +} +BENCHMARK(BM_StringCtorCStr)->Arg(1)->Arg(8)->Range(16, MAX_STRING_LEN / 4); + +BENCHMARK_MAIN(); diff --git a/benchmarks/stringstream.bench.cpp b/benchmarks/stringstream.bench.cpp index 6023cf775bc8f..75a7a284e072e 100644 --- a/benchmarks/stringstream.bench.cpp +++ b/benchmarks/stringstream.bench.cpp @@ -1,4 +1,4 @@ -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include <sstream> double __attribute__((noinline)) istream_numbers(); @@ -35,4 +35,4 @@ static void BM_Istream_numbers(benchmark::State &state) { } BENCHMARK(BM_Istream_numbers)->RangeMultiplier(2)->Range(1024, 4096); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/benchmarks/unordered_set_operations.bench.cpp b/benchmarks/unordered_set_operations.bench.cpp index e2afdde56dc46..ee0ea29b8d219 100644 --- a/benchmarks/unordered_set_operations.bench.cpp +++ b/benchmarks/unordered_set_operations.bench.cpp @@ -5,7 +5,7 @@ #include <cstdlib> #include <cstring> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include "ContainerBenchmarks.hpp" #include "GenerateInput.hpp" @@ -303,4 +303,4 @@ BENCHMARK_CAPTURE(BM_EmplaceDuplicate, std::unordered_set<std::string>{}, getRandomCStringInputs)->Arg(TestNumInputs); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/benchmarks/util_smartptr.bench.cpp b/benchmarks/util_smartptr.bench.cpp index ad3f03a0448ab..c984b2ca6665c 100644 --- a/benchmarks/util_smartptr.bench.cpp +++ b/benchmarks/util_smartptr.bench.cpp @@ -9,7 +9,7 @@ #include <memory> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" static void BM_SharedPtrCreateDestroy(benchmark::State& st) { while (st.KeepRunning()) { @@ -39,4 +39,4 @@ static void BM_WeakPtrIncDecRef(benchmark::State& st) { } BENCHMARK(BM_WeakPtrIncDecRef); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/benchmarks/vector_operations.bench.cpp b/benchmarks/vector_operations.bench.cpp index 004e801f0be5c..a2c4e5dbbc03f 100644 --- a/benchmarks/vector_operations.bench.cpp +++ b/benchmarks/vector_operations.bench.cpp @@ -4,7 +4,7 @@ #include <cstdlib> #include <cstring> -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include "ContainerBenchmarks.hpp" #include "GenerateInput.hpp" @@ -29,4 +29,4 @@ BENCHMARK_CAPTURE(BM_ConstructIterIter, getRandomStringInputs)->Arg(TestNumInputs); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/cmake/Modules/CheckLibcxxAtomic.cmake b/cmake/Modules/CheckLibcxxAtomic.cmake index a7ae667a15583..98862d42397b6 100644 --- a/cmake/Modules/CheckLibcxxAtomic.cmake +++ b/cmake/Modules/CheckLibcxxAtomic.cmake @@ -9,7 +9,7 @@ INCLUDE(CheckCXXSourceCompiles) function(check_cxx_atomics varname) set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include") if (${LIBCXX_GCC_TOOLCHAIN}) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}") endif() @@ -31,7 +31,14 @@ int main() { set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) endfunction(check_cxx_atomics) +# Perform the check for 64bit atomics without libatomic. It may have been +# added to the required libraries during in the configuration of LLVM, which +# would cause the check for CXX atomics without libatomic to incorrectly pass. +set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) +list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic") check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB) +set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES}) + check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB) # If not, check if the library exists, and atomics work with it. if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB) diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake index e9da3c43a2118..2e0e69e5e085d 100644 --- a/cmake/Modules/HandleCompilerRT.cmake +++ b/cmake/Modules/HandleCompilerRT.cmake @@ -14,6 +14,7 @@ function(find_compiler_rt_library name dest) OUTPUT_VARIABLE LIBRARY_FILE ) string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) + file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE) string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}") if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}") message(STATUS "Found compiler-rt library: ${LIBRARY_FILE}") @@ -37,6 +38,7 @@ function(find_compiler_rt_dir dest) OUTPUT_VARIABLE LIBRARY_DIR ) string(STRIP "${LIBRARY_DIR}" LIBRARY_DIR) + file(TO_CMAKE_PATH "${LIBRARY_DIR}" LIBRARY_DIR) set(LIBRARY_DIR "${LIBRARY_DIR}/darwin") else() set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS} @@ -47,6 +49,7 @@ function(find_compiler_rt_dir dest) OUTPUT_VARIABLE LIBRARY_FILE ) string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) + file(TO_CMAKE_PATH "${LIBRARY_FILE}" LIBRARY_FILE) get_filename_component(LIBRARY_DIR "${LIBRARY_FILE}" DIRECTORY) endif() if (NOT HAD_ERROR AND EXISTS "${LIBRARY_DIR}") diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake index 558e11ba2cc17..ef3b4f5dde221 100644 --- a/cmake/Modules/HandleLibCXXABI.cmake +++ b/cmake/Modules/HandleLibCXXABI.cmake @@ -32,14 +32,6 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) set(LIBCXX_CXX_ABI_LIBRARY ${abilib}) set(LIBCXX_ABILIB_FILES ${abifiles}) - # The place in the build tree where we store out-of-source headers. - file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}") - file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1") - foreach(_d ${abidirs}) - file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}/${_d}") - file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/${_d}") - endforeach() - foreach(fpath ${LIBCXX_ABILIB_FILES}) set(found FALSE) foreach(incpath ${LIBCXX_CXX_ABI_INCLUDE_PATHS}) @@ -47,20 +39,31 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) set(found TRUE) get_filename_component(dstdir ${fpath} PATH) get_filename_component(ifile ${fpath} NAME) - file(COPY "${incpath}/${fpath}" - DESTINATION "${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}" - ) - file(COPY "${incpath}/${fpath}" - DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}" - ) + set(src ${incpath}/${fpath}) + + set(dst ${LIBCXX_BINARY_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 (NOT LIBCXX_USING_INSTALLED_LLVM AND 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() + if (LIBCXX_INSTALL_HEADERS) install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" - DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir} + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} COMPONENT cxx-headers PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) endif() - list(APPEND abilib_headers "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}") endif() endforeach() if (NOT found) @@ -69,6 +72,8 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) endforeach() include_directories("${LIBCXX_BINARY_INCLUDE_DIR}") + add_custom_target(cxx_abi_headers ALL DEPENDS ${abilib_headers}) + set(LIBCXX_CXX_ABI_HEADER_TARGET "cxx_abi_headers") endmacro() @@ -93,10 +98,10 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi") if (LIBCXX_CXX_ABI_INTREE) # Link against just-built "cxxabi" target. - if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) - set(CXXABI_LIBNAME cxxabi_static) + if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY) + set(CXXABI_LIBNAME cxxabi_static) else() - set(CXXABI_LIBNAME cxxabi_shared) + set(CXXABI_LIBNAME cxxabi_shared) endif() set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE) else() diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake index 83948b14fd1f8..70eed1d70ba1b 100644 --- a/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -46,10 +46,11 @@ macro(find_llvm_parts) OUTPUT_VARIABLE CONFIG_OUTPUT ERROR_QUIET) if(NOT HAD_ERROR) - string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH) + string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG) + file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG}" LLVM_CMAKE_PATH) else() - set(LLVM_CMAKE_PATH - "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + file(TO_CMAKE_PATH "${LLVM_BINARY_DIR}" LLVM_BINARY_DIR_CMAKE_STYLE) + set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") endif() else() set(LLVM_FOUND OFF) diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst index 3dae2f41c2740..d0b03c675c8b9 100644 --- a/docs/BuildingLibcxx.rst +++ b/docs/BuildingLibcxx.rst @@ -242,11 +242,15 @@ libc++experimental Specific Options .. option:: LIBCXX_ENABLE_FILESYSTEM:BOOL - **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY`` + **Default**: ``ON`` + + Build filesystem as a standalone library libc++fs.a. + +.. option:: LIBCXX_INSTALL_FILESYSTEM_LIBRARY:BOOL - Build filesystem as part of libc++experimental.a. This allows filesystem - to be disabled without turning off the entire experimental library. + **Default**: ``LIBCXX_ENABLE_FILESYSTEM AND LIBCXX_INSTALL_LIBRARY`` + Install libc++fs.a alongside libc++. .. _ABI Library Specific Options: diff --git a/docs/DesignDocs/AvailabilityMarkup.rst b/docs/DesignDocs/AvailabilityMarkup.rst index 4a85c698f2325..b8b44509790de 100644 --- a/docs/DesignDocs/AvailabilityMarkup.rst +++ b/docs/DesignDocs/AvailabilityMarkup.rst @@ -58,7 +58,7 @@ Testing Some parameters can be passed to lit to run the test-suite and exercising the availability. -* The `platform` parameter controls the deployement target. For example lit can +* The `platform` parameter controls the deployment target. For example lit can be invoked with `--param=platform=macosx10.8`. Default is the current host. * The `use_system_cxx_lib` parameter indicates to use another library than the just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run diff --git a/docs/DesignDocs/CapturingConfigInfo.rst b/docs/DesignDocs/CapturingConfigInfo.rst index 73378a21c0a9c..88102251d932d 100644 --- a/docs/DesignDocs/CapturingConfigInfo.rst +++ b/docs/DesignDocs/CapturingConfigInfo.rst @@ -46,7 +46,7 @@ we do NOTHING. Otherwise we create a custom installation rule that modifies the installed __config header. The rule first generates a dummy "__config_site" header containing the required -#defines. The contents of the dummy header are then prependend to the installed +#defines. The contents of the dummy header are then prepended to the installed __config header. By manually prepending the files we avoid the cost of an extra #include and we allow the __config header to be ignorant of the extra configuration all together. An example "__config" header generated when diff --git a/docs/DesignDocs/FileTimeType.rst b/docs/DesignDocs/FileTimeType.rst new file mode 100644 index 0000000000000..488ff174b341d --- /dev/null +++ b/docs/DesignDocs/FileTimeType.rst @@ -0,0 +1,494 @@ +============== +File Time Type +============== + +.. contents:: + :local: + +.. _file-time-type-motivation: + +Motivation +========== + +The filesystem library provides interfaces for getting and setting the last +write time of a file or directory. The interfaces use the ``file_time_type`` +type, which is a specialization of ``chrono::time_point`` for the +"filesystem clock". According to [fs.filesystem.syn] + + 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 + system dependent resolution and range of file time values. + + +On POSIX systems, file times are represented using the ``timespec`` struct, +which is defined as follows: + +.. code-block:: cpp + + struct timespec { + time_t tv_sec; + long tv_nsec; + }; + +To represent the range and resolution of ``timespec``, we need to (A) have +nanosecond resolution, and (B) use more than 64 bits (assuming a 64 bit ``time_t``). + +As the standard requires us to use the ``chrono`` interface, we have to define +our own filesystem clock which specifies the period and representation of +the time points and duration it provides. It will look like this: + +.. code-block:: cpp + + struct _FilesystemClock { + using period = nano; + using rep = TBD; // What is this? + + using duration = chrono::duration<rep, period>; + using time_point = chrono::time_point<_FilesystemClock>; + + // ... // + }; + + using file_time_type = _FilesystemClock::time_point; + + +To get nanosecond resolution, we simply define ``period`` to be ``std::nano``. +But what type can we use as the arithmetic representation that is capable +of representing the range of the ``timespec`` struct? + +Problems To Consider +==================== + +Before considering solutions, let's consider the problems they should solve, +and how important solving those problems are: + + +Having a Smaller Range than ``timespec`` +---------------------------------------- + +One solution to the range problem is to simply reduce the resolution of +``file_time_type`` to be less than that of nanoseconds. This is what libc++'s +initial implementation of ``file_time_type`` did; it's also what +``std::system_clock`` does. As a result, it can represent time points about +292 thousand years on either side of the epoch, as opposed to only 292 years +at nanosecond resolution. + +``timespec`` can represent time points +/- 292 billion years from the epoch +(just in case you needed a time point 200 billion years before the big bang, +and with nanosecond resolution). + +To get the same range, we would need to drop our resolution to that of seconds +to come close to having the same range. + +This begs the question, is the range problem "really a problem"? Sane usages +of file time stamps shouldn't exceed +/- 300 years, so should we care to support it? + +I believe the answer is yes. We're not designing the filesystem time API, we're +providing glorified C++ wrappers for it. If the underlying API supports +a value, then we should too. Our wrappers should not place artificial restrictions +on users that are not present in the underlying filesystem. + +Having a smaller range that the underlying filesystem forces the +implementation to report ``value_too_large`` errors when it encounters a time +point that it can't represent. This can cause the call to ``last_write_time`` +to throw in cases where the user was confident the call should succeed. (See below) + + +.. code-block:: cpp + + #include <filesystem> + using namespace std::filesystem; + + // Set the times using the system interface. + void set_file_times(const char* path, struct timespec ts) { + timespec both_times[2]; + both_times[0] = ts; + both_times[1] = ts; + int result = ::utimensat(AT_FDCWD, path, both_times, 0); + assert(result != -1); + } + + // Called elsewhere to set the file time to something insane, and way + // out of the 300 year range we might expect. + void some_bad_persons_code() { + struct timespec new_times; + new_times.tv_sec = numeric_limits<time_t>::max(); + new_times.tv_nsec = 0; + set_file_times("/tmp/foo", new_times); // OK, supported by most FSes + } + + int main() { + path p = "/tmp/foo"; + file_status st = status(p); + if (!exists(st) || !is_regular_file(st)) + return 1; + if ((st.permissions() & perms::others_read) == perms::none) + return 1; + // It seems reasonable to assume this call should succeed. + file_time_type tp = last_write_time(p); // BAD! Throws value_too_large. + } + + +Having a Smaller Resolution than ``timespec`` +--------------------------------------------- + +As mentioned in the previous section, one way to solve the range problem +is by reducing the resolution. But matching the range of ``timespec`` using a +64 bit representation requires limiting the resolution to seconds. + +So we might ask: Do users "need" nanosecond precision? Is seconds not good enough? +I limit my consideration of the point to this: Why was it not good enough for +the underlying system interfaces? If it wasn't good enough for them, then it +isn't good enough for us. Our job is to match the filesystems range and +representation, not design it. + + +Having a Larger Range than ``timespec`` +---------------------------------------- + +We should also consider the opposite problem of having a ``file_time_type`` +that is able to represent a larger range than ``timespec``. At least in +this case ``last_write_time`` can be used to get and set all possible values +supported by the underlying filesystem; meaning ``last_write_time(p)`` will +never throw a overflow error when retrieving a value. + +However, this introduces a new problem, where users are allowed to attempt to +create a time point beyond what the filesystem can represent. Two particular +values which cause this are ``file_time_type::min()`` and +``file_time_type::max()``. As a result, the following code would throw: + +.. code-block:: cpp + + void test() { + last_write_time("/tmp/foo", file_time_type::max()); // Throws + last_write_time("/tmp/foo", file_time_type::min()); // Throws. + } + +Apart from cases explicitly using ``min`` and ``max``, I don't see users taking +a valid time point, adding a couple hundred billions of years in error, +and then trying to update a file's write time to that value very often. + +Compared to having a smaller range, this problem seems preferable. At least +now we can represent any time point the filesystem can, so users won't be forced +to revert back to system interfaces to avoid limitations in the C++ STL. + +I posit that we should only consider this concern *after* we have something +with at least the same range and resolution of the underlying filesystem. The +latter two problems are much more important to solve. + +Potential Solutions And Their Complications +=========================================== + +Source Code Portability Across Implementations +----------------------------------------------- + +As we've discussed, ``file_time_type`` needs a representation that uses more +than 64 bits. The possible solutions include using ``__int128_t``, emulating a +128 bit integer using a class, or potentially defining a ``timespec`` like +arithmetic type. All three will allow us to, at minimum, match the range +and resolution, and the last one might even allow us to match them exactly. + +But when considering these potential solutions we need to consider more than +just the values they can represent. We need to consider the effects they will +have on users and their code. For example, each of them breaks the following +code in some way: + +.. code-block:: cpp + + // Bug caused by an unexpected 'rep' type returned by count. + void print_time(path p) { + // __int128_t doesn't have streaming operators, and neither would our + // custom arithmetic types. + cout << last_write_time(p).time_since_epoch().count() << endl; + } + + // Overflow during creation bug. + file_time_type timespec_to_file_time_type(struct timespec ts) { + // woops! chrono::seconds and chrono::nanoseconds use a 64 bit representation + // this may overflow before it's converted to a file_time_type. + auto dur = seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec); + return file_time_type(dur); + } + + file_time_type correct_timespec_to_file_time_type(struct timespec ts) { + // This is the correct version of the above example, where we + // avoid using the chrono typedefs as they're not sufficient. + // Can we expect users to avoid this bug? + using fs_seconds = chrono::duration<file_time_type::rep>; + using fs_nanoseconds = chrono::duration<file_time_type::rep, nano>; + auto dur = fs_seconds(ts.tv_sec) + fs_nanoseconds(tv.tv_nsec); + return file_time_type(dur); + } + + // Implicit truncation during conversion bug. + intmax_t get_time_in_seconds(path p) { + using fs_seconds = duration<file_time_type::rep, ratio<1, 1> >; + auto tp = last_write_time(p); + + // This works with truncation for __int128_t, but what does it do for + // our custom arithmetic types. + return duration_cast<fs_seconds>().count(); + } + + +Each of the above examples would require a user to adjust their filesystem code +to the particular eccentricities of the representation, hopefully only in such +a way that the code is still portable across implementations. + +At least some of the above issues are unavoidable, no matter what +representation we choose. But some representations may be quirkier than others, +and, as I'll argue later, using an actual arithmetic type (``__int128_t``) +provides the least aberrant behavior. + + +Chrono and ``timespec`` Emulation. +---------------------------------- + +One of the options we've considered is using something akin to ``timespec`` +to represent the ``file_time_type``. It only seems natural seeing as that's +what the underlying system uses, and because it might allow us to match +the range and resolution exactly. But would it work with chrono? And could +it still act at all like a ``timespec`` struct? + +For ease of consideration, let's consider what the implementation might +look like. + +.. code-block:: cpp + + struct fs_timespec_rep { + fs_timespec_rep(long long v) + : tv_sec(v / nano::den), tv_nsec(v % nano::den) + { } + private: + time_t tv_sec; + long tv_nsec; + }; + bool operator==(fs_timespec_rep, fs_timespec_rep); + fs_int128_rep operator+(fs_timespec_rep, fs_timespec_rep); + // ... arithmetic operators ... // + +The first thing to notice is that we can't construct ``fs_timespec_rep`` like +a ``timespec`` by passing ``{secs, nsecs}``. Instead we're limited to +constructing it from a single 64 bit integer. + +We also can't allow the user to inspect the ``tv_sec`` or ``tv_nsec`` values +directly. A ``chrono::duration`` represents its value as a tick period and a +number of ticks stored using ``rep``. The representation is unaware of the +tick period it is being used to represent, but ``timespec`` is setup to assume +a nanosecond tick period; which is the only case where the names ``tv_sec`` +and ``tv_nsec`` match the values they store. + +When we convert a nanosecond duration to seconds, ``fs_timespec_rep`` will +use ``tv_sec`` to represent the number of giga seconds, and ``tv_nsec`` the +remaining seconds. Let's consider how this might cause a bug were users allowed +to manipulate the fields directly. + +.. code-block:: cpp + + template <class Period> + timespec convert_to_timespec(duration<fs_time_rep, Period> dur) { + fs_timespec_rep rep = dur.count(); + return {rep.tv_sec, rep.tv_nsec}; // Oops! Period may not be nanoseconds. + } + + template <class Duration> + Duration convert_to_duration(timespec ts) { + Duration dur({ts.tv_sec, ts.tv_nsec}); // Oops! Period may not be nanoseconds. + return file_time_type(dur); + file_time_type tp = last_write_time(p); + auto dur = + } + + time_t extract_seconds(file_time_type tp) { + // Converting to seconds is a silly bug, but I could see it happening. + using SecsT = chrono::duration<file_time_type::rep, ratio<1, 1>>; + auto secs = duration_cast<Secs>(tp.time_since_epoch()); + // tv_sec is now representing gigaseconds. + return secs.count().tv_sec; // Oops! + } + +Despite ``fs_timespec_rep`` not being usable in any manner resembling +``timespec``, it still might buy us our goal of matching its range exactly, +right? + +Sort of. Chrono provides a specialization point which specifies the minimum +and maximum values for a custom representation. It looks like this: + +.. code-block:: cpp + + template <> + struct duration_values<fs_timespec_rep> { + static fs_timespec_rep zero(); + static fs_timespec_rep min(); + static fs_timespec_rep max() { // assume friendship. + fs_timespec_rep val; + val.tv_sec = numeric_limits<time_t>::max(); + val.tv_nsec = nano::den - 1; + return val; + } + }; + +Notice that ``duration_values`` doesn't tell the representation what tick +period it's actually representing. This would indeed correctly limit the range +of ``duration<fs_timespec_rep, nano>`` to exactly that of ``timespec``. But +nanoseconds isn't the only tick period it will be used to represent. For +example: + +.. code-block:: cpp + + void test() { + using rep = file_time_type::rep; + using fs_nsec = duration<rep, nano>; + using fs_sec = duration<rep>; + fs_nsec nsecs(fs_seconds::max()); // Truncates + } + +Though the above example may appear silly, I think it follows from the incorrect +notion that using a ``timespec`` rep in chrono actually makes it act as if it +were an actual ``timespec``. + +Interactions with 32 bit ``time_t`` +----------------------------------- + +Up until now we've only be considering cases where ``time_t`` is 64 bits, but what +about 32 bit systems/builds where ``time_t`` is 32 bits? (this is the common case +for 32 bit builds). + +When ``time_t`` is 32 bits, we can implement ``file_time_type`` simply using 64-bit +``long long``. There is no need to get either ``__int128_t`` or ``timespec`` emulation +involved. And nor should we, as it would suffer from the numerous complications +described by this paper. + +Obviously our implementation for 32-bit builds should act as similarly to the +64-bit build as possible. Code which compiles in one, should compile in the other. +This consideration is important when choosing between ``__int128_t`` and +emulating ``timespec``. The solution which provides the most uniformity with +the least eccentricity is the preferable one. + +Summary +======= + +The ``file_time_type`` time point is used to represent the write times for files. +Its job is to act as part of a C++ wrapper for less ideal system interfaces. The +underlying filesystem uses the ``timespec`` struct for the same purpose. + +However, the initial implementation of ``file_time_type`` could not represent +either the range or resolution of ``timespec``, making it unsuitable. Fixing +this requires an implementation which uses more than 64 bits to store the +time point. + +We primarily considered two solutions: Using ``__int128_t`` and using a +arithmetic emulation of ``timespec``. Each has its pros and cons, and both +come with more than one complication. + +The Potential Solutions +----------------------- + +``long long`` - The Status Quo +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Pros: + +* As a type ``long long`` plays the nicest with others: + + * It works with streaming operators and other library entities which support + builtin integer types, but don't support ``__int128_t``. + * Its the representation used by chrono's ``nanosecond`` and ``second`` typedefs. + +Cons: + +* It cannot provide the same resolution as ``timespec`` unless we limit it + to a range of +/- 300 years from the epoch. +* It cannot provide the same range as ``timespec`` unless we limit its resolution + to seconds. +* ``last_write_time`` has to report an error when the time reported by the filesystem + is unrepresentable. + +__int128_t +~~~~~~~~~~~ + +Pros: + +* It is an integer type. +* It makes the implementation simple and efficient. +* Acts exactly like other arithmetic types. +* Can be implicitly converted to a builtin integer type by the user. + + * This is important for doing things like: + + .. code-block:: cpp + + void c_interface_using_time_t(const char* p, time_t); + + void foo(path p) { + file_time_type tp = last_write_time(p); + time_t secs = duration_cast<seconds>(tp.time_since_epoch()).count(); + c_interface_using_time_t(p.c_str(), secs); + } + +Cons: + +* It isn't always available (but on 64 bit machines, it normally is). +* It causes ``file_time_type`` to have a larger range than ``timespec``. +* It doesn't always act the same as other builtin integer types. For example + with ``cout`` or ``to_string``. +* Allows implicit truncation to 64 bit integers. +* It can be implicitly converted to a builtin integer type by the user, + truncating its value. + +Arithmetic ``timespec`` Emulation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Pros: + +* It has the exact same range and resolution of ``timespec`` when representing + a nanosecond tick period. +* It's always available, unlike ``__int128_t``. + +Cons: + +* It has a larger range when representing any period longer than a nanosecond. +* Doesn't actually allow users to use it like a ``timespec``. +* The required representation of using ``tv_sec`` to store the giga tick count + and ``tv_nsec`` to store the remainder adds nothing over a 128 bit integer, + but complicates a lot. +* It isn't a builtin integer type, and can't be used anything like one. +* Chrono can be made to work with it, but not nicely. +* Emulating arithmetic classes come with their own host of problems regarding + overload resolution (Each operator needs three SFINAE constrained versions of + it in order to act like builtin integer types). +* It offers little over simply using ``__int128_t``. +* It acts the most differently than implementations using an actual integer type, + which has a high chance of breaking source compatibility. + + +Selected Solution - Using ``__int128_t`` +========================================= + +The solution I selected for libc++ is using ``__int128_t`` when available, +and otherwise falling back to using ``long long`` with nanosecond precision. + +When ``__int128_t`` is available, or when ``time_t`` is 32-bits, the implementation +provides same resolution and a greater range than ``timespec``. Otherwise +it still provides the same resolution, but is limited to a range of +/- 300 +years. This final case should be rather rare, as ``__int128_t`` +is normally available in 64-bit builds, and ``time_t`` is normally 32-bits +during 32-bit builds. + +Although falling back to ``long long`` and nanosecond precision is less than +ideal, it also happens to be the implementation provided by both libstdc++ +and MSVC. (So that makes it better, right?) + +Although the ``timespec`` emulation solution is feasible and would largely +do what we want, it comes with too many complications, potential problems +and discrepancies when compared to "normal" chrono time points and durations. + +An emulation of a builtin arithmetic type using a class is never going to act +exactly the same, and the difference will be felt by users. It's not reasonable +to expect them to tolerate and work around these differences. And once +we commit to an ABI it will be too late to change. Committing to this seems +risky. + +Therefore, ``__int128_t`` seems like the better solution. diff --git a/docs/DesignDocs/ThreadingSupportAPI.rst b/docs/DesignDocs/ThreadingSupportAPI.rst index 556c45b7e1f73..330ce74cf77a6 100644 --- a/docs/DesignDocs/ThreadingSupportAPI.rst +++ b/docs/DesignDocs/ThreadingSupportAPI.rst @@ -66,6 +66,10 @@ Threading Configuration Macros This macro is defined when libc++ should use POSIX threads to implement the internal threading API. +**_LIBCPP_HAS_THREAD_API_WIN32** + This macro is defined when libc++ should use Win32 threads to implement the + internal threading API. + **_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL** This macro is defined when libc++ expects the definitions of the internal threading API to be provided by an external library. When defined diff --git a/docs/DesignDocs/VisibilityMacros.rst b/docs/DesignDocs/VisibilityMacros.rst index 993ce2cca5fd1..878566ea0bc16 100644 --- a/docs/DesignDocs/VisibilityMacros.rst +++ b/docs/DesignDocs/VisibilityMacros.rst @@ -40,11 +40,11 @@ Visibility Macros this macro therefore expands to `__declspec(dllexport)` when building the library and has an empty definition otherwise. -**_LIBCPP_INLINE_VISIBILITY** - Mark a function as hidden and force inlining whenever possible. - -**_LIBCPP_ALWAYS_INLINE** - A synonym for `_LIBCPP_INLINE_VISIBILITY` +**_LIBCPP_HIDE_FROM_ABI** + Mark a function as not being part of the ABI of any final linked image that + uses it, and also as being internal to each TU that uses that function. In + other words, the address of a function marked with this attribute is not + guaranteed to be the same across translation units. **_LIBCPP_TYPE_VIS** Mark a type's typeinfo, vtable and members as having default visibility. @@ -155,6 +155,22 @@ Visibility Macros versioning namespace. This allows throwing and catching some exception types between libc++ and libstdc++. +**_LIBCPP_INTERNAL_LINKAGE** + Mark the affected entity as having internal linkage (i.e. the `static` + keyword in C). This is only a best effort: when the `internal_linkage` + attribute is not available, we fall back to forcing the function to be + inlined, which approximates internal linkage since an externally visible + symbol is never generated for that function. This is an internal macro + used as an implementation detail by other visibility macros. Never mark + a function or a class with this macro directly. + +**_LIBCPP_ALWAYS_INLINE** + Forces inlining of the function it is applied to. For visibility purposes, + this macro is used to make sure that an externally visible symbol is never + generated in an object file when the `internal_linkage` attribute is not + available. This is an internal macro used by other visibility macros, and + it should not be used directly. + Links ===== diff --git a/docs/Makefile.sphinx b/docs/Makefile.sphinx index ae37a34b54eeb..a34f0cc0bad3e 100644 --- a/docs/Makefile.sphinx +++ b/docs/Makefile.sphinx @@ -5,7 +5,7 @@ # out-of-tree builds. # You can set these variables from the command line. -SPHINXOPTS = -n -W +SPHINXOPTS = -n -W -v SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst index f54234d6aa3f9..e10a27c598a13 100644 --- a/docs/UsingLibcxx.rst +++ b/docs/UsingLibcxx.rst @@ -49,6 +49,24 @@ An example of using ``LD_LIBRARY_PATH``: $ export LD_LIBRARY_PATH=<libcxx-install-prefix>/lib $ ./a.out # Searches for libc++ along LD_LIBRARY_PATH + +Using ``<filesystem>`` and libc++fs +==================================== + +Libc++ provides the implementation of the filesystem library in a separate +library. Users of ``<filesystem>`` and ``<experimental/filesystem>`` are +required to link ``-lc++fs``. + +.. note:: + Prior to libc++ 7.0, users of ``<experimental/filesystem>`` were required + to link libc++experimental. + +.. warning:: + The Filesystem library is still experimental in nature. As such normal + guarantees about ABI stability and backwards compatibility do not yet apply + to it. In the future, this restriction will be removed. + + Using libc++experimental and ``<experimental/...>`` ===================================================== @@ -65,6 +83,9 @@ installed. For information on building libc++experimental from source see :ref:`Building Libc++ <build instructions>` and :ref:`libc++experimental CMake Options <libc++experimental options>`. +Note that as of libc++ 7.0 using the ``<experimental/filesystem>`` requires linking +libc++fs instead of libc++experimental. + Also see the `Experimental Library Implementation Status <http://libcxx.llvm.org/ts1z_status.html>`__ page. diff --git a/docs/conf.py b/docs/conf.py index bb231ac3e353b..4c1ea3653cdb9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,9 +47,9 @@ copyright = u'2011-2017, LLVM Project' # built documents. # # The short X.Y version. -version = '6.0' +version = '7.0' # The full version, including alpha/beta/rc tags. -release = '6.0' +release = '7.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 3526b47210f01..e4b3a879da943 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -134,6 +134,7 @@ Design Documents DesignDocs/ABIVersioning DesignDocs/VisibilityMacros DesignDocs/ThreadingSupportAPI + DesignDocs/FileTimeType * `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_ * `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_ diff --git a/fuzzing/fuzz_test.cpp b/fuzzing/fuzz_test.cpp new file mode 100644 index 0000000000000..98ebe99bf2f61 --- /dev/null +++ b/fuzzing/fuzz_test.cpp @@ -0,0 +1,195 @@ +// -*- C++ -*- +//===------------------------- fuzz_test.cpp ------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// A simple program for running regressions on the fuzzing routines. +// This code is not part of any shipping product. +// +// To build: +// clang++ -std=c++11 fuzz_test.cpp fuzzing.cpp +// +// To use: +// fuzz_test -r partial_sort [-v] files... +// +// Each file should contain a test case. + +// TODO: should add some memory tracking, too. + + +#include <iostream> +#include <fstream> +#include <iterator> +#include <vector> +#include <map> +#include <chrono> + +#include "fuzzing.h" + +// ==== Count memory allocations ==== + +struct MemoryCounters { + size_t totalAllocationCount; + size_t netAllocationCount; + size_t totalBytesAllocated; + }; + +MemoryCounters gMemoryCounters; + +void ZeroMemoryCounters() { + gMemoryCounters.totalAllocationCount = 0; + gMemoryCounters.netAllocationCount = 0; + gMemoryCounters.totalBytesAllocated = 0; +} + +void* operator new(std::size_t size) +{ + if (size == 0) size = 1; + void *p = ::malloc(size); + if (p == NULL) + throw std::bad_alloc(); + gMemoryCounters.totalAllocationCount += 1; + gMemoryCounters.netAllocationCount += 1; + gMemoryCounters.totalBytesAllocated += size; + return p; +} + +void* operator new(std::size_t size, const std::nothrow_t&) noexcept +{ + try { return operator new(size); } + catch (const std::bad_alloc &) {} + return nullptr; +} + +void* operator new[](std::size_t size) +{ + return ::operator new(size); +} + +void* operator new[](std::size_t size, const std::nothrow_t&) noexcept +{ + try { return operator new(size); } + catch (const std::bad_alloc &) {} + return nullptr; +} + +void operator delete(void* ptr) noexcept +{ + if (ptr) + ::free(ptr); + gMemoryCounters.netAllocationCount -= 1; +} + +void operator delete(void* ptr, const std::nothrow_t&) noexcept +{ + ::operator delete(ptr); +} + +void operator delete[](void* ptr) noexcept +{ + ::operator delete(ptr); +} + +void operator delete[](void* ptr, const std::nothrow_t&) noexcept +{ + ::operator delete(ptr); +} + +// ==== End count memory allocations ==== + + +typedef int (*FuzzProc) (const uint8_t *data, size_t size); + +const std::map<std::string, FuzzProc> procs = { + {"sort", fuzzing::sort}, + {"stable_sort", fuzzing::stable_sort}, + {"partition", fuzzing::partition}, + {"partition_copy", fuzzing::partition_copy}, + {"stable_partition", fuzzing::stable_partition}, + {"unique", fuzzing::unique}, + {"unique_copy", fuzzing::unique_copy}, + {"nth_element", fuzzing::nth_element}, + {"partial_sort", fuzzing::partial_sort}, + {"partial_sort_copy", fuzzing::partial_sort_copy}, + {"make_heap", fuzzing::make_heap}, + {"push_heap", fuzzing::push_heap}, + {"pop_heap", fuzzing::pop_heap}, + {"regex_ECMAScript", fuzzing::regex_ECMAScript}, + {"regex_POSIX", fuzzing::regex_POSIX}, + {"regex_extended", fuzzing::regex_extended}, + {"regex_awk", fuzzing::regex_awk}, + {"regex_grep", fuzzing::regex_grep}, + {"regex_egrep", fuzzing::regex_egrep}, + {"search", fuzzing::search} +}; + + + +bool verbose = false; + +void test_one(const char *filename, FuzzProc fp) +{ + std::vector<uint8_t> v; + std::ifstream f (filename, std::ios::binary); + if (!f.is_open()) + std::cerr << "## Can't open '" << filename << "'" << std::endl; + else + { + typedef std::istream_iterator<uint8_t> Iter; + std::copy(Iter(f), Iter(), std::back_inserter(v)); + if (verbose) + std::cout << "File '" << filename << "' contains " << v.size() << " entries" << std::endl; + ZeroMemoryCounters(); + const auto start_time = std::chrono::high_resolution_clock::now(); + int ret = fp (v.data(), v.size()); + const auto finish_time = std::chrono::high_resolution_clock::now(); + MemoryCounters mc = gMemoryCounters; + if (ret != 0) + std::cerr << "## Failure code: " << ret << std::endl; + if (verbose) + { + std::cout << "Execution time: " + << std::chrono::duration_cast<std::chrono::milliseconds>(finish_time - start_time).count() + << " milliseconds" << std::endl; + std::cout << "Memory: " + << mc.totalBytesAllocated << " bytes allocated (" + << mc.totalAllocationCount << " allocations); " + << mc.netAllocationCount << " allocations remain" << std::endl; + } + } +} + +void usage (const char *name) +{ + std::cout << "Usage: " << name << " -r proc [-v] files..." << std::endl; + std::cout << "Supported routines:" << std::endl; + for (const auto &p : procs) + std::cout << " " << p.first << std::endl; + std::cout << std::endl; +} + +// Poor man's command-line options +const std::string dashR("-r"); +const std::string dashV("-v"); + +int main(int argc, char *argv[]) +{ + if (argc < 4 || dashR != argv[1] || procs.find(argv[2]) == procs.end()) + usage(argv[0]); + else { + FuzzProc fp = procs.find(argv[2])->second; + int firstFile = 3; + if (dashV == argv[firstFile]) + { + verbose = true; + ++firstFile; + } + for (int i = firstFile; i < argc; ++i) + test_one(argv[i], fp); + } +} diff --git a/fuzzing/fuzzing.cpp b/fuzzing/fuzzing.cpp index 9471a1d0af906..8888cbeac72ea 100644 --- a/fuzzing/fuzzing.cpp +++ b/fuzzing/fuzzing.cpp @@ -105,6 +105,60 @@ struct is_even<stable_test> typedef std::vector<uint8_t> Vec; typedef std::vector<stable_test> StableVec; +typedef StableVec::const_iterator SVIter; + +// Cheap version of is_permutation +// Builds a set of buckets for each of the key values. +// Sums all the payloads. +// Not 100% perfect, but _way_ faster +bool is_permutation(SVIter first1, SVIter last1, SVIter first2) +{ + size_t xBuckets[256] = {0}; + size_t xPayloads[256] = {0}; + size_t yBuckets[256] = {0}; + size_t yPayloads[256] = {0}; + + for (; first1 != last1; ++first1, ++first2) + { + xBuckets [first1->key]++; + xPayloads[first1->key] += first1->payload; + + yBuckets [first2->key]++; + yPayloads[first2->key] += first2->payload; + } + + for (size_t i = 0; i < 256; ++i) + { + if (xBuckets[i] != yBuckets[i]) + return false; + if (xPayloads[i] != yPayloads[i]) + return false; + } + + return true; +} + +template <typename Iter1, typename Iter2> +bool is_permutation(Iter1 first1, Iter1 last1, Iter2 first2) +{ + static_assert((std::is_same<typename std::iterator_traits<Iter1>::value_type, uint8_t>::value), ""); + static_assert((std::is_same<typename std::iterator_traits<Iter2>::value_type, uint8_t>::value), ""); + + size_t xBuckets[256] = {0}; + size_t yBuckets[256] = {0}; + + for (; first1 != last1; ++first1, ++first2) + { + xBuckets [*first1]++; + yBuckets [*first2]++; + } + + for (size_t i = 0; i < 256; ++i) + if (xBuckets[i] != yBuckets[i]) + return false; + + return true; +} // == sort == int sort(const uint8_t *data, size_t size) @@ -113,7 +167,7 @@ int sort(const uint8_t *data, size_t size) std::sort(working.begin(), working.end()); if (!std::is_sorted(working.begin(), working.end())) return 1; - if (!std::is_permutation(data, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99; return 0; } @@ -135,7 +189,7 @@ int stable_sort(const uint8_t *data, size_t size) if (!std::is_sorted(range.first, range.second, total_less())) return 2; iter = range.second; } - if (!std::is_permutation(input.begin(), input.end(), working.begin())) return 99; + if (!fuzzing::is_permutation(input.cbegin(), input.cend(), working.cbegin())) return 99; return 0; } @@ -147,7 +201,7 @@ int partition(const uint8_t *data, size_t size) if (!std::all_of (working.begin(), iter, is_even<uint8_t>())) return 1; if (!std::none_of(iter, working.end(), is_even<uint8_t>())) return 2; - if (!std::is_permutation(data, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99; return 0; } @@ -190,7 +244,7 @@ int stable_partition (const uint8_t *data, size_t size) if (!std::none_of(iter, working.end(), is_even<stable_test>())) return 2; if (!std::is_sorted(working.begin(), iter, payload_less())) return 3; if (!std::is_sorted(iter, working.end(), payload_less())) return 4; - if (!std::is_permutation(input.begin(), input.end(), working.begin())) return 99; + if (!fuzzing::is_permutation(input.cbegin(), input.cend(), working.cbegin())) return 99; return 0; } @@ -216,7 +270,7 @@ int nth_element (const uint8_t *data, size_t size) return 1; if (!std::all_of(partition_iter, working.end(), [=](uint8_t v) { return v >= nth; })) return 2; - if (!std::is_permutation(data + 1, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data + 1, data + size, working.cbegin())) return 99; } return 0; @@ -241,7 +295,7 @@ int partial_sort (const uint8_t *data, size_t size) return 2; } if (!std::is_sorted(working.begin(), sort_iter)) return 3; - if (!std::is_permutation(data + 1, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data + 1, data + size, working.cbegin())) return 99; return 0; } @@ -440,7 +494,7 @@ int make_heap (const uint8_t *data, size_t size) std::make_heap(working.begin(), working.end()); if (!std::is_heap(working.begin(), working.end())) return 1; - if (!std::is_permutation(data, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99; return 0; } @@ -461,7 +515,7 @@ int push_heap (const uint8_t *data, size_t size) if (!std::is_heap(working.begin(), iter)) return 2; } - if (!std::is_permutation(data, data + size, working.begin())) return 99; + if (!fuzzing::is_permutation(data, data + size, working.cbegin())) return 99; return 0; } diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b98e09260ca17..c5e92e4c4bda1 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,58 +1,262 @@ -if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS) - set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE) -endif() - -set(LIBCXX_HEADER_PATTERN - PATTERN "*" - PATTERN "CMakeLists.txt" EXCLUDE - PATTERN ".svn" EXCLUDE - PATTERN "__config_site.in" EXCLUDE - ${LIBCXX_SUPPORT_HEADER_PATTERN} +set(files + __bit_reference + __bsd_locale_defaults.h + __bsd_locale_fallbacks.h + __errc + __debug + __functional_03 + __functional_base + __functional_base_03 + __hash_table + __libcpp_version + __locale + __mutex_base + __nullptr + __split_buffer + __sso_allocator + __std_stream + __string + __threading_support + __tree + __tuple + __undef_macros + algorithm + any + array + atomic + bitset + cassert + ccomplex + cctype + cerrno + cfenv + cfloat + chrono + cinttypes + ciso646 + climits + clocale + cmath + codecvt + compare + complex + complex.h + condition_variable + csetjmp + csignal + cstdarg + cstdbool + cstddef + cstdint + cstdio + cstdlib + cstring + ctgmath + ctime + ctype.h + cwchar + cwctype + deque + errno.h + exception + experimental/__config + experimental/__memory + experimental/algorithm + experimental/any + experimental/chrono + experimental/coroutine + experimental/deque + experimental/dynarray + experimental/filesystem + experimental/forward_list + experimental/functional + experimental/iterator + experimental/list + experimental/map + experimental/memory_resource + experimental/numeric + experimental/optional + experimental/propagate_const + experimental/ratio + experimental/regex + experimental/set + experimental/simd + experimental/string + experimental/string_view + experimental/system_error + experimental/tuple + experimental/type_traits + experimental/unordered_map + experimental/unordered_set + experimental/utility + experimental/vector + ext/__hash + ext/hash_map + ext/hash_set + filesystem + float.h + forward_list + fstream + functional + future + initializer_list + inttypes.h + iomanip + ios + iosfwd + iostream + istream + iterator + limits + limits.h + list + locale + locale.h + map + math.h + memory + module.modulemap + mutex + new + numeric + optional + ostream + queue + random + ratio + regex + scoped_allocator + set + setjmp.h + shared_mutex + span + sstream + stack + stdbool.h + stddef.h + stdexcept + stdint.h + stdio.h + stdlib.h + streambuf + string + string.h + string_view + strstream + system_error + tgmath.h + thread + tuple + type_traits + typeindex + typeinfo + unordered_map + unordered_set + utility + valarray + variant + vector + version + wchar.h + wctype.h ) -if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR) - file(COPY . - DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1" - FILES_MATCHING - ${LIBCXX_HEADER_PATTERN} +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 + support/xlocale/xlocale.h ) endif() -if (LIBCXX_INSTALL_HEADERS) - install(DIRECTORY . - DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 - COMPONENT cxx-headers - FILES_MATCHING - ${LIBCXX_HEADER_PATTERN} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +if (LIBCXX_NEEDS_SITE_CONFIG) + # 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 ${PYTHON_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) + set(generated_config_deps cxx-generated-config) +else() + set(files + ${files} + __config + ) +endif() + +if(NOT LIBCXX_USING_INSTALLED_LLVM AND 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() if (LIBCXX_NEEDS_SITE_CONFIG) - # Generate and install 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 ${PYTHON_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 + # Copy the generated header as __config into build directory. + set(src ${LIBCXX_BINARY_DIR}/__generated_config) + set(dst ${output_dir}/__config) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} ${generated_config_deps} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying CXX __config") + list(APPEND out_files ${dst}) + endif() + + add_custom_target(cxx-headers ALL DEPENDS ${out_files} ${LIBCXX_CXX_ABI_HEADER_TARGET}) +else() + add_custom_target(cxx-headers) +endif() +set_target_properties(cxx-headers PROPERTIES FOLDER "Misc") + +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-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) - # Add a target that executes the generation commands. - add_custom_target(generate_config_header ALL - DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config) - set(generated_config_deps generate_config_header) + endforeach() + + if (LIBCXX_NEEDS_SITE_CONFIG) # Install the generated header as __config. install(FILES ${LIBCXX_BINARY_DIR}/__generated_config - DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1 + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ RENAME __config COMPONENT cxx-headers) endif() if (NOT CMAKE_CONFIGURATION_TYPES) - # this target is just needed as a placeholder for the distribution target - add_custom_target(cxx-headers) add_custom_target(install-cxx-headers DEPENDS cxx-headers ${generated_config_deps} COMMAND "${CMAKE_COMMAND}" @@ -61,9 +265,7 @@ if (LIBCXX_INSTALL_HEADERS) # Stripping is a no-op for headers add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers) - add_custom_target(libcxx-headers) add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers) add_custom_target(install-libcxx-headers-stripped DEPENDS install-cxx-headers-stripped) endif() - endif() diff --git a/include/__bsd_locale_fallbacks.h b/include/__bsd_locale_fallbacks.h index 5e9e09483072f..3097b01410d35 100644 --- a/include/__bsd_locale_fallbacks.h +++ b/include/__bsd_locale_fallbacks.h @@ -24,28 +24,28 @@ _LIBCPP_BEGIN_NAMESPACE_STD -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l) { __libcpp_locale_guard __current(__l); return MB_CUR_MAX; } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_btowc_l(int __c, locale_t __l) { __libcpp_locale_guard __current(__l); return btowc(__c); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY int __libcpp_wctob_l(wint_t __c, locale_t __l) { __libcpp_locale_guard __current(__l); return wctob(__c); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc, size_t __len, mbstate_t *__ps, locale_t __l) { @@ -53,14 +53,14 @@ size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc, return wcsnrtombs(__dest, __src, __nwc, __len, __ps); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return wcrtomb(__s, __wc, __ps); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms, size_t __len, mbstate_t *__ps, locale_t __l) { @@ -68,7 +68,7 @@ size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms, return mbsnrtowcs(__dest, __src, __nms, __len, __ps); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { @@ -76,28 +76,28 @@ size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n, return mbrtowc(__pwc, __s, __n, __ps); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l) { __libcpp_locale_guard __current(__l); return mbtowc(__pwc, __pmb, __max); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l) { __libcpp_locale_guard __current(__l); return mbrlen(__s, __n, __ps); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY lconv *__libcpp_localeconv_l(locale_t __l) { __libcpp_locale_guard __current(__l); return localeconv(); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, mbstate_t *__ps, locale_t __l) { diff --git a/include/__config b/include/__config index d0f95ef283428..c01ac12be4b85 100644 --- a/include/__config +++ b/include/__config @@ -12,9 +12,9 @@ #define _LIBCPP_CONFIG #if defined(_MSC_VER) && !defined(__clang__) -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -#endif +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +# endif #endif #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER @@ -24,79 +24,95 @@ #ifdef __cplusplus #ifdef __GNUC__ -#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +# define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) // The _GNUC_VER_NEW macro better represents the new GCC versioning scheme // introduced in GCC 5.0. -#define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__) +# define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__) #else -#define _GNUC_VER 0 -#define _GNUC_VER_NEW 0 +# define _GNUC_VER 0 +# define _GNUC_VER_NEW 0 #endif -#define _LIBCPP_VERSION 6000 +#define _LIBCPP_VERSION 7000 #ifndef _LIBCPP_ABI_VERSION -#define _LIBCPP_ABI_VERSION 1 +# ifdef __Fuchsia__ +# define _LIBCPP_ABI_VERSION 2 +# else +# define _LIBCPP_ABI_VERSION 1 +# endif #endif +#ifndef _LIBCPP_STD_VER +# if __cplusplus <= 201103L +# define _LIBCPP_STD_VER 11 +# elif __cplusplus <= 201402L +# define _LIBCPP_STD_VER 14 +# elif __cplusplus <= 201703L +# define _LIBCPP_STD_VER 17 +# else +# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification +# endif +#endif // _LIBCPP_STD_VER + #if defined(__ELF__) -#define _LIBCPP_OBJECT_FORMAT_ELF 1 +# define _LIBCPP_OBJECT_FORMAT_ELF 1 #elif defined(__MACH__) -#define _LIBCPP_OBJECT_FORMAT_MACHO 1 +# define _LIBCPP_OBJECT_FORMAT_MACHO 1 #elif defined(_WIN32) -#define _LIBCPP_OBJECT_FORMAT_COFF 1 +# define _LIBCPP_OBJECT_FORMAT_COFF 1 #elif defined(__wasm__) -#define _LIBCPP_OBJECT_FORMAT_WASM 1 +# define _LIBCPP_OBJECT_FORMAT_WASM 1 #else -#error Unknown object file format +# error Unknown object file format #endif #if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 // Change short string representation so that string data starts at offset 0, // improving its alignment in some cases. -#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT +# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT // Fix deque iterator type in order to support incomplete types. -#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE +# define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE // Fix undefined behavior in how std::list stores its linked nodes. -#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB +# define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB // Fix undefined behavior in how __tree stores its end and parent nodes. -#define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB +# define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB // Fix undefined behavior in how __hash_table stores its pointer types. -#define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB -#define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB -#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE +# define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB +# define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB +# define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE // Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr // provided under the alternate keyword __nullptr, which changes the mangling // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode. -#define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR +# define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR // Define the `pointer_safety` enum as a C++11 strongly typed enumeration // instead of as a class simulating an enum. If this option is enabled // `pointer_safety` and `get_pointer_safety()` will no longer be available // in C++03. -#define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE +# define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE // Define a key function for `bad_function_call` in the library, to centralize // its vtable and typeinfo to libc++ rather than having all other libraries // using that class define their own copies. -#define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION +# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION // Enable optimized version of __do_get_(un)signed which avoids redundant copies. -#define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET +# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET // Use the smallest possible integer type to represent the index of the variant. // Previously libc++ used "unsigned int" exclusivly. -#define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION +# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION #elif _LIBCPP_ABI_VERSION == 1 -#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) +# if !defined(_LIBCPP_OBJECT_FORMAT_COFF) // Enable compiling copies of now inline methods into the dylib to support // applications compiled against older libraries. This is unnecessary with // COFF dllexport semantics, since dllexport forces a non-inline definition // of inline functions to be emitted anyway. Our own non-inline copy would // conflict with the dllexport-emitted copy, so we disable it. -#define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS -#endif +# define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS +# endif // Feature macros for disabling pre ABI v1 features. All of these options // are deprecated. -#if defined(__FreeBSD__) -#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR -#endif +# if defined(__FreeBSD__) +# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR +# endif #endif #ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR @@ -116,46 +132,50 @@ #ifndef __has_attribute #define __has_attribute(__x) 0 #endif + #ifndef __has_builtin #define __has_builtin(__x) 0 #endif + #ifndef __has_extension #define __has_extension(__x) 0 #endif + #ifndef __has_feature #define __has_feature(__x) 0 #endif + #ifndef __has_cpp_attribute #define __has_cpp_attribute(__x) 0 #endif + // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by // the compiler and '1' otherwise. #ifndef __is_identifier #define __is_identifier(__x) 1 #endif + #ifndef __has_declspec_attribute #define __has_declspec_attribute(__x) 0 #endif #define __has_keyword(__x) !(__is_identifier(__x)) -#ifdef __has_include -#define __libcpp_has_include(__x) __has_include(__x) -#else -#define __libcpp_has_include(__x) 0 +#ifndef __has_include +#define __has_include(...) 0 #endif #if defined(__clang__) -#define _LIBCPP_COMPILER_CLANG -# ifndef __apple_build_version__ -# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) -# endif +# define _LIBCPP_COMPILER_CLANG +# ifndef __apple_build_version__ +# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) +# endif #elif defined(__GNUC__) -#define _LIBCPP_COMPILER_GCC +# define _LIBCPP_COMPILER_GCC #elif defined(_MSC_VER) -#define _LIBCPP_COMPILER_MSVC +# define _LIBCPP_COMPILER_MSVC #elif defined(__IBMCPP__) -#define _LIBCPP_COMPILER_IBM +# define _LIBCPP_COMPILER_IBM #endif #ifndef _LIBCPP_CLANG_VER @@ -168,67 +188,69 @@ // and allow the user to explicitly specify the ABI to handle cases where this // heuristic falls short. #if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT) -# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined" +# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined" #elif defined(_LIBCPP_ABI_FORCE_ITANIUM) -# define _LIBCPP_ABI_ITANIUM +# define _LIBCPP_ABI_ITANIUM #elif defined(_LIBCPP_ABI_FORCE_MICROSOFT) -# define _LIBCPP_ABI_MICROSOFT -#else -# if defined(_WIN32) && defined(_MSC_VER) # define _LIBCPP_ABI_MICROSOFT -# else -# define _LIBCPP_ABI_ITANIUM -# endif +#else +# if defined(_WIN32) && defined(_MSC_VER) +# define _LIBCPP_ABI_MICROSOFT +# else +# define _LIBCPP_ABI_ITANIUM +# endif #endif // Need to detect which libc we're using if we're on Linux. #if defined(__linux__) -#include <features.h> -#if !defined(__GLIBC_PREREQ) -#define __GLIBC_PREREQ(a, b) 0 -#endif // !defined(__GLIBC_PREREQ) +# include <features.h> +# if defined(__GLIBC_PREREQ) +# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) +# else +# define _LIBCPP_GLIBC_PREREQ(a, b) 0 +# endif // defined(__GLIBC_PREREQ) #endif // defined(__linux__) #ifdef __LITTLE_ENDIAN__ -#if __LITTLE_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN -#endif // __LITTLE_ENDIAN__ +# if __LITTLE_ENDIAN__ +# define _LIBCPP_LITTLE_ENDIAN +# endif // __LITTLE_ENDIAN__ #endif // __LITTLE_ENDIAN__ #ifdef __BIG_ENDIAN__ -#if __BIG_ENDIAN__ -#define _LIBCPP_BIG_ENDIAN -#endif // __BIG_ENDIAN__ +# if __BIG_ENDIAN__ +# define _LIBCPP_BIG_ENDIAN +# endif // __BIG_ENDIAN__ #endif // __BIG_ENDIAN__ #ifdef __BYTE_ORDER__ -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define _LIBCPP_BIG_ENDIAN -#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define _LIBCPP_LITTLE_ENDIAN +# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define _LIBCPP_BIG_ENDIAN +# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #endif // __BYTE_ORDER__ #ifdef __FreeBSD__ -# include <sys/endian.h> +# include <sys/endian.h> # if _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN -# else // _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_BIG_ENDIAN -# endif // _BYTE_ORDER == _LITTLE_ENDIAN -# ifndef __LONG_LONG_SUPPORTED -# define _LIBCPP_HAS_NO_LONG_LONG -# endif // __LONG_LONG_SUPPORTED +# define _LIBCPP_LITTLE_ENDIAN +# else // _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_BIG_ENDIAN +# endif // _BYTE_ORDER == _LITTLE_ENDIAN +# ifndef __LONG_LONG_SUPPORTED +# define _LIBCPP_HAS_NO_LONG_LONG +# endif // __LONG_LONG_SUPPORTED #endif // __FreeBSD__ #ifdef __NetBSD__ -# include <sys/endian.h> +# include <sys/endian.h> # if _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN -# else // _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_BIG_ENDIAN -# endif // _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_LITTLE_ENDIAN +# else // _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_BIG_ENDIAN +# endif // _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_HAS_QUICK_EXIT #endif // __NetBSD__ #if defined(_WIN32) @@ -245,64 +267,65 @@ # if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__)) # define _LIBCPP_HAS_BITSCAN64 # endif -# if defined(_LIBCPP_MSVCRT) -# define _LIBCPP_HAS_QUICK_EXIT -# endif +# define _LIBCPP_HAS_OPEN_WITH_WCHAR +# if defined(_LIBCPP_MSVCRT) +# define _LIBCPP_HAS_QUICK_EXIT +# endif // Some CRT APIs are unavailable to store apps -#if defined(WINAPI_FAMILY) -#include <winapifamily.h> -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \ - (!defined(WINAPI_PARTITION_SYSTEM) || \ - !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM)) -#define _LIBCPP_WINDOWS_STORE_APP -#endif -#endif +# if defined(WINAPI_FAMILY) +# include <winapifamily.h> +# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \ + (!defined(WINAPI_PARTITION_SYSTEM) || \ + !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM)) +# define _LIBCPP_WINDOWS_STORE_APP +# endif +# endif #endif // defined(_WIN32) #ifdef __sun__ -# include <sys/isa_defs.h> -# ifdef _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN -# else -# define _LIBCPP_BIG_ENDIAN -# endif +# include <sys/isa_defs.h> +# ifdef _LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN +# else +# define _LIBCPP_BIG_ENDIAN +# endif #endif // __sun__ #if defined(__CloudABI__) - // Certain architectures provide arc4random(). Prefer using - // arc4random() over /dev/{u,}random to make it possible to obtain - // random data even when using sandboxing mechanisms such as chroots, - // Capsicum, etc. -# define _LIBCPP_USING_ARC4_RANDOM + // Certain architectures provide arc4random(). Prefer using + // arc4random() over /dev/{u,}random to make it possible to obtain + // random data even when using sandboxing mechanisms such as chroots, + // Capsicum, etc. +# define _LIBCPP_USING_ARC4_RANDOM #elif defined(__Fuchsia__) -# define _LIBCPP_USING_GETENTROPY +# define _LIBCPP_USING_GETENTROPY #elif defined(__native_client__) - // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, - // including accesses to the special files under /dev. C++11's - // std::random_device is instead exposed through a NaCl syscall. -# define _LIBCPP_USING_NACL_RANDOM + // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, + // including accesses to the special files under /dev. C++11's + // std::random_device is instead exposed through a NaCl syscall. +# define _LIBCPP_USING_NACL_RANDOM #elif defined(_LIBCPP_WIN32API) -# define _LIBCPP_USING_WIN32_RANDOM +# define _LIBCPP_USING_WIN32_RANDOM #else -# define _LIBCPP_USING_DEV_RANDOM +# define _LIBCPP_USING_DEV_RANDOM #endif #if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) -# include <endian.h> -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN -# elif __BYTE_ORDER == __BIG_ENDIAN -# define _LIBCPP_BIG_ENDIAN -# else // __BYTE_ORDER == __BIG_ENDIAN -# error unable to determine endian -# endif +# include <endian.h> +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN +# elif __BYTE_ORDER == __BIG_ENDIAN +# define _LIBCPP_BIG_ENDIAN +# else // __BYTE_ORDER == __BIG_ENDIAN +# error unable to determine endian +# endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) #if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC) -#define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) +# define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) #else -#define _LIBCPP_NO_CFI +# define _LIBCPP_NO_CFI #endif #if defined(_LIBCPP_COMPILER_CLANG) @@ -355,11 +378,11 @@ typedef __char32_t char32_t; #endif #if !(__has_feature(cxx_nullptr)) -# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR) -# define nullptr __nullptr -# else -# define _LIBCPP_HAS_NO_NULLPTR -# endif +# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR) +# define nullptr __nullptr +# else +# define _LIBCPP_HAS_NO_NULLPTR +# endif #endif #if !(__has_feature(cxx_rvalue_references)) @@ -379,11 +402,11 @@ typedef __char32_t char32_t; #endif #if __has_feature(is_base_of) -# define _LIBCPP_HAS_IS_BASE_OF +#define _LIBCPP_HAS_IS_BASE_OF #endif #if __has_feature(is_final) -# define _LIBCPP_HAS_IS_FINAL +#define _LIBCPP_HAS_IS_FINAL #endif // Objective-C++ features (opt-in) @@ -408,25 +431,25 @@ typedef __char32_t char32_t; #endif #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L -#if defined(__FreeBSD__) -#define _LIBCPP_HAS_QUICK_EXIT -#define _LIBCPP_HAS_C11_FEATURES -#elif defined(__Fuchsia__) -#define _LIBCPP_HAS_QUICK_EXIT -#define _LIBCPP_HAS_C11_FEATURES -#elif defined(__linux__) -#if !defined(_LIBCPP_HAS_MUSL_LIBC) -#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__) -#define _LIBCPP_HAS_QUICK_EXIT -#endif -#if __GLIBC_PREREQ(2, 17) -#define _LIBCPP_HAS_C11_FEATURES -#endif -#else // defined(_LIBCPP_HAS_MUSL_LIBC) -#define _LIBCPP_HAS_QUICK_EXIT -#define _LIBCPP_HAS_C11_FEATURES -#endif -#endif // __linux__ +# if defined(__FreeBSD__) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_C11_FEATURES +# elif defined(__Fuchsia__) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_C11_FEATURES +# elif defined(__linux__) +# if !defined(_LIBCPP_HAS_MUSL_LIBC) +# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__) +# define _LIBCPP_HAS_QUICK_EXIT +# endif +# if _LIBCPP_GLIBC_PREREQ(2, 17) +# define _LIBCPP_HAS_C11_FEATURES +# endif +# else // defined(_LIBCPP_HAS_MUSL_LIBC) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_C11_FEATURES +# endif +# endif // __linux__ #endif #if !(__has_feature(cxx_noexcept)) @@ -434,11 +457,11 @@ typedef __char32_t char32_t; #endif #if __has_feature(underlying_type) -# define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) +#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) #endif #if __has_feature(is_literal) -# define _LIBCPP_IS_LITERAL(T) __is_literal(T) +#define _LIBCPP_IS_LITERAL(T) __is_literal(T) #endif // Inline namespaces are available in Clang regardless of C++ dialect. @@ -458,12 +481,18 @@ namespace std { // Allow for build-time disabling of unsigned integer sanitization #if !defined(_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize) #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) -#endif +#endif #if __has_builtin(__builtin_launder) -#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER +#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER #endif +#if !__is_identifier(__has_unique_object_representations) +#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS +#endif + +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) + #elif defined(_LIBCPP_COMPILER_GCC) #define _ALIGNAS(x) __attribute__((__aligned__(x))) @@ -478,7 +507,7 @@ namespace std { #endif #if defined(__GNUC__) && _GNUC_VER >= 403 -# define _LIBCPP_HAS_IS_BASE_OF +#define _LIBCPP_HAS_IS_BASE_OF #endif #if !__EXCEPTIONS @@ -487,10 +516,10 @@ namespace std { // constexpr was added to GCC in 4.6. #if _GNUC_VER < 406 -#define _LIBCPP_HAS_NO_CONSTEXPR +# define _LIBCPP_HAS_NO_CONSTEXPR // Can only use constexpr in c++11 mode. #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L -#define _LIBCPP_HAS_NO_CONSTEXPR +# define _LIBCPP_HAS_NO_CONSTEXPR #endif // Determine if GCC supports relaxed constexpr @@ -504,6 +533,7 @@ namespace std { #endif #ifndef __GXX_EXPERIMENTAL_CXX0X__ + #define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS @@ -547,9 +577,15 @@ namespace std { #endif #if _GNUC_VER >= 700 -#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER +#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER +#endif + +#if _GNUC_VER >= 700 +#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS #endif +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) + #elif defined(_LIBCPP_COMPILER_MSVC) #define _LIBCPP_TOSTRING2(x) #x @@ -564,25 +600,26 @@ namespace std { #define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES -#if _MSC_VER <= 1800 -#define _LIBCPP_HAS_NO_UNICODE_CHARS -#endif #define _LIBCPP_HAS_NO_NOEXCEPT #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) #define _ALIGNAS(x) __declspec(align(x)) +#define _ALIGNAS_TYPE(x) alignas(x) #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { #define _LIBCPP_END_NAMESPACE_STD } #define _VSTD std -# define _LIBCPP_WEAK namespace std { } +#define _LIBCPP_WEAK + #define _LIBCPP_HAS_NO_ASAN +#define _LIBCPP_ALWAYS_INLINE __forceinline + #elif defined(_LIBCPP_COMPILER_IBM) #define _ALIGNAS(x) __attribute__((__aligned__(x))) @@ -613,24 +650,47 @@ namespace std { #define _LIBCPP_HAS_NO_ASAN +#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) + #endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM] +#if _LIBCPP_STD_VER >= 17 +#define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \ + _LIBCPP_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem { +#else +#define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM \ + _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem { +#endif + +#define _LIBCPP_END_NAMESPACE_FILESYSTEM \ + _LIBCPP_END_NAMESPACE_STD } } + +#define _VSTD_FS _VSTD::__fs::filesystem + + #if defined(_LIBCPP_OBJECT_FORMAT_COFF) + +#ifdef _DLL +# define _LIBCPP_CRT_FUNC __declspec(dllimport) +#else +# define _LIBCPP_CRT_FUNC +#endif + #if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_DLL_VIS -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS -# define _LIBCPP_OVERRIDABLE_FUNC_VIS +# define _LIBCPP_DLL_VIS +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +# define _LIBCPP_OVERRIDABLE_FUNC_VIS #elif defined(_LIBCPP_BUILDING_LIBRARY) -# define _LIBCPP_DLL_VIS __declspec(dllexport) -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS -# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS +# define _LIBCPP_DLL_VIS __declspec(dllexport) +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS +# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS #else -# define _LIBCPP_DLL_VIS __declspec(dllimport) -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS -# define _LIBCPP_OVERRIDABLE_FUNC_VIS +# define _LIBCPP_DLL_VIS __declspec(dllimport) +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +# define _LIBCPP_OVERRIDABLE_FUNC_VIS #endif #define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS @@ -643,39 +703,36 @@ namespace std { #define _LIBCPP_ENUM_VIS #if defined(_LIBCPP_COMPILER_MSVC) -# define _LIBCPP_INLINE_VISIBILITY __forceinline -# define _LIBCPP_ALWAYS_INLINE __forceinline -# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline #else -# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) -# define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) -# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__)) +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__)) #endif + #endif // defined(_LIBCPP_OBJECT_FORMAT_COFF) #ifndef _LIBCPP_HIDDEN -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) -#else -#define _LIBCPP_HIDDEN -#endif +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) +# else +# define _LIBCPP_HIDDEN +# endif #endif #ifndef _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) // The inline should be removed once PR32114 is resolved -#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN -#else -#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS -#endif +# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN +# else +# define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS +# endif #endif #ifndef _LIBCPP_FUNC_VIS -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) -#else -#define _LIBCPP_FUNC_VIS -#endif +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) +# else +# define _LIBCPP_FUNC_VIS +# endif #endif #ifndef _LIBCPP_TYPE_VIS @@ -699,19 +756,19 @@ namespace std { #endif #ifndef _LIBCPP_EXTERN_VIS -# define _LIBCPP_EXTERN_VIS +#define _LIBCPP_EXTERN_VIS #endif #ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS -# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS +#define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS #endif #ifndef _LIBCPP_EXCEPTION_ABI -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) -#else -#define _LIBCPP_EXCEPTION_ABI -#endif +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) +# else +# define _LIBCPP_EXCEPTION_ABI +# endif #endif #ifndef _LIBCPP_ENUM_VIS @@ -731,31 +788,28 @@ namespace std { #endif #ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +#define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS #endif -#ifndef _LIBCPP_INLINE_VISIBILITY -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) +#if __has_attribute(internal_linkage) +# define _LIBCPP_INTERNAL_LINKAGE __attribute__ ((internal_linkage)) #else -#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) -#endif +# define _LIBCPP_INTERNAL_LINKAGE _LIBCPP_ALWAYS_INLINE #endif -#ifndef _LIBCPP_ALWAYS_INLINE -#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) -#else -#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) -#endif +#ifndef _LIBCPP_HIDE_FROM_ABI +# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE #endif +// Just so we can migrate to _LIBCPP_HIDE_FROM_ABI gradually. +#define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI + #ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__)) -# else -# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__always_inline__)) -# endif +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__)) +# else +# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__always_inline__)) +# endif #endif #ifndef _LIBCPP_PREFERRED_OVERLOAD @@ -773,14 +827,19 @@ namespace std { #endif #if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS) -# if !defined(_LIBCPP_DEBUG) -# error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined -# endif -# define _NOEXCEPT_DEBUG noexcept(false) -# define _NOEXCEPT_DEBUG_(x) noexcept(false) +# if !defined(_LIBCPP_DEBUG) +# error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined +# endif +# ifdef _LIBCPP_HAS_NO_NOEXCEPT +# define _NOEXCEPT_DEBUG +# define _NOEXCEPT_DEBUG_(x) +# else +# define _NOEXCEPT_DEBUG noexcept(false) +# define _NOEXCEPT_DEBUG_(x) noexcept(false) +# endif #else -# define _NOEXCEPT_DEBUG _NOEXCEPT -# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x) +# define _NOEXCEPT_DEBUG _NOEXCEPT +# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x) #endif #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -793,88 +852,88 @@ typedef unsigned int char32_t; #endif #ifdef _LIBCPP_CXX03_LANG -# if __has_extension(c_static_assert) -# define static_assert(__b, __m) _Static_assert(__b, __m) -# else +# if __has_extension(c_static_assert) +# define static_assert(__b, __m) _Static_assert(__b, __m) +# else extern "C++" { template <bool> struct __static_assert_test; template <> struct __static_assert_test<true> {}; template <unsigned> struct __static_assert_check {}; } -#define static_assert(__b, __m) \ - typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ - _LIBCPP_CONCAT(__t, __LINE__) -# endif // __has_extension(c_static_assert) +# define static_assert(__b, __m) \ + typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ + _LIBCPP_CONCAT(__t, __LINE__) +# endif // __has_extension(c_static_assert) #endif // _LIBCPP_CXX03_LANG #ifdef _LIBCPP_HAS_NO_DECLTYPE // GCC 4.6 provides __decltype in all standard modes. -#if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406 -# define decltype(__x) __decltype(__x) -#else -# define decltype(__x) __typeof__(__x) -#endif +# if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406 +# define decltype(__x) __decltype(__x) +# else +# define decltype(__x) __typeof__(__x) +# endif #endif #ifdef _LIBCPP_HAS_NO_CONSTEXPR -#define _LIBCPP_CONSTEXPR +# define _LIBCPP_CONSTEXPR #else -#define _LIBCPP_CONSTEXPR constexpr +# define _LIBCPP_CONSTEXPR constexpr #endif #ifdef _LIBCPP_CXX03_LANG -#define _LIBCPP_DEFAULT {} +# define _LIBCPP_DEFAULT {} #else -#define _LIBCPP_DEFAULT = default; +# define _LIBCPP_DEFAULT = default; #endif #ifdef _LIBCPP_CXX03_LANG -#define _LIBCPP_EQUAL_DELETE +# define _LIBCPP_EQUAL_DELETE #else -#define _LIBCPP_EQUAL_DELETE = delete +# define _LIBCPP_EQUAL_DELETE = delete #endif #ifdef __GNUC__ -#define _NOALIAS __attribute__((__malloc__)) +# define _NOALIAS __attribute__((__malloc__)) #else -#define _NOALIAS +# define _NOALIAS #endif #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \ (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions -# define _LIBCPP_EXPLICIT explicit +# define _LIBCPP_EXPLICIT explicit #else -# define _LIBCPP_EXPLICIT +# define _LIBCPP_EXPLICIT #endif #if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete) -# define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE +#define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx -#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ - __lx __v_; \ - _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ - _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ - _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ - }; +# define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx +# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ + __lx __v_; \ + _LIBCPP_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \ + _LIBCPP_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ + _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;} \ + }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x -#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) +# define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x +# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS #ifdef _LIBCPP_DEBUG -# if _LIBCPP_DEBUG == 0 -# define _LIBCPP_DEBUG_LEVEL 1 -# elif _LIBCPP_DEBUG == 1 -# define _LIBCPP_DEBUG_LEVEL 2 -# else -# error Supported values for _LIBCPP_DEBUG are 0 and 1 -# endif -# if !defined(_LIBCPP_BUILDING_LIBRARY) -# define _LIBCPP_EXTERN_TEMPLATE(...) -# endif +# if _LIBCPP_DEBUG == 0 +# define _LIBCPP_DEBUG_LEVEL 1 +# elif _LIBCPP_DEBUG == 1 +# define _LIBCPP_DEBUG_LEVEL 2 +# else +# error Supported values for _LIBCPP_DEBUG are 0 and 1 +# endif +# if !defined(_LIBCPP_BUILDING_LIBRARY) +# define _LIBCPP_EXTERN_TEMPLATE(...) +# endif #endif #ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE @@ -901,27 +960,34 @@ template <unsigned> struct __static_assert_check {}; #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -#if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) -#define _LIBCPP_HAS_CATOPEN 1 -#endif +# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) +# define _LIBCPP_HAS_CATOPEN 1 +# endif #endif #ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 #endif +// If we are getting operator new from the MSVC CRT, then allocation overloads +// for align_val_t were added in 19.12, aka VS 2017 version 15.3. +#if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 +#define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION +#endif + #if defined(__APPLE__) -# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ - defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -# endif -# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060 -# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION -# endif -# endif +# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ + defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +# endif +# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) +# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION +# endif +# endif #endif // defined(__APPLE__) + #if defined(__APPLE__) || defined(__FreeBSD__) #define _LIBCPP_HAS_DEFAULTRUNELOCALE #endif @@ -930,59 +996,48 @@ template <unsigned> struct __static_assert_check {}; #define _LIBCPP_WCTYPE_IS_MASK #endif -#ifndef _LIBCPP_STD_VER -# if __cplusplus <= 201103L -# define _LIBCPP_STD_VER 11 -# elif __cplusplus <= 201402L -# define _LIBCPP_STD_VER 14 -# elif __cplusplus <= 201703L -# define _LIBCPP_STD_VER 17 -# else -# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification -# endif -#endif // _LIBCPP_STD_VER - #if _LIBCPP_STD_VER > 11 -#define _LIBCPP_DEPRECATED [[deprecated]] +# define _LIBCPP_DEPRECATED [[deprecated]] #else -#define _LIBCPP_DEPRECATED +# define _LIBCPP_DEPRECATED #endif #if _LIBCPP_STD_VER <= 11 -#define _LIBCPP_EXPLICIT_AFTER_CXX11 -#define _LIBCPP_DEPRECATED_AFTER_CXX11 +# define _LIBCPP_EXPLICIT_AFTER_CXX11 +# define _LIBCPP_DEPRECATED_AFTER_CXX11 #else -#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit -#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]] +# define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit +# define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]] #endif #if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) -#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr +# define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr #else -#define _LIBCPP_CONSTEXPR_AFTER_CXX11 +# define _LIBCPP_CONSTEXPR_AFTER_CXX11 #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) -#define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr +# define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr #else -#define _LIBCPP_CONSTEXPR_AFTER_CXX14 +# define _LIBCPP_CONSTEXPR_AFTER_CXX14 #endif #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) -#define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr +# define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr #else -#define _LIBCPP_CONSTEXPR_AFTER_CXX17 +# define _LIBCPP_CONSTEXPR_AFTER_CXX17 #endif #if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) -#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]] +# define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]] #else -#define _LIBCPP_NODISCARD_AFTER_CXX17 +# define _LIBCPP_NODISCARD_AFTER_CXX17 #endif -// FIXME: Remove all usages of this macro once compilers catch up. -#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L) -# define _LIBCPP_HAS_NO_INLINE_VARIABLES +#if _LIBCPP_STD_VER > 14 && defined(__cpp_inline_variables) && (__cpp_inline_variables >= 201606L) +# define _LIBCPP_INLINE_VAR inline +#else +# define _LIBCPP_INLINE_VAR #endif #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -991,6 +1046,14 @@ template <unsigned> struct __static_assert_check {}; # define _LIBCPP_EXPLICIT_MOVE(x) (x) #endif +#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG +#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#define _LIBCPP_CONSTEXPR_IF_NODEBUG +#else +#define _LIBCPP_CONSTEXPR_IF_NODEBUG constexpr +#endif +#endif + #ifndef _LIBCPP_HAS_NO_ASAN _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( const void *, const void *, const void *, const void *); @@ -1000,8 +1063,10 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( // g++ and cl.exe have RTTI on by default and define a macro when it is. // g++ only defines the macro in 4.3.2 and onwards. #if !defined(_LIBCPP_NO_RTTI) -# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ - (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) +# if defined(__GNUC__) && \ + ((__GNUC__ >= 5) || \ + (__GNUC__ == 4 && (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && \ + !defined(__GXX_RTTI) # define _LIBCPP_NO_RTTI # elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI) # define _LIBCPP_NO_RTTI @@ -1009,7 +1074,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #endif #ifndef _LIBCPP_WEAK -# define _LIBCPP_WEAK __attribute__((__weak__)) +#define _LIBCPP_WEAK __attribute__((__weak__)) #endif // Thread API @@ -1017,35 +1082,35 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \ !defined(_LIBCPP_HAS_THREAD_API_WIN32) && \ !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) -# if defined(__FreeBSD__) || \ - defined(__Fuchsia__) || \ - defined(__NetBSD__) || \ - defined(__linux__) || \ - defined(__APPLE__) || \ - defined(__CloudABI__) || \ - defined(__sun__) || \ - (defined(__MINGW32__) && __libcpp_has_include(<pthread.h>)) -# define _LIBCPP_HAS_THREAD_API_PTHREAD -# elif defined(_LIBCPP_WIN32API) -# define _LIBCPP_HAS_THREAD_API_WIN32 -# else -# error "No thread API" -# endif // _LIBCPP_HAS_THREAD_API +# if defined(__FreeBSD__) || \ + defined(__Fuchsia__) || \ + defined(__NetBSD__) || \ + defined(__linux__) || \ + defined(__APPLE__) || \ + defined(__CloudABI__) || \ + defined(__sun__) || \ + (defined(__MINGW32__) && __has_include(<pthread.h>)) +# define _LIBCPP_HAS_THREAD_API_PTHREAD +# elif defined(_LIBCPP_WIN32API) +# define _LIBCPP_HAS_THREAD_API_WIN32 +# else +# error "No thread API" +# endif // _LIBCPP_HAS_THREAD_API #endif // _LIBCPP_HAS_NO_THREADS #if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD) -# error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \ - _LIBCPP_HAS_NO_THREADS is not defined. +#error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \ + _LIBCPP_HAS_NO_THREADS is not defined. #endif #if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) -# error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \ - _LIBCPP_HAS_NO_THREADS is defined. +#error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \ + _LIBCPP_HAS_NO_THREADS is defined. #endif #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS) -# error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \ - _LIBCPP_HAS_NO_THREADS is defined. +#error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \ + _LIBCPP_HAS_NO_THREADS is defined. #endif // Systems that use capability-based security (FreeBSD with Capsicum, @@ -1075,9 +1140,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #endif #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic) -#define _LIBCPP_HAS_C_ATOMIC_IMP +# define _LIBCPP_HAS_C_ATOMIC_IMP #elif _GNUC_VER > 407 -#define _LIBCPP_HAS_GCC_ATOMIC_IMP +# define _LIBCPP_HAS_GCC_ATOMIC_IMP #endif #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \ @@ -1090,139 +1155,144 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #endif #if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) -#if defined(__clang__) && __has_attribute(acquire_capability) +# if defined(__clang__) && __has_attribute(acquire_capability) // Work around the attribute handling in clang. When both __declspec and // __attribute__ are present, the processing goes awry preventing the definition // of the types. -#if !defined(_LIBCPP_OBJECT_FORMAT_COFF) -#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS -#endif -#endif +# if !defined(_LIBCPP_OBJECT_FORMAT_COFF) +# define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS +# endif +# endif #endif #if __has_attribute(require_constant_initialization) -#define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__)) +# define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__)) #else -#define _LIBCPP_SAFE_STATIC +# define _LIBCPP_SAFE_STATIC #endif #if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700 -# define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF +#define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF #endif #if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) -#if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION) -#define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS -#endif +# if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION) +# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS +# endif #endif #if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS) -# define _LIBCPP_DIAGNOSE_WARNING(...) \ - __attribute__((diagnose_if(__VA_ARGS__, "warning"))) -# define _LIBCPP_DIAGNOSE_ERROR(...) \ - __attribute__((diagnose_if(__VA_ARGS__, "error"))) +# define _LIBCPP_DIAGNOSE_WARNING(...) \ + __attribute__((diagnose_if(__VA_ARGS__, "warning"))) +# define _LIBCPP_DIAGNOSE_ERROR(...) \ + __attribute__((diagnose_if(__VA_ARGS__, "error"))) #else -# define _LIBCPP_DIAGNOSE_WARNING(...) -# define _LIBCPP_DIAGNOSE_ERROR(...) +# define _LIBCPP_DIAGNOSE_WARNING(...) +# define _LIBCPP_DIAGNOSE_ERROR(...) #endif #if __has_attribute(fallthough) || _GNUC_VER >= 700 // Use a function like macro to imply that it must be followed by a semicolon -#define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__)) +# define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__)) #else -#define _LIBCPP_FALLTHROUGH() ((void)0) +# define _LIBCPP_FALLTHROUGH() ((void)0) #endif #if defined(_LIBCPP_ABI_MICROSOFT) && \ - (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) -# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases) + (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) +# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases) #else -# define _LIBCPP_DECLSPEC_EMPTY_BASES +# define _LIBCPP_DECLSPEC_EMPTY_BASES #endif #if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) -# define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -# define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS -# define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE -# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR +#define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS +#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES #if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611 -# define _LIBCPP_HAS_NO_DEDUCTION_GUIDES +#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES #endif #if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001) -# define _LIBCPP_HAS_NO_IS_AGGREGATE +#define _LIBCPP_HAS_NO_IS_AGGREGATE #endif #if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L -# define _LIBCPP_HAS_NO_COROUTINES +#define _LIBCPP_HAS_NO_COROUTINES #endif +// FIXME: Correct this macro when either (A) a feature test macro for the +// spaceship operator is provided, or (B) a compiler provides a complete +// implementation. +#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR + // Decide whether to use availability macros. #if !defined(_LIBCPP_BUILDING_LIBRARY) && \ !defined(_LIBCPP_DISABLE_AVAILABILITY) && \ __has_feature(attribute_availability_with_strict) && \ __has_feature(attribute_availability_in_templates) -#ifdef __APPLE__ -#define _LIBCPP_USE_AVAILABILITY_APPLE -#endif +# ifdef __APPLE__ +# define _LIBCPP_USE_AVAILABILITY_APPLE +# endif #endif // Define availability macros. #if defined(_LIBCPP_USE_AVAILABILITY_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))) -#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable)) -#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable)) -#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable)) -#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_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))) +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable)) +# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable)) +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST __attribute__((unavailable)) +# 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))) #else -#define _LIBCPP_AVAILABILITY_SHARED_MUTEX -#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH -#define _LIBCPP_AVAILABILITY_BAD_ANY_CAST -#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS -#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE -#define _LIBCPP_AVAILABILITY_FUTURE_ERROR -#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE -#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY -#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +# define _LIBCPP_AVAILABILITY_SHARED_MUTEX +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS +# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE +# define _LIBCPP_AVAILABILITY_FUTURE_ERROR +# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE +# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY +# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR #endif // Define availability that depends on _LIBCPP_NO_EXCEPTIONS. #ifdef _LIBCPP_NO_EXCEPTIONS -#define _LIBCPP_AVAILABILITY_DYNARRAY -#define _LIBCPP_AVAILABILITY_FUTURE -#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_DYNARRAY +# define _LIBCPP_AVAILABILITY_FUTURE +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST #else -#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH -#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR -#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \ - _LIBCPP_AVAILABILITY_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH +# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST \ + _LIBCPP_AVAILABILITY_BAD_ANY_CAST #endif // Availability of stream API in the dylib got dropped and re-added. The @@ -1242,38 +1312,40 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #endif #if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) -# define _LIBCPP_PUSH_MACROS -# define _LIBCPP_POP_MACROS +# define _LIBCPP_PUSH_MACROS +# define _LIBCPP_POP_MACROS #else // Don't warn about macro conflicts when we can restore them at the // end of the header. -# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS -# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS -# endif -# if defined(_LIBCPP_COMPILER_MSVC) -# define _LIBCPP_PUSH_MACROS \ - __pragma(push_macro("min")) \ - __pragma(push_macro("max")) -# define _LIBCPP_POP_MACROS \ - __pragma(pop_macro("min")) \ - __pragma(pop_macro("max")) -# else -# define _LIBCPP_PUSH_MACROS \ - _Pragma("push_macro(\"min\")") \ - _Pragma("push_macro(\"max\")") -# define _LIBCPP_POP_MACROS \ - _Pragma("pop_macro(\"min\")") \ - _Pragma("pop_macro(\"max\")") -# endif +# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS +# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS +# endif +# if defined(_LIBCPP_COMPILER_MSVC) +# define _LIBCPP_PUSH_MACROS \ + __pragma(push_macro("min")) \ + __pragma(push_macro("max")) +# define _LIBCPP_POP_MACROS \ + __pragma(pop_macro("min")) \ + __pragma(pop_macro("max")) +# else +# define _LIBCPP_PUSH_MACROS \ + _Pragma("push_macro(\"min\")") \ + _Pragma("push_macro(\"max\")") +# define _LIBCPP_POP_MACROS \ + _Pragma("pop_macro(\"min\")") \ + _Pragma("pop_macro(\"max\")") +# endif #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) -#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) -# if defined(_DLL) -# pragma(lib, "c++.lib") -# else -# pragma(lib, "libc++.lib") -# endif -#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) +#ifndef _LIBCPP_NO_AUTO_LINK +# if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) +# if defined(_DLL) +# pragma comment(lib, "c++.lib") +# else +# pragma comment(lib, "libc++.lib") +# endif +# endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) +#endif // _LIBCPP_NO_AUTO_LINK #endif // __cplusplus diff --git a/include/__config_site.in b/include/__config_site.in index 86418a3e17b15..8d980ff57cc8d 100644 --- a/include/__config_site.in +++ b/include/__config_site.in @@ -23,6 +23,7 @@ #cmakedefine _LIBCPP_HAS_MUSL_LIBC #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD #cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL +#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32 #cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL #cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS #cmakedefine _LIBCPP_NO_VCRUNTIME diff --git a/include/__errc b/include/__errc new file mode 100644 index 0000000000000..d0f00b7f0be07 --- /dev/null +++ b/include/__errc @@ -0,0 +1,218 @@ +// -*- C++ -*- +//===---------------------------- __errc ----------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ERRC +#define _LIBCPP___ERRC + +/* + system_error synopsis + +namespace std +{ + +enum class errc +{ + address_family_not_supported, // EAFNOSUPPORT + address_in_use, // EADDRINUSE + address_not_available, // EADDRNOTAVAIL + already_connected, // EISCONN + argument_list_too_long, // E2BIG + argument_out_of_domain, // EDOM + bad_address, // EFAULT + bad_file_descriptor, // EBADF + bad_message, // EBADMSG + broken_pipe, // EPIPE + connection_aborted, // ECONNABORTED + connection_already_in_progress, // EALREADY + connection_refused, // ECONNREFUSED + connection_reset, // ECONNRESET + cross_device_link, // EXDEV + destination_address_required, // EDESTADDRREQ + device_or_resource_busy, // EBUSY + directory_not_empty, // ENOTEMPTY + executable_format_error, // ENOEXEC + file_exists, // EEXIST + file_too_large, // EFBIG + filename_too_long, // ENAMETOOLONG + function_not_supported, // ENOSYS + host_unreachable, // EHOSTUNREACH + identifier_removed, // EIDRM + illegal_byte_sequence, // EILSEQ + inappropriate_io_control_operation, // ENOTTY + interrupted, // EINTR + invalid_argument, // EINVAL + invalid_seek, // ESPIPE + io_error, // EIO + is_a_directory, // EISDIR + message_size, // EMSGSIZE + network_down, // ENETDOWN + network_reset, // ENETRESET + network_unreachable, // ENETUNREACH + no_buffer_space, // ENOBUFS + no_child_process, // ECHILD + no_link, // ENOLINK + no_lock_available, // ENOLCK + no_message_available, // ENODATA + no_message, // ENOMSG + no_protocol_option, // ENOPROTOOPT + no_space_on_device, // ENOSPC + no_stream_resources, // ENOSR + no_such_device_or_address, // ENXIO + no_such_device, // ENODEV + no_such_file_or_directory, // ENOENT + no_such_process, // ESRCH + not_a_directory, // ENOTDIR + not_a_socket, // ENOTSOCK + not_a_stream, // ENOSTR + not_connected, // ENOTCONN + not_enough_memory, // ENOMEM + not_supported, // ENOTSUP + operation_canceled, // ECANCELED + operation_in_progress, // EINPROGRESS + operation_not_permitted, // EPERM + operation_not_supported, // EOPNOTSUPP + operation_would_block, // EWOULDBLOCK + owner_dead, // EOWNERDEAD + permission_denied, // EACCES + protocol_error, // EPROTO + protocol_not_supported, // EPROTONOSUPPORT + read_only_file_system, // EROFS + resource_deadlock_would_occur, // EDEADLK + resource_unavailable_try_again, // EAGAIN + result_out_of_range, // ERANGE + state_not_recoverable, // ENOTRECOVERABLE + stream_timeout, // ETIME + text_file_busy, // ETXTBSY + timed_out, // ETIMEDOUT + too_many_files_open_in_system, // ENFILE + too_many_files_open, // EMFILE + too_many_links, // EMLINK + too_many_symbolic_link_levels, // ELOOP + value_too_large, // EOVERFLOW + wrong_protocol_type // EPROTOTYPE +}; + +*/ + +#include <__config> +#include <cerrno> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Some error codes are not present on all platforms, so we provide equivalents +// for them: + +//enum class errc +_LIBCPP_DECLARE_STRONG_ENUM(errc) +{ + address_family_not_supported = EAFNOSUPPORT, + address_in_use = EADDRINUSE, + address_not_available = EADDRNOTAVAIL, + already_connected = EISCONN, + argument_list_too_long = E2BIG, + argument_out_of_domain = EDOM, + bad_address = EFAULT, + bad_file_descriptor = EBADF, + bad_message = EBADMSG, + broken_pipe = EPIPE, + connection_aborted = ECONNABORTED, + connection_already_in_progress = EALREADY, + connection_refused = ECONNREFUSED, + connection_reset = ECONNRESET, + cross_device_link = EXDEV, + destination_address_required = EDESTADDRREQ, + device_or_resource_busy = EBUSY, + directory_not_empty = ENOTEMPTY, + executable_format_error = ENOEXEC, + file_exists = EEXIST, + file_too_large = EFBIG, + filename_too_long = ENAMETOOLONG, + function_not_supported = ENOSYS, + host_unreachable = EHOSTUNREACH, + identifier_removed = EIDRM, + illegal_byte_sequence = EILSEQ, + inappropriate_io_control_operation = ENOTTY, + interrupted = EINTR, + invalid_argument = EINVAL, + invalid_seek = ESPIPE, + io_error = EIO, + is_a_directory = EISDIR, + message_size = EMSGSIZE, + network_down = ENETDOWN, + network_reset = ENETRESET, + network_unreachable = ENETUNREACH, + no_buffer_space = ENOBUFS, + no_child_process = ECHILD, + no_link = ENOLINK, + no_lock_available = ENOLCK, +#ifdef ENODATA + no_message_available = ENODATA, +#else + no_message_available = ENOMSG, +#endif + no_message = ENOMSG, + no_protocol_option = ENOPROTOOPT, + no_space_on_device = ENOSPC, +#ifdef ENOSR + no_stream_resources = ENOSR, +#else + no_stream_resources = ENOMEM, +#endif + no_such_device_or_address = ENXIO, + no_such_device = ENODEV, + no_such_file_or_directory = ENOENT, + no_such_process = ESRCH, + not_a_directory = ENOTDIR, + not_a_socket = ENOTSOCK, +#ifdef ENOSTR + not_a_stream = ENOSTR, +#else + not_a_stream = EINVAL, +#endif + not_connected = ENOTCONN, + not_enough_memory = ENOMEM, + not_supported = ENOTSUP, + operation_canceled = ECANCELED, + operation_in_progress = EINPROGRESS, + operation_not_permitted = EPERM, + operation_not_supported = EOPNOTSUPP, + operation_would_block = EWOULDBLOCK, + owner_dead = EOWNERDEAD, + permission_denied = EACCES, + protocol_error = EPROTO, + protocol_not_supported = EPROTONOSUPPORT, + read_only_file_system = EROFS, + resource_deadlock_would_occur = EDEADLK, + resource_unavailable_try_again = EAGAIN, + result_out_of_range = ERANGE, + state_not_recoverable = ENOTRECOVERABLE, +#ifdef ETIME + stream_timeout = ETIME, +#else + stream_timeout = ETIMEDOUT, +#endif + text_file_busy = ETXTBSY, + timed_out = ETIMEDOUT, + too_many_files_open_in_system = ENFILE, + too_many_files_open = EMFILE, + too_many_links = EMLINK, + too_many_symbolic_link_levels = ELOOP, + value_too_large = EOVERFLOW, + wrong_protocol_type = EPROTOTYPE +}; +_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ERRC diff --git a/include/__functional_03 b/include/__functional_03 index 13d8a3d960091..0a3bfbaa3d2cf 100644 --- a/include/__functional_03 +++ b/include/__functional_03 @@ -600,7 +600,10 @@ template<class _Rp> function<_Rp()>& function<_Rp()>::operator=(const function& __f) { - function(__f).swap(*this); + if (__f) + function(__f).swap(*this); + else + *this = nullptr; return *this; } @@ -608,11 +611,12 @@ template<class _Rp> function<_Rp()>& function<_Rp()>::operator=(nullptr_t) { - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); + __base* __t = __f_; __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); return *this; } @@ -876,7 +880,10 @@ template<class _Rp, class _A0> function<_Rp(_A0)>& function<_Rp(_A0)>::operator=(const function& __f) { - function(__f).swap(*this); + if (__f) + function(__f).swap(*this); + else + *this = nullptr; return *this; } @@ -884,11 +891,12 @@ template<class _Rp, class _A0> function<_Rp(_A0)>& function<_Rp(_A0)>::operator=(nullptr_t) { - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); + __base* __t = __f_; __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); return *this; } @@ -1152,7 +1160,10 @@ template<class _Rp, class _A0, class _A1> function<_Rp(_A0, _A1)>& function<_Rp(_A0, _A1)>::operator=(const function& __f) { - function(__f).swap(*this); + if (__f) + function(__f).swap(*this); + else + *this = nullptr; return *this; } @@ -1160,11 +1171,12 @@ template<class _Rp, class _A0, class _A1> function<_Rp(_A0, _A1)>& function<_Rp(_A0, _A1)>::operator=(nullptr_t) { - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); + __base* __t = __f_; __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); return *this; } @@ -1428,7 +1440,10 @@ template<class _Rp, class _A0, class _A1, class _A2> function<_Rp(_A0, _A1, _A2)>& function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f) { - function(__f).swap(*this); + if (__f) + function(__f).swap(*this); + else + *this = nullptr; return *this; } @@ -1436,11 +1451,12 @@ template<class _Rp, class _A0, class _A1, class _A2> function<_Rp(_A0, _A1, _A2)>& function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t) { - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); + __base* __t = __f_; __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); return *this; } diff --git a/include/__functional_base b/include/__functional_base index 79017fe759b49..1a90bd6280f64 100644 --- a/include/__functional_base +++ b/include/__functional_base @@ -564,7 +564,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { }; #if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY) extern const allocator_arg_t allocator_arg; #else -constexpr allocator_arg_t allocator_arg = allocator_arg_t(); +/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t(); #endif // uses_allocator @@ -601,7 +601,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator #if _LIBCPP_STD_VER > 14 template <class _Tp, class _Alloc> -constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; +_LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; #endif #ifndef _LIBCPP_CXX03_LANG @@ -646,16 +646,6 @@ void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, con new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); } -// FIXME: Theis 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 (_Tp *__storage, const _Allocator &__a, _Args &&... __args) -{ - __user_alloc_construct_impl( - __uses_alloc_ctor<_Tp, _Allocator>(), - __storage, __a, _VSTD::forward<_Args>(__args)... - ); -} #endif // _LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD diff --git a/include/__hash_table b/include/__hash_table index 3f430af1283e6..44ba268a0ec81 100644 --- a/include/__hash_table +++ b/include/__hash_table @@ -32,13 +32,8 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_CXX03_LANG -template <class _Key, class _Tp> -union __hash_value_type; -#else template <class _Key, class _Tp> struct __hash_value_type; -#endif template <class _Key, class _Cp, class _Hash, bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value> @@ -172,7 +167,7 @@ struct __hash_key_value_types { } #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY - static __container_value_type&& __move(__node_value_type& __v) { + static __container_value_type&& __move(__node_value_type& __v) { return _VSTD::move(__v); } #endif @@ -184,7 +179,6 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > { typedef _Tp mapped_type; typedef __hash_value_type<_Key, _Tp> __node_value_type; typedef pair<const _Key, _Tp> __container_value_type; - typedef pair<_Key, _Tp> __nc_value_type; typedef __container_value_type __map_value_type; static const bool __is_map = true; @@ -198,7 +192,7 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > { static typename enable_if<__is_same_uncvref<_Up, __node_value_type>::value, __container_value_type const&>::type __get_value(_Up& __t) { - return __t.__cc; + return __t.__get_value(); } template <class _Up> @@ -211,12 +205,12 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > { _LIBCPP_INLINE_VISIBILITY static __container_value_type* __get_ptr(__node_value_type& __n) { - return _VSTD::addressof(__n.__cc); + return _VSTD::addressof(__n.__get_value()); } #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY - static __nc_value_type&& __move(__node_value_type& __v) { - return _VSTD::move(__v.__nc); + static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) { + return __v.__move(); } #endif diff --git a/include/__libcpp_version b/include/__libcpp_version index a77fd92cf17bb..2bdc6533bec75 100644 --- a/include/__libcpp_version +++ b/include/__libcpp_version @@ -1 +1 @@ -6000 +7000 diff --git a/include/__locale b/include/__locale index 601f0d1ec3251..f43e7b4303d34 100644 --- a/include/__locale +++ b/include/__locale @@ -24,11 +24,7 @@ #elif defined(_AIX) # include <support/ibm/xlocale.h> #elif defined(__ANDROID__) -// Android gained the locale aware functions in L (API level 21) -# include <android/api-level.h> -# if __ANDROID_API__ <= 20 -# include <support/android/locale_bionic.h> -# endif +# include <support/android/locale_bionic.h> #elif defined(__sun__) # include <xlocale.h> # include <support/solaris/xlocale.h> @@ -473,7 +469,7 @@ public: static const mask alnum = alpha | digit; static const mask graph = alnum | punct; - _LIBCPP_ALWAYS_INLINE ctype_base() {} + _LIBCPP_INLINE_VISIBILITY ctype_base() {} }; template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype; @@ -486,77 +482,77 @@ class _LIBCPP_TYPE_VIS ctype<wchar_t> public: typedef wchar_t char_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit ctype(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool is(mask __m, char_type __c) const { return do_is(__m, __c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const { return do_is(__low, __high, __vec); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* scan_is(mask __m, const char_type* __low, const char_type* __high) const { return do_scan_is(__m, __low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const { return do_scan_not(__m, __low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type toupper(char_type __c) const { return do_toupper(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* toupper(char_type* __low, const char_type* __high) const { return do_toupper(__low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type tolower(char_type __c) const { return do_tolower(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* tolower(char_type* __low, const char_type* __high) const { return do_tolower(__low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type widen(char __c) const { return do_widen(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char* widen(const char* __low, const char* __high, char_type* __to) const { return do_widen(__low, __high, __to); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); @@ -591,13 +587,13 @@ public: explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool is(mask __m, char_type __c) const { return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const { for (; __low != __high; ++__low, ++__vec) @@ -605,7 +601,7 @@ public: return __low; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* scan_is (mask __m, const char_type* __low, const char_type* __high) const { for (; __low != __high; ++__low) @@ -614,7 +610,7 @@ public: return __low; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const { for (; __low != __high; ++__low) @@ -623,49 +619,49 @@ public: return __low; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type toupper(char_type __c) const { return do_toupper(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* toupper(char_type* __low, const char_type* __high) const { return do_toupper(__low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type tolower(char_type __c) const { return do_tolower(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char_type* tolower(char_type* __low, const char_type* __high) const { return do_tolower(__low, __high); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char_type widen(char __c) const { return do_widen(__c); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char* widen(const char* __low, const char* __high, char_type* __to) const { return do_widen(__low, __high, __to); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY char narrow(char_type __c, char __dfault) const { return do_narrow(__c, __dfault); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const char* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); @@ -678,7 +674,7 @@ public: #else static const size_t table_size = 256; // FIXME: Don't hardcode this. #endif - _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;} + _LIBCPP_INLINE_VISIBILITY const mask* table() const _NOEXCEPT {return __tab_;} static const mask* classic_table() _NOEXCEPT; #if defined(__GLIBC__) || defined(__EMSCRIPTEN__) static const int* __classic_upper_table() _NOEXCEPT; @@ -858,7 +854,7 @@ tolower(_CharT __c, const locale& __loc) class _LIBCPP_TYPE_VIS codecvt_base { public: - _LIBCPP_ALWAYS_INLINE codecvt_base() {} + _LIBCPP_INLINE_VISIBILITY codecvt_base() {} enum result {ok, partial, error, noconv}; }; @@ -878,11 +874,11 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result out(state_type& __st, 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 @@ -890,14 +886,14 @@ public: return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const { return do_unshift(__st, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result in(state_type& __st, 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 @@ -905,25 +901,25 @@ public: return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int encoding() const _NOEXCEPT { return do_encoding(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const { return do_length(__st, __frm, __end, __mx); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int max_length() const _NOEXCEPT { return do_max_length(); @@ -932,7 +928,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(const char*, size_t __refs = 0) : locale::facet(__refs) {} @@ -967,7 +963,7 @@ public: explicit codecvt(size_t __refs = 0); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result out(state_type& __st, 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 @@ -975,14 +971,14 @@ public: return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const { return do_unshift(__st, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result in(state_type& __st, 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 @@ -990,25 +986,25 @@ public: return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int encoding() const _NOEXCEPT { return do_encoding(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const { return do_length(__st, __frm, __end, __mx); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int max_length() const _NOEXCEPT { return do_max_length(); @@ -1047,11 +1043,11 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result out(state_type& __st, 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 @@ -1059,14 +1055,14 @@ public: return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const { return do_unshift(__st, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result in(state_type& __st, 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 @@ -1074,25 +1070,25 @@ public: return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int encoding() const _NOEXCEPT { return do_encoding(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const { return do_length(__st, __frm, __end, __mx); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int max_length() const _NOEXCEPT { return do_max_length(); @@ -1101,7 +1097,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(const char*, size_t __refs = 0) : locale::facet(__refs) {} @@ -1133,11 +1129,11 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result out(state_type& __st, 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 @@ -1145,14 +1141,14 @@ public: return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result unshift(state_type& __st, extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const { return do_unshift(__st, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result in(state_type& __st, 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 @@ -1160,25 +1156,25 @@ public: return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int encoding() const _NOEXCEPT { return do_encoding(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool always_noconv() const _NOEXCEPT { return do_always_noconv(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const { return do_length(__st, __frm, __end, __mx); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int max_length() const _NOEXCEPT { return do_max_length(); @@ -1187,7 +1183,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt(const char*, size_t __refs = 0) : locale::facet(__refs) {} @@ -1214,10 +1210,10 @@ class _LIBCPP_TEMPLATE_VIS codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt_byname(const char* __nm, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt_byname(const string& __nm, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {} protected: @@ -1248,7 +1244,7 @@ template <> struct __narrow_to_utf8<8> { template <class _OutputIterator, class _CharT> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { @@ -1262,13 +1258,13 @@ template <> struct __narrow_to_utf8<16> : public codecvt<char16_t, char, mbstate_t> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {} ~__narrow_to_utf8(); template <class _OutputIterator, class _CharT> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { @@ -1296,13 +1292,13 @@ template <> struct __narrow_to_utf8<32> : public codecvt<char32_t, char, mbstate_t> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {} ~__narrow_to_utf8(); template <class _OutputIterator, class _CharT> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const { @@ -1338,7 +1334,7 @@ template <> struct __widen_from_utf8<8> { template <class _OutputIterator> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { @@ -1352,13 +1348,13 @@ template <> struct __widen_from_utf8<16> : public codecvt<char16_t, char, mbstate_t> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {} ~__widen_from_utf8(); template <class _OutputIterator> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { @@ -1386,13 +1382,13 @@ template <> struct __widen_from_utf8<32> : public codecvt<char32_t, char, mbstate_t> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {} ~__widen_from_utf8(); template <class _OutputIterator> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _OutputIterator operator()(_OutputIterator __s, const char* __nb, const char* __ne) const { @@ -1430,11 +1426,11 @@ public: explicit numpunct(size_t __refs = 0); - _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();} - _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();} - _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();} - _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();} - _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();} + _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();} + _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();} + _LIBCPP_INLINE_VISIBILITY string grouping() const {return do_grouping();} + _LIBCPP_INLINE_VISIBILITY string_type truename() const {return do_truename();} + _LIBCPP_INLINE_VISIBILITY string_type falsename() const {return do_falsename();} static locale::id id; @@ -1461,11 +1457,11 @@ public: explicit numpunct(size_t __refs = 0); - _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();} - _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();} - _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();} - _LIBCPP_ALWAYS_INLINE string_type truename() const {return do_truename();} - _LIBCPP_ALWAYS_INLINE string_type falsename() const {return do_falsename();} + _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();} + _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();} + _LIBCPP_INLINE_VISIBILITY string grouping() const {return do_grouping();} + _LIBCPP_INLINE_VISIBILITY string_type truename() const {return do_truename();} + _LIBCPP_INLINE_VISIBILITY string_type falsename() const {return do_falsename();} static locale::id id; diff --git a/include/__mutex_base b/include/__mutex_base index 3b2453f1ba1a8..402a52d945e12 100644 --- a/include/__mutex_base +++ b/include/__mutex_base @@ -82,9 +82,9 @@ extern const adopt_lock_t adopt_lock; #else -constexpr defer_lock_t defer_lock = defer_lock_t(); -constexpr try_to_lock_t try_to_lock = try_to_lock_t(); -constexpr adopt_lock_t adopt_lock = adopt_lock_t(); +/* _LIBCPP_INLINE_VAR */ constexpr defer_lock_t defer_lock = defer_lock_t(); +/* _LIBCPP_INLINE_VAR */ constexpr try_to_lock_t try_to_lock = try_to_lock_t(); +/* _LIBCPP_INLINE_VAR */ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); #endif diff --git a/include/__nullptr b/include/__nullptr index a341234f5d198..aa3b4d2145a57 100644 --- a/include/__nullptr +++ b/include/__nullptr @@ -27,24 +27,24 @@ struct _LIBCPP_TEMPLATE_VIS nullptr_t struct __nat {int __for_bool_;}; - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} template <class _Tp> - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator _Tp* () const {return 0;} template <class _Tp, class _Up> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY operator _Tp _Up::* () const {return 0;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;} + friend _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;} + friend _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;} }; -inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);} +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);} #define nullptr _VSTD::__get_nullptr_t() diff --git a/include/__sso_allocator b/include/__sso_allocator index 8147e75ec2c85..40027363a1850 100644 --- a/include/__sso_allocator +++ b/include/__sso_allocator @@ -55,14 +55,14 @@ public: __allocated_ = true; return (pointer)&buf_; } - return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp))); + return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), __alignof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) { if (__p == (pointer)&buf_) __allocated_ = false; else - _VSTD::__libcpp_deallocate(__p); + _VSTD::__libcpp_deallocate(__p, __alignof(_Tp)); } _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);} diff --git a/include/__string b/include/__string index d30c7fddc8d65..44c55987f9f73 100644 --- a/include/__string +++ b/include/__string @@ -266,7 +266,7 @@ const char* char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { if (__n == 0) - return NULL; + return nullptr; #if __has_feature(cxx_constexpr_string_builtins) return __builtin_char_memchr(__s, to_int_type(__a), __n); #elif _LIBCPP_STD_VER <= 14 @@ -278,7 +278,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) return __s; ++__s; } - return NULL; + return nullptr; #endif } @@ -372,9 +372,9 @@ const wchar_t* char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { if (__n == 0) - return NULL; + return nullptr; #if __has_feature(cxx_constexpr_string_builtins) - return __builtin_wmemchr(__s, __a, __n); + return __builtin_wmemchr(__s, __a, __n); #elif _LIBCPP_STD_VER <= 14 return wmemchr(__s, __a, __n); #else @@ -384,7 +384,7 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __ return __s; ++__s; } - return NULL; + return nullptr; #endif } diff --git a/include/__threading_support b/include/__threading_support index 5d4c907966ee5..3c1eff22f530b 100644 --- a/include/__threading_support +++ b/include/__threading_support @@ -26,18 +26,14 @@ #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) # include <pthread.h> # include <sched.h> -#elif defined(_LIBCPP_HAS_THREAD_API_WIN32) -#include <windows.h> -#include <process.h> -#include <fibersapi.h> #endif _LIBCPP_PUSH_MACROS #include <__undef_macros> - #if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ - defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) + defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \ + defined(_LIBCPP_HAS_THREAD_API_WIN32) #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS #else #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY @@ -80,31 +76,37 @@ typedef pthread_key_t __libcpp_tls_key; #define _LIBCPP_TLS_DESTRUCTOR_CC #else // Mutex -typedef SRWLOCK __libcpp_mutex_t; -#define _LIBCPP_MUTEX_INITIALIZER SRWLOCK_INIT +typedef void* __libcpp_mutex_t; +#define _LIBCPP_MUTEX_INITIALIZER 0 -typedef CRITICAL_SECTION __libcpp_recursive_mutex_t; +#if defined(_M_IX86) || defined(__i386__) || defined(_M_ARM) || defined(__arm__) +typedef void* __libcpp_recursive_mutex_t[6]; +#elif defined(_M_AMD64) || defined(__x86_64__) || defined(_M_ARM64) || defined(__aarch64__) +typedef void* __libcpp_recursive_mutex_t[5]; +#else +# error Unsupported architecture +#endif // Condition Variable -typedef CONDITION_VARIABLE __libcpp_condvar_t; -#define _LIBCPP_CONDVAR_INITIALIZER CONDITION_VARIABLE_INIT +typedef void* __libcpp_condvar_t; +#define _LIBCPP_CONDVAR_INITIALIZER 0 // Execute Once -typedef INIT_ONCE __libcpp_exec_once_flag; -#define _LIBCPP_EXEC_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT +typedef void* __libcpp_exec_once_flag; +#define _LIBCPP_EXEC_ONCE_INITIALIZER 0 // Thread ID -typedef DWORD __libcpp_thread_id; +typedef long __libcpp_thread_id; // Thread #define _LIBCPP_NULL_THREAD 0U -typedef HANDLE __libcpp_thread_t; +typedef void* __libcpp_thread_t; // Thread Local Storage -typedef DWORD __libcpp_tls_key; +typedef long __libcpp_tls_key; -#define _LIBCPP_TLS_DESTRUCTOR_CC WINAPI +#define _LIBCPP_TLS_DESTRUCTOR_CC __stdcall #endif // Mutex @@ -201,10 +203,9 @@ void *__libcpp_tls_get(__libcpp_tls_key __key); _LIBCPP_THREAD_ABI_VISIBILITY int __libcpp_tls_set(__libcpp_tls_key __key, void *__p); -#if !defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ - defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) - -#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ + defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)) && \ + defined(_LIBCPP_HAS_THREAD_API_PTHREAD) int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) { @@ -390,244 +391,6 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p) return pthread_setspecific(__key, __p); } -#elif defined(_LIBCPP_HAS_THREAD_API_WIN32) - -// Mutex -int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) -{ - InitializeCriticalSection(__m); - return 0; -} - -int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m) -{ - EnterCriticalSection(__m); - return 0; -} - -bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m) -{ - return TryEnterCriticalSection(__m) != 0; -} - -int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m) -{ - LeaveCriticalSection(__m); - return 0; -} - -int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m) -{ - DeleteCriticalSection(__m); - return 0; -} - -int __libcpp_mutex_lock(__libcpp_mutex_t *__m) -{ - AcquireSRWLockExclusive(__m); - return 0; -} - -bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m) -{ - return TryAcquireSRWLockExclusive(__m) != 0; -} - -int __libcpp_mutex_unlock(__libcpp_mutex_t *__m) -{ - ReleaseSRWLockExclusive(__m); - return 0; -} - -int __libcpp_mutex_destroy(__libcpp_mutex_t *__m) -{ - static_cast<void>(__m); - return 0; -} - -// Condition Variable -int __libcpp_condvar_signal(__libcpp_condvar_t *__cv) -{ - WakeConditionVariable(__cv); - return 0; -} - -int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv) -{ - WakeAllConditionVariable(__cv); - return 0; -} - -int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) -{ - SleepConditionVariableSRW(__cv, __m, INFINITE, 0); - return 0; -} - -int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, - timespec *__ts) -{ - using namespace _VSTD::chrono; - - auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec); - auto abstime = - system_clock::time_point(duration_cast<system_clock::duration>(duration)); - auto timeout_ms = duration_cast<milliseconds>(abstime - system_clock::now()); - - if (!SleepConditionVariableSRW(__cv, __m, - timeout_ms.count() > 0 ? timeout_ms.count() - : 0, - 0)) - { - auto __ec = GetLastError(); - return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec; - } - return 0; -} - -int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv) -{ - static_cast<void>(__cv); - return 0; -} - -// Execute Once -static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK -__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter, - PVOID *__context) -{ - static_cast<void>(__init_once); - static_cast<void>(__context); - - void (*init_routine)(void) = reinterpret_cast<void (*)(void)>(__parameter); - init_routine(); - return TRUE; -} - -int __libcpp_execute_once(__libcpp_exec_once_flag *__flag, - void (*__init_routine)(void)) -{ - if (!InitOnceExecuteOnce(__flag, __libcpp_init_once_execute_once_thunk, - reinterpret_cast<void *>(__init_routine), NULL)) - return GetLastError(); - return 0; -} - -// Thread ID -bool __libcpp_thread_id_equal(__libcpp_thread_id __lhs, - __libcpp_thread_id __rhs) -{ - return __lhs == __rhs; -} - -bool __libcpp_thread_id_less(__libcpp_thread_id __lhs, __libcpp_thread_id __rhs) -{ - return __lhs < __rhs; -} - -// Thread -struct __libcpp_beginthreadex_thunk_data -{ - void *(*__func)(void *); - void *__arg; -}; - -static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI -__libcpp_beginthreadex_thunk(void *__raw_data) -{ - auto *__data = - static_cast<__libcpp_beginthreadex_thunk_data *>(__raw_data); - auto *__func = __data->__func; - void *__arg = __data->__arg; - delete __data; - return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg))); -} - -bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { - return *__t == 0; -} - -int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), - void *__arg) -{ - auto *__data = new __libcpp_beginthreadex_thunk_data; - __data->__func = __func; - __data->__arg = __arg; - - *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, - __libcpp_beginthreadex_thunk, - __data, 0, nullptr)); - - if (*__t) - return 0; - return GetLastError(); -} - -__libcpp_thread_id __libcpp_thread_get_current_id() -{ - return GetCurrentThreadId(); -} - -__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t) -{ - return GetThreadId(*__t); -} - -int __libcpp_thread_join(__libcpp_thread_t *__t) -{ - if (WaitForSingleObjectEx(*__t, INFINITE, FALSE) == WAIT_FAILED) - return GetLastError(); - if (!CloseHandle(*__t)) - return GetLastError(); - return 0; -} - -int __libcpp_thread_detach(__libcpp_thread_t *__t) -{ - if (!CloseHandle(*__t)) - return GetLastError(); - return 0; -} - -void __libcpp_thread_yield() -{ - SwitchToThread(); -} - -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)); - // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx) - Sleep(__ms.count()); -} - -// Thread Local Storage -int __libcpp_tls_create(__libcpp_tls_key* __key, - void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*)) -{ - *__key = FlsAlloc(__at_exit); - if (*__key == FLS_OUT_OF_INDEXES) - return GetLastError(); - return 0; -} - -void *__libcpp_tls_get(__libcpp_tls_key __key) -{ - return FlsGetValue(__key); -} - -int __libcpp_tls_set(__libcpp_tls_key __key, void *__p) -{ - if (!FlsSetValue(__key, __p)) - return GetLastError(); - return 0; -} - -#endif // _LIBCPP_HAS_THREAD_API_PTHREAD - #endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL _LIBCPP_END_NAMESPACE_STD diff --git a/include/__tree b/include/__tree index 3ccfcb7003107..30c32f1639351 100644 --- a/include/__tree +++ b/include/__tree @@ -37,13 +37,8 @@ template <class _Pointer> class __tree_end_node; template <class _VoidPtr> class __tree_node_base; template <class _Tp, class _VoidPtr> class __tree_node; -#ifndef _LIBCPP_CXX03_LANG -template <class _Key, class _Value> -union __value_type; -#else template <class _Key, class _Value> struct __value_type; -#endif template <class _Key, class _CP, class _Compare, bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value> @@ -569,10 +564,9 @@ 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) { + static __container_value_type&& __move(__node_value_type& __v) { return _VSTD::move(__v); } #endif @@ -584,14 +578,13 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > { typedef _Tp mapped_type; typedef __value_type<_Key, _Tp> __node_value_type; typedef pair<const _Key, _Tp> __container_value_type; - typedef pair<_Key, _Tp> __nc_value_type; typedef __container_value_type __map_value_type; static const bool __is_map = true; _LIBCPP_INLINE_VISIBILITY static key_type const& __get_key(__node_value_type const& __t) { - return __t.__cc.first; + return __t.__get_value().first; } template <class _Up> @@ -605,7 +598,7 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > { _LIBCPP_INLINE_VISIBILITY static __container_value_type const& __get_value(__node_value_type const& __t) { - return __t.__cc; + return __t.__get_value(); } template <class _Up> @@ -618,13 +611,13 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > { _LIBCPP_INLINE_VISIBILITY static __container_value_type* __get_ptr(__node_value_type& __n) { - return _VSTD::addressof(__n.__cc); + return _VSTD::addressof(__n.__get_value()); } #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY - static __nc_value_type&& __move(__node_value_type& __v) { - return _VSTD::move(__v.__nc); + static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) { + return __v.__move(); } #endif }; diff --git a/include/algorithm b/include/algorithm index 35c6129ea5081..90f1d246c63df 100644 --- a/include/algorithm +++ b/include/algorithm @@ -20,149 +20,150 @@ namespace std { template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 all_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 any_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 none_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Function> - Function + constexpr Function // constexpr in C++20 for_each(InputIterator first, InputIterator last, Function f); template<class InputIterator, class Size, class Function> - InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17 + constexpr InputIterator // constexpr in C++20 + for_each_n(InputIterator first, Size n, Function f); // C++17 template <class InputIterator, class T> - InputIterator + constexpr InputIterator // constexpr in C++20 find(InputIterator first, InputIterator last, const T& value); template <class InputIterator, class Predicate> - InputIterator + constexpr InputIterator // constexpr in C++20 find_if(InputIterator first, InputIterator last, Predicate pred); template<class InputIterator, class Predicate> - InputIterator + InputIterator // constexpr in C++20 find_if_not(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 adjacent_find(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class BinaryPredicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); template <class InputIterator, class T> - typename iterator_traits<InputIterator>::difference_type + constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 count(InputIterator first, InputIterator last, const T& value); template <class InputIterator, class Predicate> - typename iterator_traits<InputIterator>::difference_type + constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 count_if(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator1, class InputIterator2> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); template <class InputIterator1, class InputIterator2> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); // **C++14** template <class InputIterator1, class InputIterator2, class BinaryPredicate> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred); template <class InputIterator1, class InputIterator2, class BinaryPredicate> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred); // **C++14** template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); // **C++14** template <class InputIterator1, class InputIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred); template <class InputIterator1, class InputIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred); // **C++14** template<class ForwardIterator1, class ForwardIterator2> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); template<class ForwardIterator1, class ForwardIterator2> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, BinaryPredicate pred); template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); // **C++14** template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator, class Size, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); template <class ForwardIterator, class Size, class T, class BinaryPredicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value, BinaryPredicate pred); @@ -193,61 +194,61 @@ template <class ForwardIterator1, class ForwardIterator2> iter_swap(ForwardIterator1 a, ForwardIterator2 b); template <class InputIterator, class OutputIterator, class UnaryOperation> - OutputIterator + constexpr OutputIterator // constexpr in C++20 transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> - OutputIterator + constexpr OutputIterator // constexpr in C++20 transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryOperation binary_op); template <class ForwardIterator, class T> - void + constexpr void // constexpr in C++20 replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); template <class ForwardIterator, class Predicate, class T> - void + constexpr void // constexpr in C++20 replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); template <class InputIterator, class OutputIterator, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 replace_copy(InputIterator first, InputIterator last, OutputIterator result, const T& old_value, const T& new_value); template <class InputIterator, class OutputIterator, class Predicate, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); template <class ForwardIterator, class T> - void + constexpr void // constexpr in C++20 fill(ForwardIterator first, ForwardIterator last, const T& value); template <class OutputIterator, class Size, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 fill_n(OutputIterator first, Size n, const T& value); template <class ForwardIterator, class Generator> - void + constexpr void // constexpr in C++20 generate(ForwardIterator first, ForwardIterator last, Generator gen); template <class OutputIterator, class Size, class Generator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 generate_n(OutputIterator first, Size n, Generator gen); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 remove(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class Predicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); template <class InputIterator, class OutputIterator, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); template <class InputIterator, class OutputIterator, class Predicate> - OutputIterator + constexpr OutputIterator // constexpr in C++20 remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); template <class ForwardIterator> @@ -271,7 +272,7 @@ template <class BidirectionalIterator> reverse(BidirectionalIterator first, BidirectionalIterator last); template <class BidirectionalIterator, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); template <class ForwardIterator> @@ -302,7 +303,7 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator> UniformRandomNumberGenerator&& g); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 is_partitioned(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator, class Predicate> @@ -311,7 +312,7 @@ template <class ForwardIterator, class Predicate> template <class InputIterator, class OutputIterator1, class OutputIterator2, class Predicate> - pair<OutputIterator1, OutputIterator2> + constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 partition_copy(InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); @@ -321,11 +322,11 @@ template <class ForwardIterator, class Predicate> stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); template<class ForwardIterator, class Predicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); template <class ForwardIterator> - bool + constexpr bool // constexpr in C++20 is_sorted(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> @@ -333,11 +334,11 @@ template <class ForwardIterator, class Compare> is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); template<class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); template <class RandomAccessIterator> @@ -383,35 +384,35 @@ template <class RandomAccessIterator, class Compare> nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 lower_bound(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 upper_bound(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - pair<ForwardIterator, ForwardIterator> + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 equal_range(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - pair<ForwardIterator, ForwardIterator> + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - bool + constexpr bool // constexpr in C++20 binary_search(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - bool + constexpr bool // constexpr in C++20 binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> @@ -433,11 +434,11 @@ template <class BidirectionalIterator, class Compare> inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); template <class InputIterator1, class InputIterator2, class Compare> - bool + constexpr bool // constexpr in C++20 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> @@ -451,12 +452,12 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_intersection(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_intersection(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); @@ -513,19 +514,19 @@ template <class RandomAccessIterator, class Compare> sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - bool + constexpr bool // constexpr in C++20 is_heap(RandomAccessIterator first, RandomAccessiterator last); template <class RandomAccessIterator, class Compare> - bool + constexpr bool // constexpr in C++20 is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template <class RandomAccessIterator> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 is_heap_until(RandomAccessIterator first, RandomAccessiterator last); template <class RandomAccessIterator, class Compare> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template <class ForwardIterator> @@ -607,11 +608,11 @@ template<class T, class Compare> minmax(initializer_list<T> t, Compare comp); // constexpr in C++14 template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); template <class InputIterator1, class InputIterator2, class Compare> - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); @@ -641,6 +642,7 @@ template <class BidirectionalIterator, class Compare> #include <cstring> #include <utility> // needed to provide swap_ranges. #include <memory> +#include <functional> #include <iterator> #include <cstddef> @@ -669,10 +671,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _T1, class _T2 = _T1> struct __equal_to { - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} + _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> @@ -918,7 +920,7 @@ inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) { // all_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -931,7 +933,7 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // any_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -944,7 +946,7 @@ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // none_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -957,7 +959,7 @@ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // for_each template <class _InputIterator, class _Function> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first, _InputIterator __last, _Function __f) { @@ -970,7 +972,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f) // for_each_n template <class _InputIterator, class _Size, class _Function> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) { @@ -989,7 +991,7 @@ for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) // find template <class _InputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { @@ -1002,7 +1004,7 @@ find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) // find_if template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1015,7 +1017,7 @@ find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) // find_if_not template<class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1028,7 +1030,7 @@ find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) // find_end template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -_ForwardIterator1 +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) @@ -1070,7 +1072,7 @@ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2> -_BidirectionalIterator1 +_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1 __find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred, bidirectional_iterator_tag, bidirectional_iterator_tag) @@ -1150,7 +1152,7 @@ __find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1162,7 +1164,7 @@ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1188,7 +1190,7 @@ __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1197,7 +1199,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1210,7 +1212,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, // adjacent_find template <class _ForwardIterator, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { @@ -1228,7 +1230,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicat } template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last) { @@ -1239,7 +1241,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last) // count template <class _InputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { @@ -1253,7 +1255,7 @@ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) // count_if template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1267,7 +1269,7 @@ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) // mismatch template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) @@ -1279,7 +1281,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { @@ -1290,7 +1292,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi #if _LIBCPP_STD_VER > 11 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, @@ -1303,7 +1305,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) @@ -1317,7 +1319,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, // equal template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { @@ -1328,7 +1330,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { @@ -1339,7 +1341,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first #if _LIBCPP_STD_VER > 11 template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred, @@ -1352,7 +1354,7 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, @@ -1366,7 +1368,7 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred ) @@ -1378,7 +1380,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) @@ -1394,17 +1396,18 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, // is_permutation template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -bool +_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 parts +// shorten sequences as much as possible by lopping of any equal prefix for (; __first1 != __last1; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) - goto __not_done; - return true; -__not_done: - // __first1 != __last1 && *__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)) @@ -1414,11 +1417,12 @@ __not_done: // equal elements in [f2, l2) for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { - // Have we already counted the number of *__i in [f1, l1)? - for (_ForwardIterator1 __j = __first1; __j != __i; ++__j) - if (__pred(*__j, *__i)) - goto __next_iter; - { + // 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) @@ -1434,13 +1438,12 @@ __not_done: if (__c1 != __c2) return false; } -__next_iter:; } return true; } template<class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) @@ -1452,19 +1455,21 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, #if _LIBCPP_STD_VER > 11 template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -bool +_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 parts +// shorten sequences as much as possible by lopping of any equal prefix for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) - goto __not_done; - return __first1 == __last1 && __first2 == __last2; -__not_done: - // __first1 != __last1 && __first2 != __last2 && *__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); @@ -1477,11 +1482,12 @@ __not_done: // equal elements in [f2, l2) for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { - // Have we already counted the number of *__i in [f1, l1)? - for (_ForwardIterator1 __j = __first1; __j != __i; ++__j) - if (__pred(*__j, *__i)) - goto __next_iter; - { + // 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) @@ -1497,13 +1503,12 @@ __not_done: if (__c1 != __c2) return false; } -__next_iter:; } return true; } template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, @@ -1517,7 +1522,7 @@ __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1 } template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, @@ -1530,7 +1535,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template<class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1545,91 +1550,10 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, #endif // search - -template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -pair<_ForwardIterator1, _ForwardIterator1> -__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, - forward_iterator_tag, forward_iterator_tag) -{ - if (__first2 == __last2) - return 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 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 make_pair(__first1, __m1); - if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found - return 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 make_pair(__first1, __first1); - const _D1 __len1 = __last1 - __first1; - if (__len1 < __len2) - return 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 make_pair(__last1, __last1); - if (__pred(*__first1, *__first2)) - break; - ++__first1; - } - - _RandomAccessIterator1 __m1 = __first1; - _RandomAccessIterator2 __m2 = __first2; - while (true) - { - if (++__m2 == __last2) - return 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; - } - } - } -} +// __search is in <functional> template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1642,7 +1566,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1652,10 +1576,18 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); } + +#if _LIBCPP_STD_VER > 14 +template <class _ForwardIterator, class _Searcher> +_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> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag) { @@ -1692,7 +1624,7 @@ __search_n(_ForwardIterator __first, _ForwardIterator __last, } template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp> -_RandomAccessIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag) { @@ -1732,7 +1664,7 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, } template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred) @@ -1743,7 +1675,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last, } template <class _ForwardIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) { @@ -1776,7 +1708,7 @@ __unwrap_iter(move_iterator<_Tp*> __i) #if _LIBCPP_DEBUG_LEVEL < 2 template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1790,7 +1722,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i) #else template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -2023,7 +1955,7 @@ move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, // transform template <class _InputIterator, class _OutputIterator, class _UnaryOperation> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op) { @@ -2033,7 +1965,7 @@ transform(_InputIterator __first, _InputIterator __last, _OutputIterator __resul } template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _BinaryOperation __binary_op) @@ -2046,7 +1978,7 @@ transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __f // replace template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) { @@ -2058,7 +1990,7 @@ replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_valu // replace_if template <class _ForwardIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) { @@ -2070,7 +2002,7 @@ replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, // replace_copy template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +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) @@ -2086,7 +2018,7 @@ replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __re // replace_copy_if template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred, const _Tp& __new_value) @@ -2102,7 +2034,7 @@ replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator _ // fill_n template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) { @@ -2111,24 +2043,8 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) return __first; } -template <class _Tp, class _Size, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_integral<_Tp>::value && sizeof(_Tp) == 1 && - !is_same<_Tp, bool>::value && - is_integral<_Up>::value && sizeof(_Up) == 1, - _Tp* ->::type -__fill_n(_Tp* __first, _Size __n,_Up __value_) -{ - if (__n > 0) - _VSTD::memset(__first, (unsigned char)__value_, (size_t)(__n)); - return __first + __n; -} - template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) { @@ -2138,7 +2054,7 @@ fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) // fill template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag) { @@ -2147,7 +2063,7 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, f } template <class _RandomAccessIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag) { @@ -2155,7 +2071,7 @@ __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& _ } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -2165,7 +2081,7 @@ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) // generate template <class _ForwardIterator, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) { @@ -2176,7 +2092,7 @@ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) // generate_n template <class _OutputIterator, class _Size, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) { @@ -2190,7 +2106,7 @@ generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) // remove template <class _ForwardIterator, class _Tp> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { __first = _VSTD::find(__first, __last, __value_); @@ -2212,7 +2128,7 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) // remove_if template <class _ForwardIterator, class _Predicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type> @@ -2235,7 +2151,7 @@ remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) // remove_copy template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_) { @@ -2253,7 +2169,7 @@ remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res // remove_copy_if template <class _InputIterator, class _OutputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) { @@ -2271,7 +2187,7 @@ remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __ // unique template <class _ForwardIterator, class _BinaryPredicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type> @@ -2290,7 +2206,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pre } template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last) { @@ -2301,7 +2217,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last) // unique_copy template <class _BinaryPredicate, class _InputIterator, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred, input_iterator_tag, output_iterator_tag) { @@ -2324,7 +2240,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __r } template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred, forward_iterator_tag, output_iterator_tag) { @@ -2347,7 +2263,7 @@ __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator } template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred, input_iterator_tag, forward_iterator_tag) { @@ -2363,7 +2279,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __ } template <class _InputIterator, class _OutputIterator, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) { @@ -2374,7 +2290,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res } template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -2419,7 +2335,7 @@ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) // reverse_copy template <class _BidirectionalIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { @@ -3303,7 +3219,7 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> } template <class _InputIterator, class _Predicate> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) @@ -3381,7 +3297,7 @@ partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) template <class _InputIterator, class _OutputIterator1, class _OutputIterator2, class _Predicate> -pair<_OutputIterator1, _OutputIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> partition_copy(_InputIterator __first, _InputIterator __last, _OutputIterator1 __out_true, _OutputIterator2 __out_false, _Predicate __pred) @@ -3405,7 +3321,7 @@ partition_copy(_InputIterator __first, _InputIterator __last, // partition_point template<class _ForwardIterator, class _Predicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; @@ -3711,7 +3627,7 @@ stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate _ // is_sorted_until template <class _ForwardIterator, class _Compare> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { if (__first != __last) @@ -3728,7 +3644,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __co } template<class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) { @@ -3738,7 +3654,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) // is_sorted template <class _ForwardIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { @@ -3746,7 +3662,7 @@ is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) } template<class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last) { @@ -4272,7 +4188,7 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, // lower_bound template <class _Compare, class _ForwardIterator, class _Tp> -_ForwardIterator +_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; @@ -4294,7 +4210,7 @@ __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4309,7 +4225,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4320,7 +4236,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // upper_bound template <class _Compare, class _ForwardIterator, class _Tp> -_ForwardIterator +_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; @@ -4342,7 +4258,7 @@ __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4357,7 +4273,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4368,7 +4284,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // equal_range template <class _Compare, class _ForwardIterator, class _Tp> -pair<_ForwardIterator, _ForwardIterator> +_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; @@ -4402,7 +4318,7 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4417,7 +4333,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4428,7 +4344,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // binary_search template <class _Compare, class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4437,7 +4353,7 @@ __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __ } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4452,7 +4368,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4787,9 +4703,9 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1 ::new(__first2) value_type(_VSTD::move(*__first1)); return; case 2: - __destruct_n __d(0); + __destruct_n __d(0); unique_ptr<value_type, __destruct_n&> __h2(__first2, __d); - if (__comp(*--__last1, *__first1)) + if (__comp(*--__last1, *__first1)) { ::new(__first2) value_type(_VSTD::move(*__last1)); __d.__incr((value_type*)0); @@ -4906,7 +4822,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) // is_heap_until template <class _RandomAccessIterator, class _Compare> -_RandomAccessIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type; @@ -4933,7 +4849,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp } template<class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) { @@ -4943,7 +4859,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) // is_heap template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { @@ -4951,7 +4867,7 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __ } template<class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { @@ -5489,7 +5405,7 @@ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomA // includes template <class _Compare, class _InputIterator1, class _InputIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { @@ -5504,7 +5420,7 @@ __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __ } template <class _InputIterator1, class _InputIterator2, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) @@ -5520,7 +5436,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { @@ -5586,7 +5502,7 @@ set_union(_InputIterator1 __first1, _InputIterator1 __last1, // set_intersection template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { @@ -5609,7 +5525,7 @@ __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) @@ -5625,7 +5541,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) @@ -5751,7 +5667,7 @@ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, // lexicographical_compare template <class _Compare, class _InputIterator1, class _InputIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { @@ -5766,7 +5682,7 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) @@ -5782,7 +5698,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) diff --git a/include/any b/include/any index d7161b0d6f4c5..9bd2f53c56014 100644 --- a/include/any +++ b/include/any @@ -104,7 +104,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER > 14 -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_bad_any_cast() { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -304,7 +304,7 @@ private: __any_imp::_Buffer __buf; }; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void * __call(_Action __a, any * __other = nullptr, type_info const * __info = nullptr, const void* __fallback_info = nullptr) const @@ -312,7 +312,7 @@ private: return __h(__a, this, __other, __info, __fallback_info); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void * __call(_Action __a, any * __other = nullptr, type_info const * __info = nullptr, const void* __fallback_info = nullptr) diff --git a/include/array b/include/array index 4eb2fe6fc624f..1e6a650198b56 100644 --- a/include/array +++ b/include/array @@ -72,6 +72,9 @@ struct array const T* data() const noexcept; }; + template <class T, class... U> + array(T, U...) -> array<T, 1 + sizeof...(U)>; + template <class T, size_t N> bool operator==(const array<T,N>& x, const array<T,N>& y); template <class T, size_t N> @@ -86,7 +89,7 @@ template <class T, size_t N> bool operator>=(const array<T,N>& x, const array<T,N>& y); template <class T, size_t N > - void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); + void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // C++17 template <class T> class tuple_size; template <size_t I, class T> class tuple_element; @@ -108,6 +111,8 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce #include <iterator> #include <algorithm> #include <stdexcept> +#include <cstdlib> // for _LIBCPP_UNREACHABLE +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -117,6 +122,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce _LIBCPP_BEGIN_NAMESPACE_STD + template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array { @@ -134,31 +140,27 @@ struct _LIBCPP_TEMPLATE_VIS array typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - value_type __elems_[_Size > 0 ? _Size : 1]; + _Tp __elems_[_Size]; // No explicit construct/copy/destroy for aggregate type - _LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u) - {_VSTD::fill_n(__elems_, _Size, __u);} - _LIBCPP_INLINE_VISIBILITY - void swap(array& __a) _NOEXCEPT_(_Size == 0 || __is_nothrow_swappable<_Tp>::value) - { __swap_dispatch((std::integral_constant<bool, _Size == 0>()), __a); } - - _LIBCPP_INLINE_VISIBILITY - void __swap_dispatch(std::true_type, array&) {} + _LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u) { + _VSTD::fill_n(__elems_, _Size, __u); + } _LIBCPP_INLINE_VISIBILITY - void __swap_dispatch(std::false_type, array& __a) - { _VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);} + void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { + std::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_); + } // iterators: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - iterator begin() _NOEXCEPT {return iterator(__elems_);} + iterator begin() _NOEXCEPT {return iterator(data());} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - const_iterator begin() const _NOEXCEPT {return const_iterator(__elems_);} + const_iterator begin() const _NOEXCEPT {return const_iterator(data());} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - iterator end() _NOEXCEPT {return iterator(__elems_ + _Size);} + iterator end() _NOEXCEPT {return iterator(data() + _Size);} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - const_iterator end() const _NOEXCEPT {return const_iterator(__elems_ + _Size);} + const_iterator end() const _NOEXCEPT {return const_iterator(data() + _Size);} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());} @@ -184,7 +186,7 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;} _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} + _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return false; } // element access: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 @@ -197,8 +199,8 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {return __elems_[0];} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size - 1];} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 value_type* data() _NOEXCEPT {return __elems_;} @@ -206,6 +208,7 @@ struct _LIBCPP_TEMPLATE_VIS array const value_type* data() const _NOEXCEPT {return __elems_;} }; + template <class _Tp, size_t _Size> _LIBCPP_CONSTEXPR_AFTER_CXX14 typename array<_Tp, _Size>::reference @@ -227,12 +230,147 @@ array<_Tp, _Size>::at(size_type __n) const return __elems_[__n]; } +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> +{ + // types: + typedef array __self; + typedef _Tp value_type; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef value_type* iterator; + typedef const value_type* const_iterator; + typedef value_type* pointer; + 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 typename conditional<is_const<_Tp>::value, const char, + char>::type _CharType; + + struct _ArrayInStructT { _Tp __data_[1]; }; + _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)]; + + // No explicit construct/copy/destroy for aggregate type + _LIBCPP_INLINE_VISIBILITY void fill(const value_type&) { + static_assert(!is_const<_Tp>::value, + "cannot fill zero-sized array of type 'const T'"); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(array&) _NOEXCEPT { + static_assert(!is_const<_Tp>::value, + "cannot swap zero-sized array of type 'const T'"); + } + + // iterators: + _LIBCPP_INLINE_VISIBILITY + iterator begin() _NOEXCEPT {return iterator(data());} + _LIBCPP_INLINE_VISIBILITY + const_iterator begin() const _NOEXCEPT {return const_iterator(data());} + _LIBCPP_INLINE_VISIBILITY + iterator end() _NOEXCEPT {return iterator(data());} + _LIBCPP_INLINE_VISIBILITY + const_iterator end() const _NOEXCEPT {return const_iterator(data());} + + _LIBCPP_INLINE_VISIBILITY + reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());} + _LIBCPP_INLINE_VISIBILITY + reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());} + + _LIBCPP_INLINE_VISIBILITY + const_iterator cbegin() const _NOEXCEPT {return begin();} + _LIBCPP_INLINE_VISIBILITY + const_iterator cend() const _NOEXCEPT {return end();} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} + _LIBCPP_INLINE_VISIBILITY + const_reverse_iterator crend() const _NOEXCEPT {return rend();} + + // capacity: + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return 0; } + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return 0;} + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return true;} + + // element access: + _LIBCPP_INLINE_VISIBILITY + reference operator[](size_type) { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const_reference operator[](size_type) const { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + reference at(size_type) { + __throw_out_of_range("array<T, 0>::at"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + const_reference at(size_type) const { + __throw_out_of_range("array<T, 0>::at"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + reference front() { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + const_reference front() const { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + reference back() { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + const_reference back() const { + _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + value_type* data() _NOEXCEPT {return reinterpret_cast<value_type*>(__elems_);} + _LIBCPP_INLINE_VISIBILITY + const value_type* data() const _NOEXCEPT {return reinterpret_cast<const value_type*>(__elems_);} +}; + + +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _Tp, class... _Args, + class = typename enable_if<(is_same_v<_Tp, _Args> && ...), void>::type + > +array(_Tp, _Args...) + -> array<_Tp, 1 + sizeof...(_Args)>; +#endif + template <class _Tp, size_t _Size> inline _LIBCPP_INLINE_VISIBILITY bool operator==(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { - return _VSTD::equal(__x.__elems_, __x.__elems_ + _Size, __y.__elems_); + return _VSTD::equal(__x.begin(), __x.end(), __y.begin()); } template <class _Tp, size_t _Size> @@ -248,7 +386,8 @@ inline _LIBCPP_INLINE_VISIBILITY bool operator<(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) { - return _VSTD::lexicographical_compare(__x.__elems_, __x.__elems_ + _Size, __y.__elems_, __y.__elems_ + _Size); + return _VSTD::lexicographical_compare(__x.begin(), __x.end(), + __y.begin(), __y.end()); } template <class _Tp, size_t _Size> diff --git a/include/atomic b/include/atomic index f55e28ff5e92a..809f78a06d365 100644 --- a/include/atomic +++ b/include/atomic @@ -555,6 +555,9 @@ void atomic_signal_fence(memory_order m) noexcept; #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) #error <atomic> is not implemented #endif +#ifdef kill_dependency +#error C++ standard library is incompatible with <stdatomic.h> +#endif #if _LIBCPP_STD_VER > 14 # define __cpp_lib_atomic_is_always_lock_free 201603L @@ -695,7 +698,7 @@ static inline void __c11_atomic_store(_Atomic(_Tp)* __a, _Tp __val, } template <typename _Tp> -static inline _Tp __c11_atomic_load(volatile _Atomic(_Tp)* __a, +static inline _Tp __c11_atomic_load(const volatile _Atomic(_Tp)* __a, memory_order __order) { _Tp __ret; __atomic_load(&__a->__a_value, &__ret, @@ -704,7 +707,7 @@ static inline _Tp __c11_atomic_load(volatile _Atomic(_Tp)* __a, } template <typename _Tp> -static inline _Tp __c11_atomic_load(_Atomic(_Tp)* __a, memory_order __order) { +static inline _Tp __c11_atomic_load(const _Atomic(_Tp)* __a, memory_order __order) { _Tp __ret; __atomic_load(&__a->__a_value, &__ret, __gcc_atomic::__to_gcc_order(__order)); @@ -1741,7 +1744,7 @@ typedef struct atomic_flag atomic_flag() _NOEXCEPT : __a_() {} #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION #ifndef _LIBCPP_CXX03_LANG diff --git a/include/chrono b/include/chrono index c69e88ae4ded6..f6a6f4b24343f 100644 --- a/include/chrono +++ b/include/chrono @@ -26,7 +26,7 @@ duration_cast(const duration<Rep, Period>& fd); template <class Rep> struct treat_as_floating_point : is_floating_point<Rep> {}; -template <class Rep> constexpr bool treat_as_floating_point_v +template <class Rep> inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value; // C++17 template <class Rep> @@ -147,6 +147,11 @@ template <class Clock, class Duration1, class Duration2> namespace chrono { + +template<class T> struct is_clock; // C++20 +template<class T> inline constexpr bool is_clock_v = is_clock<T>::value; // C++20 + + // duration arithmetic template <class Rep1, class Period1, class Rep2, class Period2> constexpr @@ -204,6 +209,8 @@ template <class ToDuration, class Rep, class Period> template <class ToDuration, class Rep, class Period> constexpr ToDuration round(const duration<Rep, Period>& d); // C++17 +// duration I/O is elsewhere + // time_point arithmetic (all constexpr in C++14) template <class Clock, class Duration1, class Rep2, class Period2> time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type> @@ -251,6 +258,7 @@ template <class ToDuration, class Clock, class Duration> template <class Rep, class Period> constexpr duration<Rep, Period> abs(duration<Rep, Period> d); // C++17 + // Clocks class system_clock @@ -267,6 +275,28 @@ public: static time_point from_time_t(time_t __t) noexcept; }; +template <class Duration> + using sys_time = time_point<system_clock, Duration>; // C++20 +using sys_seconds = sys_time<seconds>; // C++20 +using sys_days = sys_time<days>; // C++20 + +class utc_clock; // C++20 + +template <class Duration> + using utc_time = time_point<utc_clock, Duration>; // C++20 +using utc_seconds = utc_time<seconds>; // C++20 + +class tai_clock; // C++20 + +template <class Duration> + using tai_time = time_point<tai_clock, Duration>; // C++20 +using tai_seconds = tai_time<seconds>; // C++20 + +class file_clock; // C++20 + +template<class Duration> + using file_time = time_point<file_clock, Duration>; // C++20 + class steady_clock { public: @@ -281,8 +311,466 @@ public: typedef steady_clock high_resolution_clock; +// 25.7.8, local time // C++20 +struct local_t {}; +template<class Duration> + using local_time = time_point<local_t, Duration>; +using local_seconds = local_time<seconds>; +using local_days = local_time<days>; + +// 25.7.9, time_point conversions template<class DestClock, class SourceClock> // C++20 +struct clock_time_conversion; + +template<class DestClock, class SourceClock, class Duration> + auto clock_cast(const time_point<SourceClock, Duration>& t); + +// 25.8.2, class last_spec // C++20 +struct last_spec; + +// 25.8.3, class day // C++20 + +class day; +constexpr bool operator==(const day& x, const day& y) noexcept; +constexpr bool operator!=(const day& x, const day& y) noexcept; +constexpr bool operator< (const day& x, const day& y) noexcept; +constexpr bool operator> (const day& x, const day& y) noexcept; +constexpr bool operator<=(const day& x, const day& y) noexcept; +constexpr bool operator>=(const day& x, const day& y) noexcept; +constexpr day operator+(const day& x, const days& y) noexcept; +constexpr day operator+(const days& x, const day& y) noexcept; +constexpr day operator-(const day& x, const days& y) noexcept; +constexpr days operator-(const day& x, const day& y) noexcept; + +// 25.8.4, class month // C++20 +class month; +constexpr bool operator==(const month& x, const month& y) noexcept; +constexpr bool operator!=(const month& x, const month& y) noexcept; +constexpr bool operator< (const month& x, const month& y) noexcept; +constexpr bool operator> (const month& x, const month& y) noexcept; +constexpr bool operator<=(const month& x, const month& y) noexcept; +constexpr bool operator>=(const month& x, const month& y) noexcept; +constexpr month operator+(const month& x, const months& y) noexcept; +constexpr month operator+(const months& x, const month& y) noexcept; +constexpr month operator-(const month& x, const months& y) noexcept; +constexpr months operator-(const month& x, const month& y) noexcept; + +// 25.8.5, class year // C++20 +class year; +constexpr bool operator==(const year& x, const year& y) noexcept; +constexpr bool operator!=(const year& x, const year& y) noexcept; +constexpr bool operator< (const year& x, const year& y) noexcept; +constexpr bool operator> (const year& x, const year& y) noexcept; +constexpr bool operator<=(const year& x, const year& y) noexcept; +constexpr bool operator>=(const year& x, const year& y) noexcept; +constexpr year operator+(const year& x, const years& y) noexcept; +constexpr year operator+(const years& x, const year& y) noexcept; +constexpr year operator-(const year& x, const years& y) noexcept; +constexpr years operator-(const year& x, const year& y) noexcept; + +// 25.8.6, class weekday // C++20 +class weekday; + +constexpr bool operator==(const weekday& x, const weekday& y) noexcept; +constexpr bool operator!=(const weekday& x, const weekday& y) noexcept; +constexpr weekday operator+(const weekday& x, const days& y) noexcept; +constexpr weekday operator+(const days& x, const weekday& y) noexcept; +constexpr weekday operator-(const weekday& x, const days& y) noexcept; +constexpr days operator-(const weekday& x, const weekday& y) noexcept; + +// 25.8.7, class weekday_indexed // C++20 + +class weekday_indexed; +constexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept; +constexpr bool operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept; + +// 25.8.8, class weekday_last // C++20 +class weekday_last; + +constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept; +constexpr bool operator!=(const weekday_last& x, const weekday_last& y) noexcept; + +// 25.8.9, class month_day // C++20 +class month_day; + +constexpr bool operator==(const month_day& x, const month_day& y) noexcept; +constexpr bool operator!=(const month_day& x, const month_day& y) noexcept; +constexpr bool operator< (const month_day& x, const month_day& y) noexcept; +constexpr bool operator> (const month_day& x, const month_day& y) noexcept; +constexpr bool operator<=(const month_day& x, const month_day& y) noexcept; +constexpr bool operator>=(const month_day& x, const month_day& y) noexcept; + + +// 25.8.10, class month_day_last // C++20 +class month_day_last; + +constexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept; +constexpr bool operator!=(const month_day_last& x, const month_day_last& y) noexcept; +constexpr bool operator< (const month_day_last& x, const month_day_last& y) noexcept; +constexpr bool operator> (const month_day_last& x, const month_day_last& y) noexcept; +constexpr bool operator<=(const month_day_last& x, const month_day_last& y) noexcept; +constexpr bool operator>=(const month_day_last& x, const month_day_last& y) noexcept; + +// 25.8.11, class month_weekday // C++20 +class month_weekday; + +constexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept; +constexpr bool operator!=(const month_weekday& x, const month_weekday& y) noexcept; + +// 25.8.12, class month_weekday_last // C++20 +class month_weekday_last; + +constexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept; +constexpr bool operator!=(const month_weekday_last& x, const month_weekday_last& y) noexcept; + + +// 25.8.13, class year_month // C++20 +class year_month; + +constexpr bool operator==(const year_month& x, const year_month& y) noexcept; +constexpr bool operator!=(const year_month& x, const year_month& y) noexcept; +constexpr bool operator< (const year_month& x, const year_month& y) noexcept; +constexpr bool operator> (const year_month& x, const year_month& y) noexcept; +constexpr bool operator<=(const year_month& x, const year_month& y) noexcept; +constexpr bool operator>=(const year_month& x, const year_month& y) noexcept; + +constexpr year_month operator+(const year_month& ym, const months& dm) noexcept; +constexpr year_month operator+(const months& dm, const year_month& ym) noexcept; +constexpr year_month operator-(const year_month& ym, const months& dm) noexcept; +constexpr months operator-(const year_month& x, const year_month& y) noexcept; +constexpr year_month operator+(const year_month& ym, const years& dy) noexcept; +constexpr year_month operator+(const years& dy, const year_month& ym) noexcept; +constexpr year_month operator-(const year_month& ym, const years& dy) noexcept; + +// 25.8.14, class year_month_day class // C++20 +year_month_day; + +constexpr bool operator==(const year_month_day& x, const year_month_day& y) noexcept; +constexpr bool operator!=(const year_month_day& x, const year_month_day& y) noexcept; +constexpr bool operator< (const year_month_day& x, const year_month_day& y) noexcept; +constexpr bool operator> (const year_month_day& x, const year_month_day& y) noexcept; +constexpr bool operator<=(const year_month_day& x, const year_month_day& y) noexcept; +constexpr bool operator>=(const year_month_day& x, const year_month_day& y) noexcept; + +constexpr year_month_day operator+(const year_month_day& ymd, const months& dm) noexcept; +constexpr year_month_day operator+(const months& dm, const year_month_day& ymd) noexcept; +constexpr year_month_day operator+(const year_month_day& ymd, const years& dy) noexcept; +constexpr year_month_day operator+(const years& dy, const year_month_day& ymd) noexcept; +constexpr year_month_day operator-(const year_month_day& ymd, const months& dm) noexcept; +constexpr year_month_day operator-(const year_month_day& ymd, const years& dy) noexcept; + + +// 25.8.15, class year_month_day_last // C++20 +class year_month_day_last; + +constexpr bool operator==(const year_month_day_last& x, + const year_month_day_last& y) noexcept; +constexpr bool operator!=(const year_month_day_last& x, + const year_month_day_last& y) noexcept; +constexpr bool operator< (const year_month_day_last& x, + const year_month_day_last& y) noexcept; +constexpr bool operator> (const year_month_day_last& x, + const year_month_day_last& y) noexcept; +constexpr bool operator<=(const year_month_day_last& x, + const year_month_day_last& y) noexcept; +constexpr bool operator>=(const year_month_day_last& x, + const year_month_day_last& y) noexcept; + +constexpr year_month_day_last + operator+(const year_month_day_last& ymdl, const months& dm) noexcept; +constexpr year_month_day_last + operator+(const months& dm, const year_month_day_last& ymdl) noexcept; +constexpr year_month_day_last + operator+(const year_month_day_last& ymdl, const years& dy) noexcept; +constexpr year_month_day_last + operator+(const years& dy, const year_month_day_last& ymdl) noexcept; +constexpr year_month_day_last + operator-(const year_month_day_last& ymdl, const months& dm) noexcept; +constexpr year_month_day_last + operator-(const year_month_day_last& ymdl, const years& dy) noexcept; + +// 25.8.16, class year_month_weekday // C++20 +class year_month_weekday; + +constexpr bool operator==(const year_month_weekday& x, + const year_month_weekday& y) noexcept; +constexpr bool operator!=(const year_month_weekday& x, + const year_month_weekday& y) noexcept; + +constexpr year_month_weekday + operator+(const year_month_weekday& ymwd, const months& dm) noexcept; +constexpr year_month_weekday + operator+(const months& dm, const year_month_weekday& ymwd) noexcept; +constexpr year_month_weekday + operator+(const year_month_weekday& ymwd, const years& dy) noexcept; +constexpr year_month_weekday + operator+(const years& dy, const year_month_weekday& ymwd) noexcept; +constexpr year_month_weekday + operator-(const year_month_weekday& ymwd, const months& dm) noexcept; +constexpr year_month_weekday + operator-(const year_month_weekday& ymwd, const years& dy) noexcept; + +// 25.8.17, class year_month_weekday_last // C++20 +class year_month_weekday_last; + +constexpr bool operator==(const year_month_weekday_last& x, + const year_month_weekday_last& y) noexcept; +constexpr bool operator!=(const year_month_weekday_last& x, + const year_month_weekday_last& y) noexcept; +constexpr year_month_weekday_last + operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept; +constexpr year_month_weekday_last + operator+(const months& dm, const year_month_weekday_last& ymwdl) noexcept; +constexpr year_month_weekday_last + operator+(const year_month_weekday_last& ymwdl, const years& dy) noexcept; +constexpr year_month_weekday_last + operator+(const years& dy, const year_month_weekday_last& ymwdl) noexcept; +constexpr year_month_weekday_last + operator-(const year_month_weekday_last& ymwdl, const months& dm) noexcept; +constexpr year_month_weekday_last + operator-(const year_month_weekday_last& ymwdl, const years& dy) noexcept; + +// 25.8.18, civil calendar conventional syntax operators // C++20 +constexpr year_month + operator/(const year& y, const month& m) noexcept; +constexpr year_month + operator/(const year& y, int m) noexcept; +constexpr month_day + operator/(const month& m, const day& d) noexcept; +constexpr month_day + operator/(const month& m, int d) noexcept; +constexpr month_day + operator/(int m, const day& d) noexcept; +constexpr month_day + operator/(const day& d, const month& m) noexcept; +constexpr month_day + operator/(const day& d, int m) noexcept; +constexpr month_day_last + operator/(const month& m, last_spec) noexcept; +constexpr month_day_last + operator/(int m, last_spec) noexcept; +constexpr month_day_last + operator/(last_spec, const month& m) noexcept; +constexpr month_day_last + operator/(last_spec, int m) noexcept; +constexpr month_weekday + operator/(const month& m, const weekday_indexed& wdi) noexcept; +constexpr month_weekday + operator/(int m, const weekday_indexed& wdi) noexcept; +constexpr month_weekday + operator/(const weekday_indexed& wdi, const month& m) noexcept; +constexpr month_weekday + operator/(const weekday_indexed& wdi, int m) noexcept; +constexpr month_weekday_last + operator/(const month& m, const weekday_last& wdl) noexcept; +constexpr month_weekday_last + operator/(int m, const weekday_last& wdl) noexcept; +constexpr month_weekday_last + operator/(const weekday_last& wdl, const month& m) noexcept; +constexpr month_weekday_last + operator/(const weekday_last& wdl, int m) noexcept; +constexpr year_month_day + operator/(const year_month& ym, const day& d) noexcept; +constexpr year_month_day + operator/(const year_month& ym, int d) noexcept; +constexpr year_month_day + operator/(const year& y, const month_day& md) noexcept; +constexpr year_month_day + operator/(int y, const month_day& md) noexcept; +constexpr year_month_day + operator/(const month_day& md, const year& y) noexcept; +constexpr year_month_day + operator/(const month_day& md, int y) noexcept; +constexpr year_month_day_last + operator/(const year_month& ym, last_spec) noexcept; +constexpr year_month_day_last + operator/(const year& y, const month_day_last& mdl) noexcept; +constexpr year_month_day_last + operator/(int y, const month_day_last& mdl) noexcept; +constexpr year_month_day_last + operator/(const month_day_last& mdl, const year& y) noexcept; +constexpr year_month_day_last + operator/(const month_day_last& mdl, int y) noexcept; +constexpr year_month_weekday + operator/(const year_month& ym, const weekday_indexed& wdi) noexcept; +constexpr year_month_weekday + operator/(const year& y, const month_weekday& mwd) noexcept; +constexpr year_month_weekday + operator/(int y, const month_weekday& mwd) noexcept; +constexpr year_month_weekday + operator/(const month_weekday& mwd, const year& y) noexcept; +constexpr year_month_weekday + operator/(const month_weekday& mwd, int y) noexcept; +constexpr year_month_weekday_last + operator/(const year_month& ym, const weekday_last& wdl) noexcept; +constexpr year_month_weekday_last + operator/(const year& y, const month_weekday_last& mwdl) noexcept; +constexpr year_month_weekday_last + operator/(int y, const month_weekday_last& mwdl) noexcept; +constexpr year_month_weekday_last + operator/(const month_weekday_last& mwdl, const year& y) noexcept; +constexpr year_month_weekday_last + operator/(const month_weekday_last& mwdl, int y) noexcept; + +// 25.9, class template time_of_day // C++20 +template<class Duration> class time_of_day; + +template<> class time_of_day<hours>; +template<> class time_of_day<minutes>; +template<> class time_of_day<seconds>; +template<class Rep, class Period> class time_of_day<duration<Rep, Period>>; + +// 25.10.2, time zone database // C++20 +struct tzdb; +class tzdb_list; + +// 25.10.2.3, time zone database access // C++20 +const tzdb& get_tzdb(); +tzdb_list& get_tzdb_list(); +const time_zone* locate_zone(string_view tz_name); +const time_zone* current_zone(); + +// 25.10.2.4, remote time zone database support // C++20 +const tzdb& reload_tzdb(); +string remote_version(); + +// 25.10.3, exception classes // C++20 +class nonexistent_local_time; +class ambiguous_local_time; + +// 25.10.4, information classes // C++20 +struct sys_info; +struct local_info; + +// 25.10.5, class time_zone // C++20 +enum class choose {earliest, latest}; +class time_zone; +bool operator==(const time_zone& x, const time_zone& y) noexcept; +bool operator!=(const time_zone& x, const time_zone& y) noexcept; +bool operator<(const time_zone& x, const time_zone& y) noexcept; +bool operator>(const time_zone& x, const time_zone& y) noexcept; +bool operator<=(const time_zone& x, const time_zone& y) noexcept; +bool operator>=(const time_zone& x, const time_zone& y) noexcept; + +// 25.10.6, class template zoned_traits // C++20 +template<class T> struct zoned_traits; + +// 25.10.7, class template zoned_time // C++20 +template<class Duration, class TimeZonePtr = const time_zone*> class zoned_time; +using zoned_seconds = zoned_time<seconds>; + +template<class Duration1, class Duration2, class TimeZonePtr> + bool operator==(const zoned_time<Duration1, TimeZonePtr>& x, + const zoned_time<Duration2, TimeZonePtr>& y); +template<class Duration1, class Duration2, class TimeZonePtr> + bool operator!=(const zoned_time<Duration1, TimeZonePtr>& x, + const zoned_time<Duration2, TimeZonePtr>& y); + +// 25.10.8, leap second support // C++20 +class leap; + +bool operator==(const leap& x, const leap& y); +bool operator!=(const leap& x, const leap& y); +bool operator< (const leap& x, const leap& y); +bool operator> (const leap& x, const leap& y); +bool operator<=(const leap& x, const leap& y); +bool operator>=(const leap& x, const leap& y); +template<class Duration> + bool operator==(const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator==(const sys_time<Duration>& x, const leap& y); +template<class Duration> + bool operator!=(const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator!=(const sys_time<Duration>& x, const leap& y); +template<class Duration> + bool operator< (const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator< (const sys_time<Duration>& x, const leap& y); +template<class Duration> + bool operator> (const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator> (const sys_time<Duration>& x, const leap& y); +template<class Duration> + bool operator<=(const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator<=(const sys_time<Duration>& x, const leap& y); +template<class Duration> + bool operator>=(const leap& x, const sys_time<Duration>& y); +template<class Duration> + bool operator>=(const sys_time<Duration>& x, const leap& y); + +// 25.10.9, class link // C++20 +class link; +bool operator==(const link& x, const link& y); +bool operator!=(const link& x, const link& y); +bool operator< (const link& x, const link& y); +bool operator> (const link& x, const link& y); +bool operator<=(const link& x, const link& y); +bool operator>=(const link& x, const link& y); + +// 25.11, formatting // C++20 +template<class charT, class Streamable> + basic_string<charT> + format(const charT* fmt, const Streamable& s); + +template<class charT, class Streamable> + basic_string<charT> + format(const locale& loc, const charT* fmt, const Streamable& s); + +template<class charT, class traits, class Alloc, class Streamable> + basic_string<charT, traits, Alloc> + format(const basic_string<charT, traits, Alloc>& fmt, const Streamable& s); + +template<class charT, class traits, class Alloc, class Streamable> + basic_string<charT, traits, Alloc> + format(const locale& loc, const basic_string<charT, traits, Alloc>& fmt, + const Streamable& s); + +// 25.12, parsing // C++20 +template<class charT, class traits, class Alloc, class Parsable> +unspecified + parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp); + +template<class charT, class traits, class Alloc, class Parsable> +unspecified + parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp, + basic_string<charT, traits, Alloc>& abbrev); + +template<class charT, class traits, class Alloc, class Parsable> +unspecified + parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp, + minutes& offset); + +template<class charT, class traits, class Alloc, class Parsable> +unspecified + parse(const basic_string<charT, traits, Alloc>& format, Parsable& tp, + basic_string<charT, traits, Alloc>& abbrev, minutes& offset); + +inline constexpr last_spec last{}; // C++20 +inline constexpr chrono::weekday Sunday{0}; // C++20 +inline constexpr chrono::weekday Monday{1}; // C++20 +inline constexpr chrono::weekday Tuesday{2}; // C++20 +inline constexpr chrono::weekday Wednesday{3}; // C++20 +inline constexpr chrono::weekday Thursday{4}; // C++20 +inline constexpr chrono::weekday Friday{5}; // C++20 +inline constexpr chrono::weekday Saturday{6}; // C++20 + +inline constexpr chrono::month January{1}; // C++20 +inline constexpr chrono::month February{2}; // C++20 +inline constexpr chrono::month March{3}; // C++20 +inline constexpr chrono::month April{4}; // C++20 +inline constexpr chrono::month May{5}; // C++20 +inline constexpr chrono::month June{6}; // C++20 +inline constexpr chrono::month July{7}; // C++20 +inline constexpr chrono::month August{8}; // C++20 +inline constexpr chrono::month September{9}; // C++20 +inline constexpr chrono::month October{10}; // C++20 +inline constexpr chrono::month November{11}; // C++20 +inline constexpr chrono::month December{12}; // C++20 } // chrono +inline namespace literals { + inline namespace chrono_literals { constexpr chrono::hours operator ""h(unsigned long long); // C++14 constexpr chrono::duration<unspecified , ratio<3600,1>> operator ""h(long double); // C++14 constexpr chrono::minutes operator ""min(unsigned long long); // C++14 @@ -295,6 +783,10 @@ constexpr chrono::microseconds operator ""us(unsigned l constexpr chrono::duration<unspecified , micro> operator ""us(long double); // C++14 constexpr chrono::nanoseconds operator ""ns(unsigned long long); // C++14 constexpr chrono::duration<unspecified , nano> operator ""ns(long double); // C++14 +constexpr chrono::day operator ""d(unsigned long long d) noexcept; // C++20 +constexpr chrono::year operator ""y(unsigned long long y) noexcept; // C++20 +} // chrono_literals +} // literals } // std */ @@ -419,7 +911,8 @@ template <class _Rep> struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v +template <class _Rep> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value; #endif diff --git a/include/cmath b/include/cmath index 917928a1f42f6..ffb1c46c7b68b 100644 --- a/include/cmath +++ b/include/cmath @@ -547,7 +547,7 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT #endif template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT { @@ -559,7 +559,7 @@ __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT } template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT { @@ -567,7 +567,7 @@ __libcpp_isnan_or_builtin(_A1 __lcpp_x) _NOEXCEPT } template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type __libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT { @@ -579,7 +579,7 @@ __libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT } template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type __libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT { @@ -587,7 +587,7 @@ __libcpp_isinf_or_builtin(_A1 __lcpp_x) _NOEXCEPT } template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type __libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT { @@ -599,7 +599,7 @@ __libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT } template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type __libcpp_isfinite_or_builtin(_A1 __lcpp_x) _NOEXCEPT { diff --git a/include/codecvt b/include/codecvt index 46f56acff71b6..5eb9d1549118e 100644 --- a/include/codecvt +++ b/include/codecvt @@ -86,7 +86,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -121,7 +121,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -156,7 +156,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -186,11 +186,11 @@ class _LIBCPP_TEMPLATE_VIS codecvt_utf8 : public __codecvt_utf8<_Elem> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt_utf8(size_t __refs = 0) : __codecvt_utf8<_Elem>(__refs, _Maxcode, _Mode) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~codecvt_utf8() {} }; @@ -209,7 +209,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -244,7 +244,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -279,7 +279,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -314,7 +314,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -349,7 +349,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -384,7 +384,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -414,11 +414,11 @@ class _LIBCPP_TEMPLATE_VIS codecvt_utf16 : public __codecvt_utf16<_Elem, _Mode & little_endian> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt_utf16(size_t __refs = 0) : __codecvt_utf16<_Elem, _Mode & little_endian>(__refs, _Maxcode, _Mode) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~codecvt_utf16() {} }; @@ -437,7 +437,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -472,7 +472,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -507,7 +507,7 @@ public: typedef char extern_type; typedef mbstate_t state_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __codecvt_utf8_utf16(size_t __refs, unsigned long _Maxcode, codecvt_mode _Mode) : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode), @@ -537,11 +537,11 @@ class _LIBCPP_TEMPLATE_VIS codecvt_utf8_utf16 : public __codecvt_utf8_utf16<_Elem> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit codecvt_utf8_utf16(size_t __refs = 0) : __codecvt_utf8_utf16<_Elem>(__refs, _Maxcode, _Mode) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~codecvt_utf8_utf16() {} }; diff --git a/include/compare b/include/compare new file mode 100644 index 0000000000000..07f88f09cb37a --- /dev/null +++ b/include/compare @@ -0,0 +1,679 @@ +// -*- C++ -*- +//===-------------------------- compare -----------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_COMPARE +#define _LIBCPP_COMPARE + +/* + compare synopsis + +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_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; } + constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; } + + // [cmp.common], common comparison category type + template<class... Ts> + struct common_comparison_category { + using type = see below; + }; + template<class... Ts> + using common_comparison_category_t = typename common_comparison_category<Ts...>::type; + + // [cmp.alg], comparison algorithms + 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); +} +*/ + +#include <__config> +#include <type_traits> +#include <array> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// exposition only +enum class _LIBCPP_ENUM_VIS _EqResult : unsigned char { + __zero = 0, + __equal = __zero, + __equiv = __equal, + __nonequal = 1, + __nonequiv = __nonequal +}; + +enum class _LIBCPP_ENUM_VIS _OrdResult : signed char { + __less = -1, + __greater = 1 +}; + +enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char { + __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) {} + +public: + static const strong_equality equal; + static const strong_equality nonequal; + static const strong_equality equivalent; + static const strong_equality nonequivalent; + + // conversion + _LIBCPP_INLINE_VISIBILITY constexpr operator weak_equality() const noexcept { + return __value_ == _EqResult::__zero ? weak_equality::equivalent + : weak_equality::nonequivalent; + } + + // 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_; +}; + +_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; + + _LIBCPP_INLINE_VISIBILITY + explicit constexpr partial_ordering(_EqResult __v) noexcept + : __value_(_ValueT(__v)) {} + + _LIBCPP_INLINE_VISIBILITY + explicit constexpr partial_ordering(_OrdResult __v) noexcept + : __value_(_ValueT(__v)) {} + + _LIBCPP_INLINE_VISIBILITY + explicit constexpr partial_ordering(_NCmpResult __v) noexcept + : __value_(_ValueT(__v)) {} + + constexpr bool __is_ordered() const noexcept { + return __value_ != _ValueT(_NCmpResult::__unordered); + } +public: + // valid values + static const partial_ordering less; + static const partial_ordering equivalent; + 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 partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept; + _LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept; +#endif + +private: + _ValueT __value_; +}; + +_LIBCPP_INLINE_VAR constexpr partial_ordering partial_ordering::less(_OrdResult::__less); +_LIBCPP_INLINE_VAR constexpr partial_ordering partial_ordering::equivalent(_EqResult::__equiv); +_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; + + _LIBCPP_INLINE_VISIBILITY + explicit constexpr weak_ordering(_EqResult __v) noexcept : __value_(_ValueT(__v)) {} + _LIBCPP_INLINE_VISIBILITY + explicit constexpr weak_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {} + +public: + static const weak_ordering less; + 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 + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + + // 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 weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept; + _LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept; +#endif + +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; + + _LIBCPP_INLINE_VISIBILITY + explicit constexpr strong_ordering(_EqResult __v) noexcept : __value_(_ValueT(__v)) {} + _LIBCPP_INLINE_VISIBILITY + explicit constexpr strong_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {} + +public: + static const strong_ordering less; + static const strong_ordering equal; + static const strong_ordering equivalent; + 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 + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + + _LIBCPP_INLINE_VISIBILITY + constexpr operator weak_ordering() const noexcept { + return __value_ == 0 ? weak_ordering::equivalent + : (__value_ < 0 ? weak_ordering::less : weak_ordering::greater); + } + + // 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 strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept; + _LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept; +#endif + +private: + _ValueT __value_; +}; + +_LIBCPP_INLINE_VAR constexpr strong_ordering strong_ordering::less(_OrdResult::__less); +_LIBCPP_INLINE_VAR constexpr strong_ordering strong_ordering::equal(_EqResult::__equal); +_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; } + +_LIBCPP_INLINE_VISIBILITY +constexpr bool is_lteq(partial_ordering __cmp) noexcept { return __cmp <= 0; } + +_LIBCPP_INLINE_VISIBILITY +constexpr bool is_gt(partial_ordering __cmp) noexcept { return __cmp > 0; } + +_LIBCPP_INLINE_VISIBILITY +constexpr bool is_gteq(partial_ordering __cmp) noexcept { return __cmp >= 0; } + +namespace __comp_detail { + +enum _ClassifyCompCategory : unsigned{ + _None, + _WeakEq, + _StrongEq, + _PartialOrd, + _WeakOrd, + _StrongOrd, + _CCC_Size +}; + +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>) + return _WeakOrd; + if (is_same_v<_Tp, strong_ordering>) + return _StrongOrd; + return _None; +} + +template <size_t _Size> +constexpr _ClassifyCompCategory +__compute_comp_type(std::array<_ClassifyCompCategory, _Size> __types) { + std::array<int, _CCC_Size> __seen = {}; + 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 _WeakOrd; + return _StrongOrd; +} + +template <class ..._Ts> +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); + 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) + return weak_ordering::equivalent; + else if constexpr (_Cat == _StrongOrd) + return strong_ordering::equivalent; + else + static_assert(_Cat != _Cat, "unhandled case"); +} +} // namespace __comp_detail + +// [cmp.common], common comparison category type +template<class... _Ts> +struct _LIBCPP_TEMPLATE_VIS common_comparison_category { + using type = decltype(__comp_detail::__get_comp_type<_Ts...>()); +}; + +template<class... _Ts> +using common_comparison_category_t = typename common_comparison_category<_Ts...>::type; + +// [cmp.alg], comparison algorithms +// TODO: unimplemented +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 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_COMPARE diff --git a/include/complex b/include/complex index 41a47cfba47cf..d692ee3192044 100644 --- a/include/complex +++ b/include/complex @@ -203,7 +203,7 @@ template<class T> complex<T> proj(const complex<T>&); template<Integral T> complex<double> proj(T); complex<float> proj(float); -template<class T> complex<T> polar(const T&, const T& = 0); +template<class T> complex<T> polar(const T&, const T& = T()); // 26.3.8 transcendentals: template<class T> complex<T> acos(const complex<T>&); @@ -991,7 +991,7 @@ proj(_Tp __re) template<class _Tp> complex<_Tp> -polar(const _Tp& __rho, const _Tp& __theta = _Tp(0)) +polar(const _Tp& __rho, const _Tp& __theta = _Tp()) { if (__libcpp_isnan_or_builtin(__rho) || signbit(__rho)) return complex<_Tp>(_Tp(NAN), _Tp(NAN)); @@ -1125,6 +1125,17 @@ pow(const _Tp& __x, const complex<_Up>& __y) return _VSTD::pow(result_type(__x), result_type(__y)); } +// __sqr, computes pow(x, 2) + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +complex<_Tp> +__sqr(const complex<_Tp>& __x) +{ + return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()), + _Tp(2) * __x.real() * __x.imag()); +} + // asinh template<class _Tp> @@ -1150,7 +1161,7 @@ asinh(const complex<_Tp>& __x) } if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag())); - complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) + _Tp(1))); + complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1))); return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag())); } @@ -1184,7 +1195,7 @@ acosh(const complex<_Tp>& __x) } if (__libcpp_isinf_or_builtin(__x.imag())) return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag())); - complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1))); + complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1))); return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag())); } @@ -1318,7 +1329,7 @@ acos(const complex<_Tp>& __x) return complex<_Tp>(__pi/_Tp(2), -__x.imag()); if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag()))) return complex<_Tp>(__pi/_Tp(2), -__x.imag()); - complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1))); + complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1))); if (signbit(__x.imag())) return complex<_Tp>(abs(__z.imag()), abs(__z.real())); return complex<_Tp>(abs(__z.imag()), -abs(__z.real())); diff --git a/include/deque b/include/deque index 08cb295408be5..bfbd3a5ef5438 100644 --- a/include/deque +++ b/include/deque @@ -128,6 +128,10 @@ public: void clear() noexcept; }; +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + deque(InputIterator, InputIterator, Allocator = Allocator()) + -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; + template <class T, class Allocator> bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y); template <class T, class Allocator> @@ -921,13 +925,14 @@ class __deque_base { __deque_base(const __deque_base& __c); __deque_base& operator=(const __deque_base& __c); -protected: - typedef _Tp value_type; +public: typedef _Allocator allocator_type; typedef allocator_traits<allocator_type> __alloc_traits; + typedef typename __alloc_traits::size_type size_type; +protected: + typedef _Tp value_type; typedef value_type& reference; typedef const value_type& const_reference; - typedef typename __alloc_traits::size_type size_type; typedef typename __alloc_traits::difference_type difference_type; typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; @@ -946,6 +951,7 @@ protected: typedef __deque_iterator<value_type, const_pointer, const_reference, __map_const_pointer, difference_type> const_iterator; +protected: __map __map_; size_type __start_; __compressed_pair<size_type, allocator_type> __size_; @@ -1461,6 +1467,23 @@ private: void __move_assign(deque& __c, false_type); }; +#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 + > +deque(_InputIterator, _InputIterator) + -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +deque(_InputIterator, _InputIterator, _Alloc) + -> deque<typename iterator_traits<_InputIterator>::value_type, _Alloc>; +#endif + + template <class _Tp, class _Allocator> deque<_Tp, _Allocator>::deque(size_type __n) { diff --git a/include/exception b/include/exception index 79bd6ac2ae356..b517486b5a8ee 100644 --- a/include/exception +++ b/include/exception @@ -259,7 +259,7 @@ struct __throw_with_nested; template <class _Tp, class _Up> struct __throw_with_nested<_Tp, _Up, true> { - _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void + _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void #ifndef _LIBCPP_CXX03_LANG __do_throw(_Tp&& __t) #else @@ -272,7 +272,7 @@ struct __throw_with_nested<_Tp, _Up, true> { template <class _Tp, class _Up> struct __throw_with_nested<_Tp, _Up, false> { - _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void + _LIBCPP_NORETURN static inline _LIBCPP_INLINE_VISIBILITY void #ifndef _LIBCPP_CXX03_LANG __do_throw(_Tp&& __t) #else diff --git a/include/experimental/__config b/include/experimental/__config index 37f88c166dd21..55ae31b8aea32 100644 --- a/include/experimental/__config +++ b/include/experimental/__config @@ -52,6 +52,16 @@ #define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1 -#define _VSTD_FS ::std::experimental::filesystem::v1 +#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \ + _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 { + +#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD \ + } _LIBCPP_END_NAMESPACE_EXPERIMENTAL + +#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI \ + _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD namespace simd_abi { + +#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI \ + } _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD #endif diff --git a/include/experimental/algorithm b/include/experimental/algorithm index a6a28f07181bf..eb3bad6ef98c0 100644 --- a/include/experimental/algorithm +++ b/include/experimental/algorithm @@ -23,11 +23,8 @@ inline namespace fundamentals_v1 { template <class ForwardIterator, class Searcher> ForwardIterator search(ForwardIterator first, ForwardIterator last, const Searcher &searcher); -template <class PopulationIterator, class SampleIterator, class Distance, - class UniformRandomNumberGenerator> -SampleIterator sample(PopulationIterator first, PopulationIterator last, - SampleIterator out, Distance n, - UniformRandomNumberGenerator &&g); + +// sample removed because it's now part of C++17 } // namespace fundamentals_v1 } // namespace experimental @@ -56,16 +53,6 @@ _LIBCPP_INLINE_VISIBILITY _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) { return __s(__f, __l).first; } - -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); -} - _LIBCPP_END_NAMESPACE_LFTS _LIBCPP_POP_MACROS diff --git a/include/experimental/any b/include/experimental/any index 083a2909033c3..1dcdd0f25ec37 100644 --- a/include/experimental/any +++ b/include/experimental/any @@ -8,585 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_ANY -#define _LIBCPP_EXPERIMENTAL_ANY - -/* - experimental/any synopsis - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - class bad_any_cast : public bad_cast - { - public: - virtual const char* what() const noexcept; - }; - - class any - { - public: - - // 6.3.1 any construct/destruct - any() noexcept; - - any(const any& other); - any(any&& other) noexcept; - - template <class ValueType> - any(ValueType&& value); - - ~any(); - - // 6.3.2 any assignments - any& operator=(const any& rhs); - any& operator=(any&& rhs) noexcept; - - template <class ValueType> - any& operator=(ValueType&& rhs); - - // 6.3.3 any modifiers - void clear() noexcept; - void swap(any& rhs) noexcept; - - // 6.3.4 any observers - bool empty() const noexcept; - const type_info& type() const noexcept; - }; - - // 6.4 Non-member functions - void swap(any& x, any& y) noexcept; - - template<class ValueType> - ValueType any_cast(const any& operand); - template<class ValueType> - ValueType any_cast(any& operand); - template<class ValueType> - ValueType any_cast(any&& operand); - - template<class ValueType> - const ValueType* any_cast(const any* operand) noexcept; - template<class ValueType> - ValueType* any_cast(any* operand) noexcept; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - -*/ - -#include <experimental/__config> -#include <memory> -#include <new> -#include <typeinfo> -#include <type_traits> -#include <cstdlib> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast -{ -public: - virtual const char* what() const _NOEXCEPT; -}; - -#if _LIBCPP_STD_VER > 11 // C++ > 11 - -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE -_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -void __throw_bad_any_cast() -{ -#ifndef _LIBCPP_NO_EXCEPTIONS - throw bad_any_cast(); -#else - _VSTD::abort(); -#endif -} - -// Forward declarations -class any; - -template <class _ValueType> -typename add_pointer<typename add_const<_ValueType>::type>::type -_LIBCPP_INLINE_VISIBILITY -any_cast(any const *) _NOEXCEPT; - -template <class _ValueType> -typename add_pointer<_ValueType>::type -_LIBCPP_INLINE_VISIBILITY -any_cast(any *) _NOEXCEPT; - -namespace __any_imp -{ - typedef typename aligned_storage<3*sizeof(void*), alignment_of<void*>::value>::type - _Buffer; - - template <class _Tp> - struct _IsSmallObject - : public integral_constant<bool - , sizeof(_Tp) <= sizeof(_Buffer) - && alignment_of<_Buffer>::value - % alignment_of<_Tp>::value == 0 - && is_nothrow_move_constructible<_Tp>::value - > - {}; - - enum class _Action - { - _Destroy, - _Copy, - _Move, - _Get, - _TypeInfo - }; - - template <class _Tp> - struct _SmallHandler; - - template <class _Tp> - struct _LargeHandler; - - template <class _Tp> - using _Handler = typename conditional<_IsSmallObject<_Tp>::value - , _SmallHandler<_Tp> - , _LargeHandler<_Tp> - >::type; - template <class _ValueType> - using _EnableIfNotAny = typename - enable_if< - !is_same<typename decay<_ValueType>::type, any>::value - >::type; - -} // namespace __any_imp - -class any -{ -public: - // 6.3.1 any construct/destruct - _LIBCPP_INLINE_VISIBILITY - any() _NOEXCEPT : __h(nullptr) {} - - _LIBCPP_INLINE_VISIBILITY - any(any const & __other) : __h(nullptr) - { - if (__other.__h) __other.__call(_Action::_Copy, this); - } - - _LIBCPP_INLINE_VISIBILITY - any(any && __other) _NOEXCEPT : __h(nullptr) - { - if (__other.__h) __other.__call(_Action::_Move, this); - } - - template < - class _ValueType - , class = __any_imp::_EnableIfNotAny<_ValueType> - > - _LIBCPP_INLINE_VISIBILITY - any(_ValueType && __value); - - _LIBCPP_INLINE_VISIBILITY - ~any() - { - this->clear(); - } - - // 6.3.2 any assignments - _LIBCPP_INLINE_VISIBILITY - any & operator=(any const & __rhs) - { - any(__rhs).swap(*this); - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - any & operator=(any && __rhs) _NOEXCEPT - { - any(_VSTD::move(__rhs)).swap(*this); - return *this; - } - - template < - class _ValueType - , class = __any_imp::_EnableIfNotAny<_ValueType> - > - _LIBCPP_INLINE_VISIBILITY - any & operator=(_ValueType && __rhs); - - // 6.3.3 any modifiers - _LIBCPP_INLINE_VISIBILITY - void clear() _NOEXCEPT - { - if (__h) this->__call(_Action::_Destroy); - } - - _LIBCPP_INLINE_VISIBILITY - void swap(any & __rhs) _NOEXCEPT; - - // 6.3.4 any observers - _LIBCPP_INLINE_VISIBILITY - bool empty() const _NOEXCEPT - { - return __h == nullptr; - } - -#if !defined(_LIBCPP_NO_RTTI) - _LIBCPP_INLINE_VISIBILITY - const type_info & type() const _NOEXCEPT - { - if (__h) { - return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo)); - } else { - return typeid(void); - } - } -#endif - -private: - typedef __any_imp::_Action _Action; - - typedef void* (*_HandleFuncPtr)(_Action, any const *, any *, const type_info *); - - union _Storage - { - void * __ptr; - __any_imp::_Buffer __buf; - }; - - _LIBCPP_ALWAYS_INLINE - void * __call(_Action __a, any * __other = nullptr, - type_info const * __info = nullptr) const - { - return __h(__a, this, __other, __info); - } - - _LIBCPP_ALWAYS_INLINE - void * __call(_Action __a, any * __other = nullptr, - type_info const * __info = nullptr) - { - return __h(__a, this, __other, __info); - } - - template <class> - friend struct __any_imp::_SmallHandler; - template <class> - friend struct __any_imp::_LargeHandler; - - template <class _ValueType> - friend typename add_pointer<typename add_const<_ValueType>::type>::type - any_cast(any const *) _NOEXCEPT; - - template <class _ValueType> - friend typename add_pointer<_ValueType>::type - any_cast(any *) _NOEXCEPT; - - _HandleFuncPtr __h; - _Storage __s; -}; - -namespace __any_imp -{ - - template <class _Tp> - struct _LIBCPP_TEMPLATE_VIS _SmallHandler - { - _LIBCPP_INLINE_VISIBILITY - static void* __handle(_Action __act, any const * __this, any * __other, - type_info const * __info) - { - switch (__act) - { - case _Action::_Destroy: - __destroy(const_cast<any &>(*__this)); - return nullptr; - case _Action::_Copy: - __copy(*__this, *__other); - return nullptr; - case _Action::_Move: - __move(const_cast<any &>(*__this), *__other); - return nullptr; - case _Action::_Get: - return __get(const_cast<any &>(*__this), __info); - case _Action::_TypeInfo: - return __type_info(); - } - } - - template <class _Up> - _LIBCPP_INLINE_VISIBILITY - static void __create(any & __dest, _Up && __v) - { - ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Up>(__v)); - __dest.__h = &_SmallHandler::__handle; - } - - private: - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __destroy(any & __this) - { - _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf)); - __value.~_Tp(); - __this.__h = nullptr; - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __copy(any const & __this, any & __dest) - { - _SmallHandler::__create(__dest, *static_cast<_Tp const *>( - static_cast<void const *>(&__this.__s.__buf))); - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __move(any & __this, any & __dest) - { - _SmallHandler::__create(__dest, _VSTD::move( - *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf)))); - __destroy(__this); - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void* __get(any & __this, type_info const * __info) - { -#if !defined(_LIBCPP_NO_RTTI) - if (typeid(_Tp) == *__info) { - return static_cast<void*>(&__this.__s.__buf); - } - return nullptr; -#else - return static_cast<void*>(&__this.__s.__buf); -#endif - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void* __type_info() - { -#if !defined(_LIBCPP_NO_RTTI) - return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); -#else - return nullptr; -#endif - } - }; - - template <class _Tp> - struct _LIBCPP_TEMPLATE_VIS _LargeHandler - { - _LIBCPP_INLINE_VISIBILITY - static void* __handle(_Action __act, any const * __this, any * __other, - type_info const * __info) - { - switch (__act) - { - case _Action::_Destroy: - __destroy(const_cast<any &>(*__this)); - return nullptr; - case _Action::_Copy: - __copy(*__this, *__other); - return nullptr; - case _Action::_Move: - __move(const_cast<any &>(*__this), *__other); - return nullptr; - case _Action::_Get: - return __get(const_cast<any &>(*__this), __info); - case _Action::_TypeInfo: - return __type_info(); - } - } - - template <class _Up> - _LIBCPP_INLINE_VISIBILITY - static void __create(any & __dest, _Up && __v) - { - typedef allocator<_Tp> _Alloc; - typedef __allocator_destructor<_Alloc> _Dp; - _Alloc __a; - unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Up>(__v)); - __dest.__s.__ptr = __hold.release(); - __dest.__h = &_LargeHandler::__handle; - } - - private: - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __destroy(any & __this) - { - delete static_cast<_Tp*>(__this.__s.__ptr); - __this.__h = nullptr; - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __copy(any const & __this, any & __dest) - { - _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr)); - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void __move(any & __this, any & __dest) - { - __dest.__s.__ptr = __this.__s.__ptr; - __dest.__h = &_LargeHandler::__handle; - __this.__h = nullptr; - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void* __get(any & __this, type_info const * __info) - { -#if !defined(_LIBCPP_NO_RTTI) - if (typeid(_Tp) == *__info) { - return static_cast<void*>(__this.__s.__ptr); - } - return nullptr; -#else - return static_cast<void*>(__this.__s.__ptr); -#endif - } - - _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY - static void* __type_info() - { -#if !defined(_LIBCPP_NO_RTTI) - return const_cast<void*>(static_cast<void const *>(&typeid(_Tp))); -#else - return nullptr; -#endif - } - }; - -} // namespace __any_imp - - -template <class _ValueType, class> -any::any(_ValueType && __v) : __h(nullptr) -{ - typedef typename decay<_ValueType>::type _Tp; - static_assert(is_copy_constructible<_Tp>::value, - "_ValueType must be CopyConstructible."); - typedef __any_imp::_Handler<_Tp> _HandlerType; - _HandlerType::__create(*this, _VSTD::forward<_ValueType>(__v)); -} - -template <class _ValueType, class> -any & any::operator=(_ValueType && __v) -{ - typedef typename decay<_ValueType>::type _Tp; - static_assert(is_copy_constructible<_Tp>::value, - "_ValueType must be CopyConstructible."); - any(_VSTD::forward<_ValueType>(__v)).swap(*this); - return *this; -} - -inline -void any::swap(any & __rhs) _NOEXCEPT -{ - if (__h && __rhs.__h) { - any __tmp; - __rhs.__call(_Action::_Move, &__tmp); - this->__call(_Action::_Move, &__rhs); - __tmp.__call(_Action::_Move, this); - } - else if (__h) { - this->__call(_Action::_Move, &__rhs); - } - else if (__rhs.__h) { - __rhs.__call(_Action::_Move, this); - } -} - -// 6.4 Non-member functions - -inline _LIBCPP_INLINE_VISIBILITY -void swap(any & __lhs, any & __rhs) _NOEXCEPT -{ - __lhs.swap(__rhs); -} - -template <class _ValueType> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any const & __v) -{ - static_assert( - is_reference<_ValueType>::value - || is_copy_constructible<_ValueType>::value, - "_ValueType is required to be a reference or a CopyConstructible type."); - typedef typename add_const<typename remove_reference<_ValueType>::type>::type - _Tp; - _Tp * __tmp = any_cast<_Tp>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return *__tmp; -} - -template <class _ValueType> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any & __v) -{ - static_assert( - is_reference<_ValueType>::value - || is_copy_constructible<_ValueType>::value, - "_ValueType is required to be a reference or a CopyConstructible type."); - typedef typename remove_reference<_ValueType>::type _Tp; - _Tp * __tmp = any_cast<_Tp>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return *__tmp; -} - -template <class _ValueType> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -_ValueType any_cast(any && __v) -{ - static_assert( - is_reference<_ValueType>::value - || is_copy_constructible<_ValueType>::value, - "_ValueType is required to be a reference or a CopyConstructible type."); - typedef typename remove_reference<_ValueType>::type _Tp; - _Tp * __tmp = any_cast<_Tp>(&__v); - if (__tmp == nullptr) - __throw_bad_any_cast(); - return *__tmp; -} - -template <class _ValueType> -inline -typename add_pointer<typename add_const<_ValueType>::type>::type -any_cast(any const * __any) _NOEXCEPT -{ - static_assert(!is_reference<_ValueType>::value, - "_ValueType may not be a reference."); - return any_cast<_ValueType>(const_cast<any *>(__any)); -} - -template <class _ValueType> -typename add_pointer<_ValueType>::type -any_cast(any * __any) _NOEXCEPT -{ - using __any_imp::_Action; - static_assert(!is_reference<_ValueType>::value, - "_ValueType may not be a reference."); - typedef typename add_pointer<_ValueType>::type _ReturnType; - if (__any && __any->__h) { - - return static_cast<_ReturnType>( - __any->__call(_Action::_Get, nullptr, -#if !defined(_LIBCPP_NO_RTTI) - &typeid(_ValueType) -#else - nullptr -#endif - )); - - } - return nullptr; -} - -#endif // _LIBCPP_STD_VER > 11 - -_LIBCPP_END_NAMESPACE_LFTS - -#endif // _LIBCPP_EXPERIMENTAL_ANY +#error "<experimental/any> has been removed. Use <any> instead." diff --git a/include/experimental/chrono b/include/experimental/chrono index ca9e5f852ea21..591cf7160c136 100644 --- a/include/experimental/chrono +++ b/include/experimental/chrono @@ -8,52 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_CHRONO -#define _LIBCPP_EXPERIMENTAL_CHRONO - -/** - experimental/chrono synopsis - -// C++1y - -#include <chrono> - -namespace std { -namespace chrono { -namespace experimental { -inline namespace fundamentals_v1 { - - // See C++14 20.12.4, customization traits - template <class Rep> constexpr bool treat_as_floating_point_v - = treat_as_floating_point<Rep>::value; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace chrono -} // namespace std - - */ - -#include <experimental/__config> -#include <chrono> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 11 - -_LIBCPP_BEGIN_NAMESPACE_CHRONO_LFTS - -#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES - -template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v - = treat_as_floating_point<_Rep>::value; - -#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */ - -_LIBCPP_END_NAMESPACE_CHRONO_LFTS - -#endif /* _LIBCPP_STD_VER > 11 */ - -#endif /* _LIBCPP_EXPERIMENTAL_CHRONO */ +#error "<experimental/chrono> has been removed. Use <chrono> instead." diff --git a/include/experimental/coroutine b/include/experimental/coroutine index ce795ad452c04..1eb224a535a14 100644 --- a/include/experimental/coroutine +++ b/include/experimental/coroutine @@ -93,28 +93,28 @@ class _LIBCPP_TEMPLATE_VIS coroutine_handle; template <> class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY coroutine_handle& operator=(nullptr_t) _NOEXCEPT { __handle_ = nullptr; return *this; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void operator()() { resume(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void resume() { _LIBCPP_ASSERT(__is_suspended(), "resume() can only be called on suspended coroutines"); @@ -123,14 +123,14 @@ public: __builtin_coro_resume(__handle_); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void destroy() { _LIBCPP_ASSERT(__is_suspended(), "destroy() can only be called on suspended coroutines"); __builtin_coro_destroy(__handle_); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool done() const { _LIBCPP_ASSERT(__is_suspended(), "done() can only be called on suspended coroutines"); @@ -138,7 +138,7 @@ public: } public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_address(void* __addr) _NOEXCEPT { coroutine_handle __tmp; __tmp.__handle_ = __addr; @@ -146,7 +146,7 @@ public: } // FIXME: Should from_address(nullptr) be allowed? - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_address(nullptr_t) _NOEXCEPT { return coroutine_handle(nullptr); } @@ -169,27 +169,27 @@ private: }; // 18.11.2.7 comparison operators: -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return __x.address() == __y.address(); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return !(__x == __y); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return less<void*>()(__x.address(), __y.address()); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return __y < __x; } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return !(__x > __y); } -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { return !(__x < __y); } @@ -202,8 +202,8 @@ public: // 18.11.2.1 construct/reset using coroutine_handle<>::coroutine_handle; #else - _LIBCPP_ALWAYS_INLINE coroutine_handle() _NOEXCEPT : _Base() {} - _LIBCPP_ALWAYS_INLINE coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {} + _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT : _Base() {} + _LIBCPP_INLINE_VISIBILITY coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {} #endif _LIBCPP_INLINE_VISIBILITY coroutine_handle& operator=(nullptr_t) _NOEXCEPT { @@ -213,12 +213,12 @@ public: _LIBCPP_INLINE_VISIBILITY _Promise& promise() const { - return *reinterpret_cast<_Promise*>( + return *static_cast<_Promise*>( __builtin_coro_promise(this->__handle_, __alignof(_Promise), false)); } public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_address(void* __addr) _NOEXCEPT { coroutine_handle __tmp; __tmp.__handle_ = __addr; @@ -229,7 +229,7 @@ public: // the deleted _Promise* overload doesn't make from_address(nullptr) // ambiguous. // FIXME: should from_address work with nullptr? - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_address(nullptr_t) _NOEXCEPT { return coroutine_handle(nullptr); } @@ -248,7 +248,7 @@ public: "pointers to the coroutine's promise type; use 'from_promise' instead"); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { typedef typename remove_cv<_Promise>::type _RawPromise; coroutine_handle __tmp; @@ -259,21 +259,61 @@ public: } }; +#if __has_builtin(__builtin_coro_noop) +struct noop_coroutine_promise {}; + +template <> +class _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> + : public coroutine_handle<> { + using _Base = coroutine_handle<>; + using _Promise = noop_coroutine_promise; +public: + + _LIBCPP_INLINE_VISIBILITY + _Promise& promise() const { + return *static_cast<_Promise*>( + __builtin_coro_promise(this->__handle_, __alignof(_Promise), false)); + } + + _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; } + _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; } + + _LIBCPP_CONSTEXPR_AFTER_CXX17 void operator()() const _NOEXCEPT {} + _LIBCPP_CONSTEXPR_AFTER_CXX17 void resume() const _NOEXCEPT {} + _LIBCPP_CONSTEXPR_AFTER_CXX17 void destroy() const _NOEXCEPT {} + +private: + _LIBCPP_INLINE_VISIBILITY + friend coroutine_handle<noop_coroutine_promise> noop_coroutine() _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT { + this->__handle_ = __builtin_coro_noop(); + } +}; + +using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; + +inline _LIBCPP_INLINE_VISIBILITY +noop_coroutine_handle noop_coroutine() _NOEXCEPT { + return noop_coroutine_handle(); +} +#endif // __has_builtin(__builtin_coro_noop) + struct _LIBCPP_TYPE_VIS suspend_never { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool await_ready() const _NOEXCEPT { return true; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void await_suspend(coroutine_handle<>) const _NOEXCEPT {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void await_resume() const _NOEXCEPT {} }; struct _LIBCPP_TYPE_VIS suspend_always { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool await_ready() const _NOEXCEPT { return false; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void await_suspend(coroutine_handle<>) const _NOEXCEPT {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void await_resume() const _NOEXCEPT {} }; diff --git a/include/experimental/dynarray b/include/experimental/dynarray index 16193317ad201..a60c87c3f970f 100644 --- a/include/experimental/dynarray +++ b/include/experimental/dynarray @@ -133,19 +133,20 @@ public: private: size_t __size_; value_type * __base_; - _LIBCPP_ALWAYS_INLINE dynarray () noexcept : __size_(0), __base_(nullptr) {} + _LIBCPP_INLINE_VISIBILITY dynarray () noexcept : __size_(0), __base_(nullptr) {} - static inline _LIBCPP_INLINE_VISIBILITY value_type* __allocate ( size_t count ) - { - if ( numeric_limits<size_t>::max() / sizeof (value_type) <= count ) + static inline _LIBCPP_INLINE_VISIBILITY + value_type* __allocate(size_t __count) { + if (numeric_limits<size_t>::max() / sizeof (value_type) <= __count) __throw_bad_array_length(); - return static_cast<value_type *> (_VSTD::__allocate (sizeof(value_type) * count)); + return static_cast<value_type *>( + _VSTD::__libcpp_allocate(sizeof(value_type) * __count, __alignof(value_type))); } - static inline _LIBCPP_INLINE_VISIBILITY void __deallocate_value( value_type* __ptr ) noexcept - { - _VSTD::__libcpp_deallocate (static_cast<void *> (__ptr)); + static inline _LIBCPP_INLINE_VISIBILITY + void __deallocate_value(value_type* __ptr ) noexcept { + _VSTD::__libcpp_deallocate(static_cast<void *>(__ptr), __alignof(value_type)); } public: diff --git a/include/experimental/filesystem b/include/experimental/filesystem index 674490f603819..28d8dcf4fc13c 100644 --- a/include/experimental/filesystem +++ b/include/experimental/filesystem @@ -16,24 +16,25 @@ class path; - void swap(path& lhs, path& rhs) _NOEXCEPT; - size_t hash_value(const path& p) _NOEXCEPT; + void swap(path& lhs, path& rhs) noexcept; + size_t hash_value(const path& p) noexcept; - bool operator==(const path& lhs, const path& rhs) _NOEXCEPT; - bool operator!=(const path& lhs, const path& rhs) _NOEXCEPT; - bool operator< (const path& lhs, const path& rhs) _NOEXCEPT; - bool operator<=(const path& lhs, const path& rhs) _NOEXCEPT; - bool operator> (const path& lhs, const path& rhs) _NOEXCEPT; - bool operator>=(const path& lhs, const path& rhs) _NOEXCEPT; + bool operator==(const path& lhs, const path& rhs) noexcept; + bool operator!=(const path& lhs, const path& rhs) noexcept; + bool operator< (const path& lhs, const path& rhs) noexcept; + bool operator<=(const path& lhs, const path& rhs) noexcept; + bool operator> (const path& lhs, const path& rhs) noexcept; + bool operator>=(const path& lhs, const path& rhs) noexcept; path operator/ (const path& lhs, const path& rhs); + // fs.path.io operators are friends of path. template <class charT, class traits> - basic_ostream<charT, traits>& + friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const path& p); template <class charT, class traits> - basic_istream<charT, traits>& + friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, path& p); template <class Source> @@ -67,6 +68,7 @@ enum class file_type; enum class perms; + enum class perm_options; enum class copy_options; enum class directory_options; @@ -74,11 +76,11 @@ // operational functions - path absolute(const path& p, const path& base=current_path()); + path absolute(const path& p); + path absolute(const path& p, error_code &ec); - path canonical(const path& p, const path& base = current_path()); + path canonical(const path& p); path canonical(const path& p, error_code& ec); - path canonical(const path& p, const path& base, error_code& ec); void copy(const path& from, const path& to); void copy(const path& from, const path& to, error_code& ec); @@ -87,2054 +89,169 @@ error_code& ec); bool copy_file(const path& from, const path& to); - bool copy_file(const path& from, const path& to, error_code& ec) _NOEXCEPT; + bool copy_file(const path& from, const path& to, error_code& ec); bool copy_file(const path& from, const path& to, copy_options option); bool copy_file(const path& from, const path& to, copy_options option, - error_code& ec) _NOEXCEPT; + error_code& ec); void copy_symlink(const path& existing_symlink, const path& new_symlink); void copy_symlink(const path& existing_symlink, const path& new_symlink, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; bool create_directories(const path& p); - bool create_directories(const path& p, error_code& ec) _NOEXCEPT; + bool create_directories(const path& p, error_code& ec); bool create_directory(const path& p); - bool create_directory(const path& p, error_code& ec) _NOEXCEPT; + bool create_directory(const path& p, error_code& ec) noexcept; bool create_directory(const path& p, const path& attributes); bool create_directory(const path& p, const path& attributes, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; void create_directory_symlink(const path& to, const path& new_symlink); void create_directory_symlink(const path& to, const path& new_symlink, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; void create_hard_link(const path& to, const path& new_hard_link); void create_hard_link(const path& to, const path& new_hard_link, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; void create_symlink(const path& to, const path& new_symlink); void create_symlink(const path& to, const path& new_symlink, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; path current_path(); path current_path(error_code& ec); void current_path(const path& p); - void current_path(const path& p, error_code& ec) _NOEXCEPT; + void current_path(const path& p, error_code& ec) noexcept; - bool exists(file_status s) _NOEXCEPT; + bool exists(file_status s) noexcept; bool exists(const path& p); - bool exists(const path& p, error_code& ec) _NOEXCEPT; + bool exists(const path& p, error_code& ec) noexcept; bool equivalent(const path& p1, const path& p2); - bool equivalent(const path& p1, const path& p2, error_code& ec) _NOEXCEPT; + bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; uintmax_t file_size(const path& p); - uintmax_t file_size(const path& p, error_code& ec) _NOEXCEPT; + uintmax_t file_size(const path& p, error_code& ec) noexcept; uintmax_t hard_link_count(const path& p); - uintmax_t hard_link_count(const path& p, error_code& ec) _NOEXCEPT; + uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; - bool is_block_file(file_status s) _NOEXCEPT; + bool is_block_file(file_status s) noexcept; bool is_block_file(const path& p); - bool is_block_file(const path& p, error_code& ec) _NOEXCEPT; + bool is_block_file(const path& p, error_code& ec) noexcept; - bool is_character_file(file_status s) _NOEXCEPT; + bool is_character_file(file_status s) noexcept; bool is_character_file(const path& p); - bool is_character_file(const path& p, error_code& ec) _NOEXCEPT; + bool is_character_file(const path& p, error_code& ec) noexcept; - bool is_directory(file_status s) _NOEXCEPT; + bool is_directory(file_status s) noexcept; bool is_directory(const path& p); - bool is_directory(const path& p, error_code& ec) _NOEXCEPT; + bool is_directory(const path& p, error_code& ec) noexcept; bool is_empty(const path& p); - bool is_empty(const path& p, error_code& ec) _NOEXCEPT; + bool is_empty(const path& p, error_code& ec) noexcept; - bool is_fifo(file_status s) _NOEXCEPT; + bool is_fifo(file_status s) noexcept; bool is_fifo(const path& p); - bool is_fifo(const path& p, error_code& ec) _NOEXCEPT; + bool is_fifo(const path& p, error_code& ec) noexcept; - bool is_other(file_status s) _NOEXCEPT; + bool is_other(file_status s) noexcept; bool is_other(const path& p); - bool is_other(const path& p, error_code& ec) _NOEXCEPT; + bool is_other(const path& p, error_code& ec) noexcept; - bool is_regular_file(file_status s) _NOEXCEPT; + bool is_regular_file(file_status s) noexcept; bool is_regular_file(const path& p); - bool is_regular_file(const path& p, error_code& ec) _NOEXCEPT; + bool is_regular_file(const path& p, error_code& ec) noexcept; - bool is_socket(file_status s) _NOEXCEPT; + bool is_socket(file_status s) noexcept; bool is_socket(const path& p); - bool is_socket(const path& p, error_code& ec) _NOEXCEPT; + bool is_socket(const path& p, error_code& ec) noexcept; - bool is_symlink(file_status s) _NOEXCEPT; + bool is_symlink(file_status s) noexcept; bool is_symlink(const path& p); - bool is_symlink(const path& p, error_code& ec) _NOEXCEPT; + bool is_symlink(const path& p, error_code& ec) noexcept; file_time_type last_write_time(const path& p); - file_time_type last_write_time(const path& p, error_code& ec) _NOEXCEPT; + file_time_type last_write_time(const path& p, error_code& ec) noexcept; void last_write_time(const path& p, file_time_type new_time); void last_write_time(const path& p, file_time_type new_time, - error_code& ec) _NOEXCEPT; + error_code& ec) noexcept; - void permissions(const path& p, perms prms); - void permissions(const path& p, perms prms, error_code& ec) _NOEXCEPT; + void permissions(const path& p, perms prms, + perm_options opts=perm_options::replace); + void permissions(const path& p, perms prms, error_code& ec) noexcept; + void permissions(const path& p, perms prms, perm_options opts, + error_code& ec); + + path proximate(const path& p, error_code& ec); + path proximate(const path& p, const path& base = current_path()); + path proximate(const path& p, const path& base, error_code &ec); path read_symlink(const path& p); path read_symlink(const path& p, error_code& ec); + path relative(const path& p, error_code& ec); + path relative(const path& p, const path& base=current_path()); + path relative(const path& p, const path& base, error_code& ec); + bool remove(const path& p); - bool remove(const path& p, error_code& ec) _NOEXCEPT; + bool remove(const path& p, error_code& ec) noexcept; uintmax_t remove_all(const path& p); - uintmax_t remove_all(const path& p, error_code& ec) _NOEXCEPT; + uintmax_t remove_all(const path& p, error_code& ec); void rename(const path& from, const path& to); - void rename(const path& from, const path& to, error_code& ec) _NOEXCEPT; + void rename(const path& from, const path& to, error_code& ec) noexcept; void resize_file(const path& p, uintmax_t size); - void resize_file(const path& p, uintmax_t size, error_code& ec) _NOEXCEPT; + void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept; space_info space(const path& p); - space_info space(const path& p, error_code& ec) _NOEXCEPT; + space_info space(const path& p, error_code& ec) noexcept; file_status status(const path& p); - file_status status(const path& p, error_code& ec) _NOEXCEPT; + file_status status(const path& p, error_code& ec) noexcept; - bool status_known(file_status s) _NOEXCEPT; + bool status_known(file_status s) noexcept; file_status symlink_status(const path& p); - file_status symlink_status(const path& p, error_code& ec) _NOEXCEPT; - - path system_complete(const path& p); - path system_complete(const path& p, error_code& ec); + file_status symlink_status(const path& p, error_code& ec) noexcept; path temp_directory_path(); path temp_directory_path(error_code& ec); + path weakly_canonical(path const& p); + path weakly_canonical(path const& p, error_code& ec); + + } } } } // namespaces std::experimental::filesystem::v1 */ #include <experimental/__config> -#include <cstddef> -#include <chrono> -#include <iterator> -#include <iosfwd> -#include <locale> -#include <memory> -#include <stack> -#include <string> -#include <system_error> -#include <utility> -#include <iomanip> // for quoted -#include <string_view> - -#include <__debug> +#include <filesystem> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +#ifndef _LIBCPP_CXX03_LANG + #define __cpp_lib_experimental_filesystem 201406 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM -typedef chrono::time_point<std::chrono::system_clock> file_time_type; - -struct _LIBCPP_TYPE_VIS space_info -{ - uintmax_t capacity; - uintmax_t free; - uintmax_t available; -}; - -enum class _LIBCPP_ENUM_VIS file_type : signed char -{ - none = 0, - not_found = -1, - regular = 1, - directory = 2, - symlink = 3, - block = 4, - character = 5, - fifo = 6, - socket = 7, - unknown = 8 -}; - -enum class _LIBCPP_ENUM_VIS perms : unsigned -{ - none = 0, - - owner_read = 0400, - owner_write = 0200, - owner_exec = 0100, - owner_all = 0700, - - group_read = 040, - group_write = 020, - group_exec = 010, - group_all = 070, - - others_read = 04, - others_write = 02, - others_exec = 01, - others_all = 07, - - all = 0777, - - set_uid = 04000, - set_gid = 02000, - sticky_bit = 01000, - mask = 07777, - unknown = 0xFFFF, - - add_perms = 0x10000, - remove_perms = 0x20000, - symlink_nofollow = 0x40000 -}; - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR perms operator&(perms _LHS, perms _RHS) -{ return static_cast<perms>(static_cast<unsigned>(_LHS) & static_cast<unsigned>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR perms operator|(perms _LHS, perms _RHS) -{ return static_cast<perms>(static_cast<unsigned>(_LHS) | static_cast<unsigned>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR perms operator^(perms _LHS, perms _RHS) -{ return static_cast<perms>(static_cast<unsigned>(_LHS) ^ static_cast<unsigned>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR perms operator~(perms _LHS) -{ return static_cast<perms>(~static_cast<unsigned>(_LHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline perms& operator&=(perms& _LHS, perms _RHS) -{ return _LHS = _LHS & _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline perms& operator|=(perms& _LHS, perms _RHS) -{ return _LHS = _LHS | _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline perms& operator^=(perms& _LHS, perms _RHS) -{ return _LHS = _LHS ^ _RHS; } - -enum class _LIBCPP_ENUM_VIS copy_options : unsigned short -{ - none = 0, - skip_existing = 1, - overwrite_existing = 2, - update_existing = 4, - recursive = 8, - copy_symlinks = 16, - skip_symlinks = 32, - directories_only = 64, - create_symlinks = 128, - create_hard_links = 256, - __in_recursive_copy = 512, -}; - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR copy_options operator&(copy_options _LHS, copy_options _RHS) -{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) & static_cast<unsigned short>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR copy_options operator|(copy_options _LHS, copy_options _RHS) -{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) | static_cast<unsigned short>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR copy_options operator^(copy_options _LHS, copy_options _RHS) -{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) ^ static_cast<unsigned short>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR copy_options operator~(copy_options _LHS) -{ return static_cast<copy_options>(~static_cast<unsigned short>(_LHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline copy_options& operator&=(copy_options& _LHS, copy_options _RHS) -{ return _LHS = _LHS & _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline copy_options& operator|=(copy_options& _LHS, copy_options _RHS) -{ return _LHS = _LHS | _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline copy_options& operator^=(copy_options& _LHS, copy_options _RHS) -{ return _LHS = _LHS ^ _RHS; } - - -enum class _LIBCPP_ENUM_VIS directory_options : unsigned char -{ - none = 0, - follow_directory_symlink = 1, - skip_permission_denied = 2 -}; - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR directory_options operator&(directory_options _LHS, directory_options _RHS) -{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) & static_cast<unsigned char>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR directory_options operator|(directory_options _LHS, directory_options _RHS) -{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) | static_cast<unsigned char>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR directory_options operator^(directory_options _LHS, directory_options _RHS) -{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) ^ static_cast<unsigned char>(_RHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline _LIBCPP_CONSTEXPR directory_options operator~(directory_options _LHS) -{ return static_cast<directory_options>(~static_cast<unsigned char>(_LHS)); } - -_LIBCPP_INLINE_VISIBILITY -inline directory_options& operator&=(directory_options& _LHS, directory_options _RHS) -{ return _LHS = _LHS & _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline directory_options& operator|=(directory_options& _LHS, directory_options _RHS) -{ return _LHS = _LHS | _RHS; } - -_LIBCPP_INLINE_VISIBILITY -inline directory_options& operator^=(directory_options& _LHS, directory_options _RHS) -{ return _LHS = _LHS ^ _RHS; } - - -class _LIBCPP_TYPE_VIS file_status -{ -public: - // constructors - _LIBCPP_INLINE_VISIBILITY - file_status() _NOEXCEPT : file_status(file_type::none) {} - _LIBCPP_INLINE_VISIBILITY - explicit file_status(file_type __ft, - perms __prms = perms::unknown) _NOEXCEPT - : __ft_(__ft), __prms_(__prms) - {} - - file_status(const file_status&) _NOEXCEPT = default; - file_status(file_status&&) _NOEXCEPT = default; - - _LIBCPP_INLINE_VISIBILITY - ~file_status() {} - - file_status& operator=(const file_status&) _NOEXCEPT = default; - file_status& operator=(file_status&&) _NOEXCEPT = default; - - // observers - _LIBCPP_ALWAYS_INLINE - file_type type() const _NOEXCEPT { - return __ft_; - } - - _LIBCPP_ALWAYS_INLINE - perms permissions() const _NOEXCEPT { - return __prms_; - } - - // modifiers - _LIBCPP_ALWAYS_INLINE - void type(file_type __ft) _NOEXCEPT { - __ft_ = __ft; - } - - _LIBCPP_ALWAYS_INLINE - void permissions(perms __p) _NOEXCEPT { - __prms_ = __p; - } -private: - file_type __ft_; - perms __prms_; -}; - -class _LIBCPP_TYPE_VIS directory_entry; - -template <class _Tp> struct __can_convert_char { - static const bool value = false; -}; -template <class _Tp> struct __can_convert_char<const _Tp> - : public __can_convert_char<_Tp> { -}; -template <> struct __can_convert_char<char> { - static const bool value = true; - using __char_type = char; -}; -template <> struct __can_convert_char<wchar_t> { - static const bool value = true; - using __char_type = wchar_t; -}; -template <> struct __can_convert_char<char16_t> { - static const bool value = true; - using __char_type = char16_t; -}; -template <> struct __can_convert_char<char32_t> { - static const bool value = true; - using __char_type = char32_t; -}; - -template <class _ECharT> -typename enable_if<__can_convert_char<_ECharT>::value, bool>::type -__is_separator(_ECharT __e) { - return __e == _ECharT('/'); -}; - -struct _NullSentinal {}; - -template <class _Tp> -using _Void = void; - -template <class _Tp, class = void> -struct __is_pathable_string : public false_type {}; - -template <class _ECharT, class _Traits, class _Alloc> -struct __is_pathable_string<basic_string<_ECharT, _Traits, _Alloc>, - _Void<typename __can_convert_char<_ECharT>::__char_type>> -: public __can_convert_char<_ECharT> -{ - using _Str = basic_string<_ECharT, _Traits, _Alloc>; - using _Base = __can_convert_char<_ECharT>; - static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); } - static _ECharT const* __range_end(_Str const& __s) { return __s.data() + __s.length(); } - static _ECharT __first_or_null(_Str const& __s) { - return __s.empty() ? _ECharT{} : __s[0]; - } -}; - - -template <class _ECharT, class _Traits> -struct __is_pathable_string<basic_string_view<_ECharT, _Traits>, - _Void<typename __can_convert_char<_ECharT>::__char_type>> -: public __can_convert_char<_ECharT> -{ - using _Str = basic_string_view<_ECharT, _Traits>; - using _Base = __can_convert_char<_ECharT>; - static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); } - static _ECharT const* __range_end(_Str const& __s) { return __s.data() + __s.length(); } - static _ECharT __first_or_null(_Str const& __s) { - return __s.empty() ? _ECharT{} : __s[0]; - } -}; - -template <class _Source, - class _DS = typename decay<_Source>::type, - class _UnqualPtrType = typename remove_const< - typename remove_pointer<_DS>::type>::type, - bool _IsCharPtr = is_pointer<_DS>::value && - __can_convert_char<_UnqualPtrType>::value - > -struct __is_pathable_char_array : false_type {}; - -template <class _Source, class _ECharT, class _UPtr> -struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true> - : __can_convert_char<typename remove_const<_ECharT>::type> -{ - using _Base = __can_convert_char<typename remove_const<_ECharT>::type>; - - 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{}; - _Iter __e = __b; - for (; *__e != __sentinal; ++__e) - ; - return __e; - } - - static _ECharT __first_or_null(const _ECharT* __b) { return *__b; } -}; - -template <class _Iter, bool _IsIt = __is_input_iterator<_Iter>::value, class = void> -struct __is_pathable_iter : false_type {}; - -template <class _Iter> -struct __is_pathable_iter<_Iter, true, - _Void<typename __can_convert_char<typename iterator_traits<_Iter>::value_type>::__char_type>> - : __can_convert_char<typename iterator_traits<_Iter>::value_type> -{ - using _ECharT = typename iterator_traits<_Iter>::value_type; - using _Base = __can_convert_char<_ECharT>; - - static _Iter __range_begin(_Iter __b) { return __b; } - static _NullSentinal __range_end(_Iter) { return _NullSentinal{}; } - - static _ECharT __first_or_null(_Iter __b) { return *__b; } -}; - -template <class _Tp, bool _IsStringT = __is_pathable_string<_Tp>::value, - bool _IsCharIterT = __is_pathable_char_array<_Tp>::value, - bool _IsIterT = !_IsCharIterT && __is_pathable_iter<_Tp>::value - > -struct __is_pathable : false_type { - static_assert(!_IsStringT && !_IsCharIterT && !_IsIterT, "Must all be false"); -}; - -template <class _Tp> -struct __is_pathable<_Tp, true, false, false> : __is_pathable_string<_Tp> {}; - - -template <class _Tp> -struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {}; - - -template <class _Tp> -struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {}; - - -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; - - static void __append_range(string& __dest, _ECharT const* __b, _ECharT const* __e) { - _Narrower()(back_inserter(__dest), __b, __e); - } - - template <class _Iter> - static void __append_range(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); - _Narrower()(back_inserter(__dest), __tmp.data(), - __tmp.data() + __tmp.length()); - } - - template <class _Iter> - static void __append_range(string& __dest, _Iter __b, _NullSentinal) { - static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload"); - const _ECharT __sentinal = _ECharT{}; - if (*__b == __sentinal) return; - basic_string<_ECharT> __tmp; - for (; *__b != __sentinal; ++__b) - __tmp.push_back(*__b); - _Narrower()(back_inserter(__dest), __tmp.data(), - __tmp.data() + __tmp.length()); - } - - template <class _Source> - static void __append_source(string& __dest, _Source const& __s) - { - using _Traits = __is_pathable<_Source>; - __append_range(__dest, _Traits::__range_begin(__s), _Traits::__range_end(__s)); - } -}; - -template <> -struct _PathCVT<char> { - - template <class _Iter> - static typename enable_if< - __is_exactly_input_iterator<_Iter>::value - >::type __append_range(string& __dest, _Iter __b, _Iter __e) { - for (; __b != __e; ++__b) - __dest.push_back(*__b); - } - - template <class _Iter> - static typename enable_if< - __is_forward_iterator<_Iter>::value - >::type __append_range(string& __dest, _Iter __b, _Iter __e) { - __dest.__append_forward_unsafe(__b, __e); - } - - template <class _Iter> - static void __append_range(string& __dest, _Iter __b, _NullSentinal) { - const char __sentinal = char{}; - for (; *__b != __sentinal; ++__b) - __dest.push_back(*__b); - } - - template <class _Source> - static void __append_source(string& __dest, _Source const& __s) - { - using _Traits = __is_pathable<_Source>; - __append_range(__dest, _Traits::__range_begin(__s), - _Traits::__range_end(__s)); - } -}; - - -class _LIBCPP_TYPE_VIS path -{ - template <class _SourceOrIter, class _Tp = path&> - using _EnableIfPathable = typename - enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type; - - template <class _Tp> - using _SourceChar = typename __is_pathable<_Tp>::__char_type; - - template <class _Tp> - using _SourceCVT = _PathCVT<_SourceChar<_Tp>>; - -public: - typedef char value_type; - typedef basic_string<value_type> string_type; - typedef _VSTD::string_view __string_view; - static _LIBCPP_CONSTEXPR value_type preferred_separator = '/'; - - // constructors and destructor - _LIBCPP_INLINE_VISIBILITY path() _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY path(const path& __p) : __pn_(__p.__pn_) {} - _LIBCPP_INLINE_VISIBILITY path(path&& __p) _NOEXCEPT : __pn_(_VSTD::move(__p.__pn_)) {} - - _LIBCPP_INLINE_VISIBILITY - path(string_type&& __s) _NOEXCEPT : __pn_(_VSTD::move(__s)) {} - - template < - class _Source, - class = _EnableIfPathable<_Source, void> - > - path(const _Source& __src) { - _SourceCVT<_Source>::__append_source(__pn_, __src); - } - - template <class _InputIt> - path(_InputIt __first, _InputIt __last) { - typedef typename iterator_traits<_InputIt>::value_type _ItVal; - _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); - } - - // TODO Implement locale conversions. - template <class _Source, - class = _EnableIfPathable<_Source, void> - > - path(const _Source& __src, const locale& __loc); - template <class _InputIt> - path(_InputIt __first, _InputIt _last, const locale& __loc); - - _LIBCPP_INLINE_VISIBILITY - ~path() = default; - - // assignments - _LIBCPP_INLINE_VISIBILITY - path& operator=(const path& __p) { - __pn_ = __p.__pn_; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& operator=(path&& __p) _NOEXCEPT { - __pn_ = _VSTD::move(__p.__pn_); - return *this; - } - - template <class = void> - _LIBCPP_INLINE_VISIBILITY - path& operator=(string_type&& __s) _NOEXCEPT { - __pn_ = _VSTD::move(__s); - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& assign(string_type&& __s) _NOEXCEPT { - __pn_ = _VSTD::move(__s); - return *this; - } - - template <class _Source> - _LIBCPP_INLINE_VISIBILITY - _EnableIfPathable<_Source> - operator=(const _Source& __src) - { return this->assign(__src); } - - - template <class _Source> - _EnableIfPathable<_Source> - assign(const _Source& __src) { - __pn_.clear(); - _SourceCVT<_Source>::__append_source(__pn_, __src); - return *this; - } - - template <class _InputIt> - path& assign(_InputIt __first, _InputIt __last) { - typedef typename iterator_traits<_InputIt>::value_type _ItVal; - __pn_.clear(); - _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); - return *this; - } - -private: - template <class _ECharT> - void __append_sep_if_needed(_ECharT __first_or_null) { - const _ECharT __null_val = {}; - bool __append_sep = !empty() && - !__is_separator(__pn_.back()) && - __first_or_null != __null_val && // non-empty - !__is_separator(__first_or_null); - if (__append_sep) - __pn_ += preferred_separator; - } - -public: - // appends - path& operator/=(const path& __p) { - _LIBCPP_ASSERT(!__p.has_root_name(), - "cannot append to a path with a root name"); - __append_sep_if_needed(__p.empty() ? char{} : __p.__pn_[0]); - __pn_ += __p.native(); - return *this; - } - - template <class _Source> - _LIBCPP_INLINE_VISIBILITY - _EnableIfPathable<_Source> - operator/=(const _Source& __src) { - return this->append(__src); - } - - template <class _Source> - _EnableIfPathable<_Source> - append(const _Source& __src) { - using _Traits = __is_pathable<_Source>; - using _CVT = _PathCVT<_SourceChar<_Source>>; - __append_sep_if_needed(_Traits::__first_or_null(__src)); - _CVT::__append_source(__pn_, __src); - return *this; - } - - template <class _InputIt> - path& append(_InputIt __first, _InputIt __last) { - typedef typename iterator_traits<_InputIt>::value_type _ItVal; - static_assert(__can_convert_char<_ItVal>::value, "Must convertible"); - using _CVT = _PathCVT<_ItVal>; - if (__first != __last) { - __append_sep_if_needed(*__first); - _CVT::__append_range(__pn_, __first, __last); - } - return *this; - } - - // concatenation - _LIBCPP_INLINE_VISIBILITY - path& operator+=(const path& __x) { - __pn_ += __x.__pn_; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& operator+=(const string_type& __x) { - __pn_ += __x; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& operator+=(__string_view __x) { - __pn_ += __x; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& operator+=(const value_type* __x) { - __pn_ += __x; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - path& operator+=(value_type __x) { - __pn_ += __x; - return *this; - } - - 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); - return *this; - } - - template <class _Source> - _EnableIfPathable<_Source> - operator+=(const _Source& __x) { - return this->concat(__x); - } - - template <class _Source> - _EnableIfPathable<_Source> - concat(const _Source& __x) { - _SourceCVT<_Source>::__append_source(__pn_, __x); - return *this; - } - - template <class _InputIt> - path& concat(_InputIt __first, _InputIt __last) { - typedef typename iterator_traits<_InputIt>::value_type _ItVal; - _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); - return *this; - } - - // modifiers - _LIBCPP_INLINE_VISIBILITY - void clear() _NOEXCEPT { - __pn_.clear(); - } - - path& make_preferred() { return *this; } - - _LIBCPP_INLINE_VISIBILITY - path& remove_filename() { - if (__pn_.size() == __root_path_raw().size()) - clear(); - else - __pn_ = __parent_path(); - return *this; - } - - path& replace_filename(const path& __replacement) { - remove_filename(); - return (*this /= __replacement); - } - - path& replace_extension(const path& __replacement = path()); - - _LIBCPP_INLINE_VISIBILITY - void swap(path& __rhs) _NOEXCEPT { - __pn_.swap(__rhs.__pn_); - } - - // native format observers - _LIBCPP_INLINE_VISIBILITY - const string_type& native() const _NOEXCEPT { - return __pn_; - } - - _LIBCPP_INLINE_VISIBILITY - const value_type* c_str() const _NOEXCEPT { return __pn_.c_str(); } - - _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; } - - template <class _ECharT, class _Traits = char_traits<_ECharT>, - class _Allocator = allocator<_ECharT> > - basic_string<_ECharT, _Traits, _Allocator> - string(const _Allocator& __a = _Allocator()) const { - using _CVT = __widen_from_utf8<sizeof(_ECharT)*__CHAR_BIT__>; - using _Str = basic_string<_ECharT, _Traits, _Allocator>; - _Str __s(__a); - __s.reserve(__pn_.size()); - _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size()); - return __s; - } - - _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; } - _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const { return string<wchar_t>(); } - _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; } - _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const { return string<char16_t>(); } - _LIBCPP_INLINE_VISIBILITY std::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 { - 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>(); } - -private: - int __compare(__string_view) const; - __string_view __root_name() const; - __string_view __root_directory() const; - __string_view __root_path_raw() const; - __string_view __relative_path() const; - __string_view __parent_path() const; - __string_view __filename() const; - __string_view __stem() const; - __string_view __extension() const; - -public: - // compare - _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const _NOEXCEPT { return __compare(__p.__pn_);} - _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const { return __compare(__s); } - _LIBCPP_INLINE_VISIBILITY int compare(__string_view __s) const { return __compare(__s); } - _LIBCPP_INLINE_VISIBILITY int compare(const value_type* __s) const { return __compare(__s); } - - // decomposition - _LIBCPP_INLINE_VISIBILITY path root_name() const { return string_type(__root_name()); } - _LIBCPP_INLINE_VISIBILITY path root_directory() const { return string_type(__root_directory()); } - _LIBCPP_INLINE_VISIBILITY path root_path() const { return root_name().append(string_type(__root_directory())); } - _LIBCPP_INLINE_VISIBILITY path relative_path() const { return string_type(__relative_path()); } - _LIBCPP_INLINE_VISIBILITY path parent_path() const { return string_type(__parent_path()); } - _LIBCPP_INLINE_VISIBILITY path filename() const { return string_type(__filename()); } - _LIBCPP_INLINE_VISIBILITY path stem() const { return string_type(__stem());} - _LIBCPP_INLINE_VISIBILITY path extension() const { return string_type(__extension()); } - - // query - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - bool empty() const _NOEXCEPT { return __pn_.empty(); } - - _LIBCPP_INLINE_VISIBILITY bool has_root_name() const { return !__root_name().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return !__root_directory().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_root_path() const { return !__root_path_raw().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_relative_path() const { return !__relative_path().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_parent_path() const { return !__parent_path().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_filename() const { return !__filename().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_stem() const { return !__stem().empty(); } - _LIBCPP_INLINE_VISIBILITY bool has_extension() const { return !__extension().empty(); } - - _LIBCPP_INLINE_VISIBILITY bool is_absolute() const { return has_root_directory(); } - _LIBCPP_INLINE_VISIBILITY bool is_relative() const { return !is_absolute(); } - - // iterators - class _LIBCPP_TYPE_VIS iterator; - typedef iterator const_iterator; - - iterator begin() const; - iterator end() const; - -private: - inline _LIBCPP_INLINE_VISIBILITY - path& __assign_view(__string_view const& __s) noexcept { __pn_ = string_type(__s); return *this; } - string_type __pn_; -}; - -inline _LIBCPP_ALWAYS_INLINE -void swap(path& __lhs, path& __rhs) _NOEXCEPT { - __lhs.swap(__rhs); -} - -_LIBCPP_FUNC_VIS -size_t hash_value(const path& __p) _NOEXCEPT; - -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) == 0; } - -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) != 0; } - -inline _LIBCPP_INLINE_VISIBILITY -bool operator<(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) < 0; } - -inline _LIBCPP_INLINE_VISIBILITY -bool operator<=(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) <= 0; } - -inline _LIBCPP_INLINE_VISIBILITY -bool operator>(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) > 0; } - -inline _LIBCPP_INLINE_VISIBILITY -bool operator>=(const path& __lhs, const path& __rhs) _NOEXCEPT -{ return __lhs.compare(__rhs) >= 0; } - -inline _LIBCPP_INLINE_VISIBILITY -path operator/(const path& __lhs, const path& __rhs) { - return path(__lhs) /= __rhs; -} - -template <class _CharT, class _Traits> -_LIBCPP_INLINE_VISIBILITY -typename enable_if<is_same<_CharT, char>::value && - is_same<_Traits, char_traits<char>>::value, - basic_ostream<_CharT, _Traits>& ->::type -operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) { - __os << std::__quoted(__p.native()); - return __os; -} - -template <class _CharT, class _Traits> -_LIBCPP_INLINE_VISIBILITY -typename enable_if<!is_same<_CharT, char>::value || - !is_same<_Traits, char_traits<char>>::value, - basic_ostream<_CharT, _Traits>& ->::type -operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) { - __os << std::__quoted(__p.string<_CharT, _Traits>()); - return __os; -} - -template <class _CharT, class _Traits> -_LIBCPP_INLINE_VISIBILITY -basic_istream<_CharT, _Traits>& -operator>>(basic_istream<_CharT, _Traits>& __is, path& __p) -{ - basic_string<_CharT, _Traits> __tmp; - __is >> __quoted(__tmp); - __p = __tmp; - return __is; -} - -template <class _Source> -_LIBCPP_INLINE_VISIBILITY -typename enable_if<__is_pathable<_Source>::value, path>::type -u8path(const _Source& __s){ - 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); -} - -template <class _InputIt> -_LIBCPP_INLINE_VISIBILITY -typename enable_if<__is_pathable<_InputIt>::value, path>::type -u8path(_InputIt __f, _InputIt __l) { - static_assert(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); -} - -class _LIBCPP_TYPE_VIS path::iterator -{ -public: - typedef bidirectional_iterator_tag iterator_category; - - typedef path value_type; - typedef std::ptrdiff_t difference_type; - typedef const path* pointer; - typedef const path& reference; - - typedef void __stashing_iterator_tag; // See reverse_iterator and __is_stashing_iterator -public: - _LIBCPP_INLINE_VISIBILITY - iterator() : __stashed_elem_(), __path_ptr_(nullptr), - __entry_(), __state_(__singular) {} - - iterator(const iterator&) = default; - ~iterator() = default; - - iterator& operator=(const iterator&) = default; - - _LIBCPP_INLINE_VISIBILITY - reference operator*() const { - return __stashed_elem_; - } - - _LIBCPP_INLINE_VISIBILITY - pointer operator->() const { - return &__stashed_elem_; - } - - _LIBCPP_INLINE_VISIBILITY - iterator& operator++() { - _LIBCPP_ASSERT(__state_ != __singular, - "attempting to increment a singular iterator"); - _LIBCPP_ASSERT(__state_ != __at_end, - "attempting to increment the end iterator"); - return __increment(); - } - - _LIBCPP_INLINE_VISIBILITY - iterator operator++(int) { - iterator __it(*this); - this->operator++(); - return __it; - } - - _LIBCPP_INLINE_VISIBILITY - iterator& operator--() { - _LIBCPP_ASSERT(__state_ != __singular, - "attempting to decrement a singular iterator"); - _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(), - "attempting to decrement the begin iterator"); - return __decrement(); - } - - _LIBCPP_INLINE_VISIBILITY - iterator operator--(int) { - iterator __it(*this); - this->operator--(); - return __it; - } - -private: - friend class path; - - static constexpr unsigned char __singular = 0; - static constexpr unsigned char __at_end = 6; - - inline _LIBCPP_INLINE_VISIBILITY - friend bool operator==(const iterator&, const iterator&); - - iterator& __increment(); - iterator& __decrement(); - - path __stashed_elem_; - const path* __path_ptr_; - path::__string_view __entry_; - unsigned char __state_; -}; - -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(const path::iterator& __lhs, const path::iterator& __rhs) { - return __lhs.__path_ptr_ == __rhs.__path_ptr_ && - __lhs.__entry_.data() == __rhs.__entry_.data(); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(const path::iterator& __lhs, const path::iterator& __rhs) { - return !(__lhs == __rhs); -} - -class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error -{ -public: - _LIBCPP_INLINE_VISIBILITY - filesystem_error(const string& __what, error_code __ec) - : system_error(__ec, __what), - __paths_(make_shared<_Storage>(path(), path())) - {} - - _LIBCPP_INLINE_VISIBILITY - filesystem_error(const string& __what, const path& __p1, error_code __ec) - : system_error(__ec, __what), - __paths_(make_shared<_Storage>(__p1, path())) - {} - - _LIBCPP_INLINE_VISIBILITY - filesystem_error(const string& __what, const path& __p1, const path& __p2, - error_code __ec) - : system_error(__ec, __what), - __paths_(make_shared<_Storage>(__p1, __p2)) - {} - - _LIBCPP_INLINE_VISIBILITY - const path& path1() const _NOEXCEPT { - return __paths_->first; - } - - _LIBCPP_INLINE_VISIBILITY - const path& path2() const _NOEXCEPT { - return __paths_->second; - } - - ~filesystem_error() override; // key function - - // TODO(ericwf): Create a custom error message. - //const char* what() const _NOEXCEPT; - -private: - typedef pair<path, path> _Storage; - shared_ptr<_Storage> __paths_; -}; - -template <class... _Args> -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE -#ifndef _LIBCPP_NO_EXCEPTIONS -void __throw_filesystem_error(_Args && ...__args) -{ - throw filesystem_error(std::forward<_Args>(__args)...); -} -#else -void __throw_filesystem_error(_Args&&...) -{ - _VSTD::abort(); -} -#endif +using namespace _VSTD_FS; +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM -// operational functions - -_LIBCPP_FUNC_VIS -path __canonical(const path&, const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -void __copy(const path& __from, const path& __to, copy_options __opt, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -bool __copy_file(const path& __from, const path& __to, copy_options __opt, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -bool __create_directories(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -bool __create_directory(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -bool __create_directory(const path& p, const path & attributes, - error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -void __create_directory_symlink(const path& __to, const path& __new_symlink, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -void __create_hard_link(const path& __to, const path& __new_hard_link, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -void __create_symlink(const path& __to, const path& __new_symlink, - error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -path __current_path(error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -void __current_path(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -bool __equivalent(const path&, const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -uintmax_t __file_size(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -uintmax_t __hard_link_count(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -bool __fs_is_empty(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -file_time_type __last_write_time(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -void __last_write_time(const path& p, file_time_type new_time, - error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -void __permissions(const path& p, perms prms, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -path __read_symlink(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -bool __remove(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -uintmax_t __remove_all(const path& p, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -void __rename(const path& from, const path& to, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -void __resize_file(const path& p, uintmax_t size, error_code *ec=nullptr); -_LIBCPP_FUNC_VIS -space_info __space(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -file_status __status(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -file_status __symlink_status(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -path __system_complete(const path&, error_code *__ec=nullptr); -_LIBCPP_FUNC_VIS -path __temp_directory_path(error_code *__ec=nullptr); - -inline _LIBCPP_INLINE_VISIBILITY -path current_path() { - return __current_path(); -} - -inline _LIBCPP_INLINE_VISIBILITY -path current_path(error_code& __ec) { - return __current_path(&__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void current_path(const path& __p) { - __current_path(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -void current_path(const path& __p, error_code& __ec) _NOEXCEPT { - __current_path(__p, &__ec); -} - -_LIBCPP_FUNC_VIS -path absolute(const path&, const path& __p2 = current_path()); - -inline _LIBCPP_INLINE_VISIBILITY -path canonical(const path& __p, const path& __base = current_path()) { - return __canonical(__p, __base); -} - -inline _LIBCPP_INLINE_VISIBILITY -path canonical(const path& __p, error_code& __ec) { - path __base = __current_path(&__ec); - if (__ec) return {}; - return __canonical(__p, __base, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -path canonical(const path& __p, const path& __base, error_code& __ec) { - return __canonical(__p, __base, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy(const path& __from, const path& __to) { - __copy(__from, __to, copy_options::none); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy(const path& __from, const path& __to, error_code& __ec) { - __copy(__from, __to, copy_options::none, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy(const path& __from, const path& __to, copy_options __opt) { - __copy(__from, __to, __opt); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy(const path& __from, const path& __to, - copy_options __opt, error_code& __ec) { - __copy(__from, __to, __opt, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool copy_file(const path& __from, const path& __to) { - return __copy_file(__from, __to, copy_options::none); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool copy_file(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT { - return __copy_file(__from, __to, copy_options::none, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool copy_file(const path& __from, const path& __to, copy_options __opt) { - return __copy_file(__from, __to, __opt); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool copy_file(const path& __from, const path& __to, - copy_options __opt, error_code& __ec) _NOEXCEPT { - return __copy_file(__from, __to, __opt, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy_symlink(const path& __existing, const path& __new) { - __copy_symlink(__existing, __new); -} - -inline _LIBCPP_INLINE_VISIBILITY -void copy_symlink(const path& __ext, const path& __new, error_code& __ec) _NOEXCEPT { - __copy_symlink(__ext, __new, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directories(const path& __p) { - return __create_directories(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directories(const path& __p, error_code& __ec) _NOEXCEPT { - return __create_directories(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directory(const path& __p) { - return __create_directory(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directory(const path& __p, error_code& __ec) _NOEXCEPT { - return __create_directory(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directory(const path& __p, const path& __attrs) { - return __create_directory(__p, __attrs); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool create_directory(const path& __p, const path& __attrs, error_code& __ec) _NOEXCEPT { - return __create_directory(__p, __attrs, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_directory_symlink(const path& __to, const path& __new) { - __create_directory_symlink(__to, __new); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_directory_symlink(const path& __to, const path& __new, - error_code& __ec) _NOEXCEPT { - __create_directory_symlink(__to, __new, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_hard_link(const path& __to, const path& __new) { - __create_hard_link(__to, __new); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_hard_link(const path& __to, const path& __new, error_code& __ec) _NOEXCEPT { - __create_hard_link(__to, __new, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_symlink(const path& __to, const path& __new) { - __create_symlink(__to, __new); -} - -inline _LIBCPP_INLINE_VISIBILITY -void create_symlink(const path& __to, const path& __new, error_code& __ec) _NOEXCEPT { - return __create_symlink(__to, __new, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool status_known(file_status __s) _NOEXCEPT { - return __s.type() != file_type::none; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool exists(file_status __s) _NOEXCEPT { - return status_known(__s) && __s.type() != file_type::not_found; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool exists(const path& __p) { - return exists(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool exists(const path& __p, error_code& __ec) _NOEXCEPT { - auto __s = __status(__p, &__ec); - if (status_known(__s)) __ec.clear(); - return exists(__s); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool equivalent(const path& __p1, const path& __p2) { - return __equivalent(__p1, __p2); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool equivalent(const path& __p1, const path& __p2, error_code& __ec) _NOEXCEPT { - return __equivalent(__p1, __p2, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t file_size(const path& __p) { - return __file_size(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t file_size(const path& __p, error_code& __ec) _NOEXCEPT { - return __file_size(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t hard_link_count(const path& __p) { - return __hard_link_count(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t hard_link_count(const path& __p, error_code& __ec) _NOEXCEPT { - return __hard_link_count(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_block_file(file_status __s) _NOEXCEPT { - return __s.type() == file_type::block; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_block_file(const path& __p) { - return is_block_file(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_block_file(const path& __p, error_code& __ec) _NOEXCEPT { - return is_block_file(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_character_file(file_status __s) _NOEXCEPT { - return __s.type() == file_type::character; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_character_file(const path& __p) { - return is_character_file(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_character_file(const path& __p, error_code& __ec) _NOEXCEPT { - return is_character_file(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_directory(file_status __s) _NOEXCEPT { - return __s.type() == file_type::directory; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_directory(const path& __p) { - return is_directory(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_directory(const path& __p, error_code& __ec) _NOEXCEPT { - return is_directory(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_empty(const path& __p) { - return __fs_is_empty(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_empty(const path& __p, error_code& __ec) { - return __fs_is_empty(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_fifo(file_status __s) _NOEXCEPT { - return __s.type() == file_type::fifo; -} -inline _LIBCPP_INLINE_VISIBILITY -bool is_fifo(const path& __p) { - return is_fifo(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_fifo(const path& __p, error_code& __ec) _NOEXCEPT { - return is_fifo(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_regular_file(file_status __s) _NOEXCEPT { - return __s.type() == file_type::regular; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_regular_file(const path& __p) { - return is_regular_file(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_regular_file(const path& __p, error_code& __ec) _NOEXCEPT { - return is_regular_file(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_socket(file_status __s) _NOEXCEPT { - return __s.type() == file_type::socket; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_socket(const path& __p) { - return is_socket(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_socket(const path& __p, error_code& __ec) _NOEXCEPT { - return is_socket(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_symlink(file_status __s) _NOEXCEPT { - return __s.type() == file_type::symlink; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_symlink(const path& __p) { - return is_symlink(__symlink_status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_symlink(const path& __p, error_code& __ec) _NOEXCEPT { - return is_symlink(__symlink_status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_other(file_status __s) _NOEXCEPT { - return exists(__s) - && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_other(const path& __p) { - return is_other(__status(__p)); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool is_other(const path& __p, error_code& __ec) _NOEXCEPT { - return is_other(__status(__p, &__ec)); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_time_type last_write_time(const path& __p) { - return __last_write_time(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_time_type last_write_time(const path& __p, error_code& __ec) _NOEXCEPT { - return __last_write_time(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void last_write_time(const path& __p, file_time_type __t) { - __last_write_time(__p, __t); -} - -inline _LIBCPP_INLINE_VISIBILITY -void last_write_time(const path& __p, file_time_type __t, error_code& __ec) _NOEXCEPT { - __last_write_time(__p, __t, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void permissions(const path& __p, perms __prms) { - __permissions(__p, __prms); -} - -inline _LIBCPP_INLINE_VISIBILITY -void permissions(const path& __p, perms __prms, error_code& __ec) { - __permissions(__p, __prms, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -path read_symlink(const path& __p) { - return __read_symlink(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -path read_symlink(const path& __p, error_code& __ec) { - return __read_symlink(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool remove(const path& __p) { - return __remove(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool remove(const path& __p, error_code& __ec) _NOEXCEPT { - return __remove(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t remove_all(const path& __p) { - return __remove_all(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -uintmax_t remove_all(const path& __p, error_code& __ec) _NOEXCEPT { - return __remove_all(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void rename(const path& __from, const path& __to) { - return __rename(__from, __to); -} - -inline _LIBCPP_INLINE_VISIBILITY -void rename(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT { - return __rename(__from, __to, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -void resize_file(const path& __p, uintmax_t __ns) { - return __resize_file(__p, __ns); -} - -inline _LIBCPP_INLINE_VISIBILITY -void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) _NOEXCEPT { - return __resize_file(__p, __ns, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -space_info space(const path& __p) { - return __space(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -space_info space(const path& __p, error_code& __ec) _NOEXCEPT { - return __space(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_status status(const path& __p) { - return __status(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_status status(const path& __p, error_code& __ec) _NOEXCEPT { - return __status(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_status symlink_status(const path& __p) { - return __symlink_status(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -file_status symlink_status(const path& __p, error_code& __ec) _NOEXCEPT { - return __symlink_status(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -path system_complete(const path& __p) { - return __system_complete(__p); -} - -inline _LIBCPP_INLINE_VISIBILITY -path system_complete(const path& __p, error_code& __ec) { - return __system_complete(__p, &__ec); -} - -inline _LIBCPP_INLINE_VISIBILITY -path temp_directory_path() { - return __temp_directory_path(); -} - -inline _LIBCPP_INLINE_VISIBILITY -path temp_directory_path(error_code& __ec) { - return __temp_directory_path(&__ec); -} - - -class directory_entry -{ - typedef _VSTD_FS::path _Path; - -public: - // constructors and destructors - directory_entry() _NOEXCEPT = default; - directory_entry(directory_entry const&) = default; - directory_entry(directory_entry&&) _NOEXCEPT = default; - - _LIBCPP_INLINE_VISIBILITY - explicit directory_entry(_Path const& __p) : __p_(__p) {} - - ~directory_entry() {} - - directory_entry& operator=(directory_entry const&) = default; - directory_entry& operator=(directory_entry&&) _NOEXCEPT = default; - - _LIBCPP_INLINE_VISIBILITY - void assign(_Path const& __p) { - __p_ = __p; - } - - _LIBCPP_INLINE_VISIBILITY - void replace_filename(_Path const& __p) { - __p_ = __p_.parent_path() / __p; - } - - _LIBCPP_INLINE_VISIBILITY - _Path const& path() const _NOEXCEPT { - return __p_; - } - - _LIBCPP_INLINE_VISIBILITY - operator const _Path&() const _NOEXCEPT { - return __p_; - } - - _LIBCPP_INLINE_VISIBILITY - file_status status() const { - return _VSTD_FS::status(__p_); - } - - _LIBCPP_INLINE_VISIBILITY - file_status status(error_code& __ec) const _NOEXCEPT { - return _VSTD_FS::status(__p_, __ec); - } - - _LIBCPP_INLINE_VISIBILITY - file_status symlink_status() const { - return _VSTD_FS::symlink_status(__p_); - } - - _LIBCPP_INLINE_VISIBILITY - file_status symlink_status(error_code& __ec) const _NOEXCEPT { - return _VSTD_FS::symlink_status(__p_, __ec); - } - - _LIBCPP_INLINE_VISIBILITY - bool operator< (directory_entry const& __rhs) const _NOEXCEPT { - return __p_ < __rhs.__p_; - } - - _LIBCPP_INLINE_VISIBILITY - bool operator==(directory_entry const& __rhs) const _NOEXCEPT { - return __p_ == __rhs.__p_; - } - - _LIBCPP_INLINE_VISIBILITY - bool operator!=(directory_entry const& __rhs) const _NOEXCEPT { - return __p_ != __rhs.__p_; - } - - _LIBCPP_INLINE_VISIBILITY - bool operator<=(directory_entry const& __rhs) const _NOEXCEPT { - return __p_ <= __rhs.__p_; - } - - _LIBCPP_INLINE_VISIBILITY - bool operator> (directory_entry const& __rhs) const _NOEXCEPT { - return __p_ > __rhs.__p_; - } - - _LIBCPP_INLINE_VISIBILITY - bool operator>=(directory_entry const& __rhs) const _NOEXCEPT { - return __p_ >= __rhs.__p_; - } -private: - _Path __p_; -}; - - -class directory_iterator; -class recursive_directory_iterator; -class __dir_stream; - -class __dir_element_proxy { -public: - - inline _LIBCPP_INLINE_VISIBILITY - directory_entry operator*() { return _VSTD::move(__elem_); } - -private: - friend class directory_iterator; - friend class recursive_directory_iterator; - explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {} - __dir_element_proxy(__dir_element_proxy&& __o) : __elem_(_VSTD::move(__o.__elem_)) {} - directory_entry __elem_; -}; - -class directory_iterator -{ -public: - typedef directory_entry value_type; - typedef ptrdiff_t difference_type; - typedef value_type const* pointer; - typedef value_type const& reference; - typedef input_iterator_tag iterator_category; - -public: - //ctor & dtor - directory_iterator() _NOEXCEPT - { } - - explicit directory_iterator(const path& __p) - : directory_iterator(__p, nullptr) - { } - - directory_iterator(const path& __p, directory_options __opts) - : directory_iterator(__p, nullptr, __opts) - { } - - directory_iterator(const path& __p, error_code& __ec) - : directory_iterator(__p, &__ec) - { } - - directory_iterator(const path& __p, directory_options __opts, - error_code& __ec) - : directory_iterator(__p, &__ec, __opts) - { } - - directory_iterator(const directory_iterator&) = default; - directory_iterator(directory_iterator&&) = default; - directory_iterator& operator=(const directory_iterator&) = default; - - directory_iterator& operator=(directory_iterator&& __o) _NOEXCEPT { - // non-default implementation provided to support self-move assign. - if (this != &__o) { - __imp_ = _VSTD::move(__o.__imp_); - } - return *this; - } - - ~directory_iterator() = default; - - const directory_entry& operator*() const { - _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced"); - return __dereference(); - } - - const directory_entry* operator->() const - { return &**this; } - - directory_iterator& operator++() - { return __increment(); } - - __dir_element_proxy operator++(int) { - __dir_element_proxy __p(**this); - __increment(); - return __p; - } - - directory_iterator& increment(error_code& __ec) - { return __increment(&__ec); } - -private: - inline _LIBCPP_INLINE_VISIBILITY - friend bool operator==(const directory_iterator& __lhs, - const directory_iterator& __rhs) _NOEXCEPT; - - // construct the dir_stream - _LIBCPP_FUNC_VIS - directory_iterator(const path&, error_code *, - directory_options = directory_options::none); - - _LIBCPP_FUNC_VIS - directory_iterator& __increment(error_code * __ec = nullptr); - - _LIBCPP_FUNC_VIS - const directory_entry& __dereference() const; - -private: - shared_ptr<__dir_stream> __imp_; -}; - - -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(const directory_iterator& __lhs, - const directory_iterator& __rhs) _NOEXCEPT { - return __lhs.__imp_ == __rhs.__imp_; -} - -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(const directory_iterator& __lhs, - const directory_iterator& __rhs) _NOEXCEPT { - return !(__lhs == __rhs); -} - -// enable directory_iterator range-based for statements -inline _LIBCPP_INLINE_VISIBILITY -directory_iterator begin(directory_iterator __iter) _NOEXCEPT { - return __iter; -} - -inline _LIBCPP_INLINE_VISIBILITY -directory_iterator end(const directory_iterator&) _NOEXCEPT { - return directory_iterator(); -} - -class recursive_directory_iterator { -public: - using value_type = directory_entry; - using difference_type = std::ptrdiff_t; - using pointer = directory_entry const *; - using reference = directory_entry const &; - using iterator_category = std::input_iterator_tag; - -public: - // constructors and destructor - _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator() _NOEXCEPT - : __rec_(false) - {} - - _LIBCPP_INLINE_VISIBILITY - explicit recursive_directory_iterator(const path& __p, - directory_options __xoptions = directory_options::none) - : recursive_directory_iterator(__p, __xoptions, nullptr) - { } - - _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator(const path& __p, - directory_options __xoptions, error_code& __ec) - : recursive_directory_iterator(__p, __xoptions, &__ec) - { } - - _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator(const path& __p, error_code& __ec) - : recursive_directory_iterator(__p, directory_options::none, &__ec) - { } - - recursive_directory_iterator(const recursive_directory_iterator&) = default; - recursive_directory_iterator(recursive_directory_iterator&&) = default; - - recursive_directory_iterator & - operator=(const recursive_directory_iterator&) = default; - - _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator & - operator=(recursive_directory_iterator&& __o) noexcept { - // non-default implementation provided to support self-move assign. - if (this != &__o) { - __imp_ = _VSTD::move(__o.__imp_); - __rec_ = __o.__rec_; - } - return *this; - } - - ~recursive_directory_iterator() = default; - - _LIBCPP_INLINE_VISIBILITY - const directory_entry& operator*() const - { return __dereference(); } - - _LIBCPP_INLINE_VISIBILITY - const directory_entry* operator->() const - { return &__dereference(); } - - recursive_directory_iterator& operator++() - { return __increment(); } - - _LIBCPP_INLINE_VISIBILITY - __dir_element_proxy operator++(int) { - __dir_element_proxy __p(**this); - __increment(); - return __p; - } - - _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator& increment(error_code& __ec) - { return __increment(&__ec); } - - _LIBCPP_FUNC_VIS directory_options options() const; - _LIBCPP_FUNC_VIS int depth() const; - - _LIBCPP_INLINE_VISIBILITY - void pop() { __pop(); } - - _LIBCPP_INLINE_VISIBILITY - void pop(error_code& __ec) - { __pop(&__ec); } - - _LIBCPP_INLINE_VISIBILITY - bool recursion_pending() const - { return __rec_; } - - _LIBCPP_INLINE_VISIBILITY - void disable_recursion_pending() - { __rec_ = false; } - -private: - recursive_directory_iterator(const path& __p, directory_options __opt, - error_code *__ec); - - _LIBCPP_FUNC_VIS - const directory_entry& __dereference() const; - - _LIBCPP_FUNC_VIS - bool __try_recursion(error_code* __ec); - - _LIBCPP_FUNC_VIS - void __advance(error_code* __ec=nullptr); - - _LIBCPP_FUNC_VIS - recursive_directory_iterator& __increment(error_code *__ec=nullptr); - - _LIBCPP_FUNC_VIS - void __pop(error_code* __ec=nullptr); - - inline _LIBCPP_INLINE_VISIBILITY - friend bool operator==(const recursive_directory_iterator&, - const recursive_directory_iterator&) _NOEXCEPT; - - struct __shared_imp; - shared_ptr<__shared_imp> __imp_; - bool __rec_; -}; // class recursive_directory_iterator - - -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(const recursive_directory_iterator& __lhs, - const recursive_directory_iterator& __rhs) _NOEXCEPT -{ - return __lhs.__imp_ == __rhs.__imp_; -} - -_LIBCPP_INLINE_VISIBILITY -inline bool operator!=(const recursive_directory_iterator& __lhs, - const recursive_directory_iterator& __rhs) _NOEXCEPT -{ - return !(__lhs == __rhs); -} -// enable recursive_directory_iterator range-based for statements -inline _LIBCPP_INLINE_VISIBILITY -recursive_directory_iterator begin(recursive_directory_iterator __iter) _NOEXCEPT { - return __iter; -} - -inline _LIBCPP_INLINE_VISIBILITY -recursive_directory_iterator end(const recursive_directory_iterator&) _NOEXCEPT { - return recursive_directory_iterator(); -} +#endif // !_LIBCPP_CXX03_LANG -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM +_LIBCPP_POP_MACROS #endif // _LIBCPP_EXPERIMENTAL_FILESYSTEM diff --git a/include/experimental/functional b/include/experimental/functional index a136cbb57c858..f63dfb07bb06e 100644 --- a/include/experimental/functional +++ b/include/experimental/functional @@ -241,8 +241,8 @@ public: operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { static_assert ( std::is_same< - typename std::decay<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, - typename std::decay<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type + typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, + typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type >::value, "Corpus and Pattern iterators must point to the same type" ); @@ -394,8 +394,8 @@ public: operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { static_assert ( std::is_same< - typename std::decay<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, - typename std::decay<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type + typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, + typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type >::value, "Corpus and Pattern iterators must point to the same type" ); diff --git a/include/experimental/memory_resource b/include/experimental/memory_resource index d101f3e08113e..221ce5b8eacc7 100644 --- a/include/experimental/memory_resource +++ b/include/experimental/memory_resource @@ -71,7 +71,7 @@ namespace pmr { #include <memory> #include <new> #include <stdexcept> -#include <tuple> +#include <__tuple> #include <type_traits> #include <utility> #include <cstddef> @@ -96,7 +96,7 @@ size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT } // 8.5, memory.resource -class _LIBCPP_TEMPLATE_VIS memory_resource +class _LIBCPP_TYPE_VIS memory_resource { static const size_t __max_align = alignof(max_align_t); @@ -206,7 +206,7 @@ public: void construct(_Tp* __p, _Ts &&... __args) { _VSTD_LFTS::__lfts_user_alloc_construct( - __p, resource(), _VSTD::forward<_Ts>(__args)... + __p, *this, _VSTD::forward<_Ts>(__args)... ); } @@ -218,14 +218,14 @@ public: ::new ((void*)__p) pair<_T1, _T2>(piecewise_construct , __transform_tuple( typename __lfts_uses_alloc_ctor< - _T1, memory_resource*, _Args1... + _T1, polymorphic_allocator&, _Args1... >::type() , _VSTD::move(__x) , typename __make_tuple_indices<sizeof...(_Args1)>::type{} ) , __transform_tuple( typename __lfts_uses_alloc_ctor< - _T2, memory_resource*, _Args2... + _T2, polymorphic_allocator&, _Args2... >::type() , _VSTD::move(__y) , typename __make_tuple_indices<sizeof...(_Args2)>::type{} @@ -289,23 +289,23 @@ private: template <class ..._Args, size_t ..._Idx> _LIBCPP_INLINE_VISIBILITY - tuple<allocator_arg_t const&, memory_resource*, _Args&&...> + tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...> __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) const + __tuple_indices<_Idx...>) { - using _Tup = tuple<allocator_arg_t const&, memory_resource*, _Args&&...>; - return _Tup(allocator_arg, resource(), + using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>; + return _Tup(allocator_arg, *this, _VSTD::get<_Idx>(_VSTD::move(__t))...); } template <class ..._Args, size_t ..._Idx> _LIBCPP_INLINE_VISIBILITY - tuple<_Args&&..., memory_resource*> + tuple<_Args&&..., polymorphic_allocator&> __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) const + __tuple_indices<_Idx...>) { - using _Tup = tuple<_Args&&..., memory_resource*>; - return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., resource()); + using _Tup = tuple<_Args&&..., polymorphic_allocator&>; + return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., *this); } _LIBCPP_INLINE_VISIBILITY diff --git a/include/experimental/numeric b/include/experimental/numeric index d784c08f0fe8a..14a664011b56c 100644 --- a/include/experimental/numeric +++ b/include/experimental/numeric @@ -8,112 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_NUMERIC -#define _LIBCPP_EXPERIMENTAL_NUMERIC -/* - experimental/numeric synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v2 { - - // 13.1.2, Greatest common divisor - template<class M, class N> - constexpr common_type_t<M,N> gcd(M m, N n); - - // 13.1.3, Least common multiple - template<class M, class N> - constexpr common_type_t<M,N> lcm(M m, N n); - -} // namespace fundamentals_v2 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <numeric> -#include <type_traits> // is_integral -#include <limits> // numeric_limits - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if _LIBCPP_STD_VER > 11 - -_LIBCPP_BEGIN_NAMESPACE_LFTS_V2 - -template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __abs; - -template <typename _Result, typename _Source> -struct __abs<_Result, _Source, true> { - _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; - } -}; - -template <typename _Result, typename _Source> -struct __abs<_Result, _Source, false> { - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - _Result operator()(_Source __t) const noexcept { return __t; } -}; - - -template<class _Tp> -_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN -inline _Tp __gcd(_Tp __m, _Tp __n) -{ - static_assert((!is_signed<_Tp>::value), "" ); - return __n == 0 ? __m : _VSTD_LFTS_V2::__gcd<_Tp>(__n, __m % __n); -} - - -template<class _Tp, class _Up> -_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY -common_type_t<_Tp,_Up> -gcd(_Tp __m, _Up __n) -{ - static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types"); - static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" ); - static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" ); - using _Rp = common_type_t<_Tp,_Up>; - using _Wp = make_unsigned_t<_Rp>; - return static_cast<_Rp>(_VSTD_LFTS_V2::__gcd( - static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)), - static_cast<_Wp>(__abs<_Rp, _Up>()(__n)))); -} - -template<class _Tp, class _Up> -_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY -common_type_t<_Tp,_Up> -lcm(_Tp __m, _Up __n) -{ - static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types"); - static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" ); - static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" ); - if (__m == 0 || __n == 0) - return 0; - - using _Rp = common_type_t<_Tp,_Up>; - _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD_LFTS_V2::gcd(__m, __n); - _Rp __val2 = __abs<_Rp, _Up>()(__n); - _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm"); - return __val1 * __val2; -} - -_LIBCPP_END_NAMESPACE_LFTS_V2 - -#endif /* _LIBCPP_STD_VER > 11 */ - -_LIBCPP_POP_MACROS - -#endif /* _LIBCPP_EXPERIMENTAL_NUMERIC */ +#error "<experimental/numeric> has been removed. Use <numeric> instead." diff --git a/include/experimental/optional b/include/experimental/optional index b251748fbf37f..d68cefdf6c1db 100644 --- a/include/experimental/optional +++ b/include/experimental/optional @@ -8,915 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_OPTIONAL -#define _LIBCPP_EXPERIMENTAL_OPTIONAL - -/* - optional synopsis - -// C++1y - -namespace std { namespace experimental { inline namespace fundamentals_v1 { - - // 5.3, optional for object types - template <class T> class optional; - - // 5.4, In-place construction - struct in_place_t{}; - constexpr in_place_t in_place{}; - - // 5.5, No-value state indicator - struct nullopt_t{see below}; - constexpr nullopt_t nullopt(unspecified); - - // 5.6, Class bad_optional_access - class bad_optional_access; - - // 5.7, Relational operators - template <class T> - constexpr bool operator==(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator!=(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator<(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator>(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator<=(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator>=(const optional<T>&, const optional<T>&); - - // 5.8, Comparison with nullopt - template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept; - template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept; - template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept; - template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept; - template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept; - template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept; - template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept; - - // 5.9, Comparison with T - template <class T> constexpr bool operator==(const optional<T>&, const T&); - template <class T> constexpr bool operator==(const T&, const optional<T>&); - template <class T> constexpr bool operator!=(const optional<T>&, const T&); - template <class T> constexpr bool operator!=(const T&, const optional<T>&); - template <class T> constexpr bool operator<(const optional<T>&, const T&); - template <class T> constexpr bool operator<(const T&, const optional<T>&); - template <class T> constexpr bool operator<=(const optional<T>&, const T&); - template <class T> constexpr bool operator<=(const T&, const optional<T>&); - template <class T> constexpr bool operator>(const optional<T>&, const T&); - template <class T> constexpr bool operator>(const T&, const optional<T>&); - template <class T> constexpr bool operator>=(const optional<T>&, const T&); - template <class T> constexpr bool operator>=(const T&, const optional<T>&); - - // 5.10, Specialized algorithms - template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below); - template <class T> constexpr optional<see below> make_optional(T&&); - - template <class T> - class optional - { - public: - typedef T value_type; - - // 5.3.1, Constructors - constexpr optional() noexcept; - constexpr optional(nullopt_t) noexcept; - optional(const optional&); - optional(optional&&) noexcept(see below); - constexpr optional(const T&); - constexpr optional(T&&); - template <class... Args> constexpr explicit optional(in_place_t, Args&&...); - template <class U, class... Args> - constexpr explicit optional(in_place_t, initializer_list<U>, Args&&...); - - // 5.3.2, Destructor - ~optional(); - - // 5.3.3, Assignment - optional& operator=(nullopt_t) noexcept; - optional& operator=(const optional&); - optional& operator=(optional&&) noexcept(see below); - template <class U> optional& operator=(U&&); - template <class... Args> void emplace(Args&&...); - template <class U, class... Args> - void emplace(initializer_list<U>, Args&&...); - - // 5.3.4, Swap - void swap(optional&) noexcept(see below); - - // 5.3.5, Observers - constexpr T const* operator ->() const; - constexpr T* operator ->(); - constexpr T const& operator *() const &; - constexpr T& operator *() &; - constexpr T&& operator *() &&; - constexpr const T&& operator *() const &&; - constexpr explicit operator bool() const noexcept; - constexpr T const& value() const &; - constexpr T& value() &; - constexpr T&& value() &&; - constexpr const T&& value() const &&; - template <class U> constexpr T value_or(U&&) const &; - template <class U> constexpr T value_or(U&&) &&; - - private: - T* val; // exposition only - }; - - } // namespace fundamentals_v1 - } // namespace experimental - - // 5.11, Hash support - template <class T> struct hash; - template <class T> struct hash<experimental::optional<T>>; - -} // namespace std - -*/ - -#include <experimental/__config> -#include <functional> -#include <stdexcept> -#if _LIBCPP_STD_VER > 11 -#include <initializer_list> -#include <type_traits> -#include <new> -#include <__functional_base> -#include <__debug> -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL -class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access - : public std::logic_error -{ -public: - bad_optional_access() : std::logic_error("Bad optional Access") {} - -// Get the key function ~bad_optional_access() into the dylib - virtual ~bad_optional_access() _NOEXCEPT; -}; - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL - - -#if _LIBCPP_STD_VER > 11 - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -struct in_place_t {}; -constexpr in_place_t in_place{}; - -struct nullopt_t -{ - explicit constexpr nullopt_t(int) noexcept {} -}; - -constexpr nullopt_t nullopt{0}; - -template <class _Tp, bool = is_trivially_destructible<_Tp>::value> -class __optional_storage -{ -protected: - typedef _Tp value_type; - union - { - char __null_state_; - value_type __val_; - }; - bool __engaged_ = false; - - _LIBCPP_INLINE_VISIBILITY - ~__optional_storage() - { - if (__engaged_) - __val_.~value_type(); - } - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage() noexcept - : __null_state_('\0') {} - - _LIBCPP_INLINE_VISIBILITY - __optional_storage(const __optional_storage& __x) - : __engaged_(__x.__engaged_) - { - if (__engaged_) - ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_); - } - - _LIBCPP_INLINE_VISIBILITY - __optional_storage(__optional_storage&& __x) - noexcept(is_nothrow_move_constructible<value_type>::value) - : __engaged_(__x.__engaged_) - { - if (__engaged_) - ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_)); - } - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage(const value_type& __v) - : __val_(__v), - __engaged_(true) {} - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage(value_type&& __v) - : __val_(_VSTD::move(__v)), - __engaged_(true) {} - - template <class... _Args> - _LIBCPP_INLINE_VISIBILITY - constexpr - explicit __optional_storage(in_place_t, _Args&&... __args) - : __val_(_VSTD::forward<_Args>(__args)...), - __engaged_(true) {} -}; - -template <class _Tp> -class __optional_storage<_Tp, true> -{ -protected: - typedef _Tp value_type; - union - { - char __null_state_; - value_type __val_; - }; - bool __engaged_ = false; - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage() noexcept - : __null_state_('\0') {} - - _LIBCPP_INLINE_VISIBILITY - __optional_storage(const __optional_storage& __x) - : __engaged_(__x.__engaged_) - { - if (__engaged_) - ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_); - } - - _LIBCPP_INLINE_VISIBILITY - __optional_storage(__optional_storage&& __x) - noexcept(is_nothrow_move_constructible<value_type>::value) - : __engaged_(__x.__engaged_) - { - if (__engaged_) - ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_)); - } - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage(const value_type& __v) - : __val_(__v), - __engaged_(true) {} - - _LIBCPP_INLINE_VISIBILITY - constexpr __optional_storage(value_type&& __v) - : __val_(_VSTD::move(__v)), - __engaged_(true) {} - - template <class... _Args> - _LIBCPP_INLINE_VISIBILITY - constexpr - explicit __optional_storage(in_place_t, _Args&&... __args) - : __val_(_VSTD::forward<_Args>(__args)...), - __engaged_(true) {} -}; - -template <class _Tp> -class optional - : private __optional_storage<_Tp> -{ - typedef __optional_storage<_Tp> __base; -public: - typedef _Tp value_type; - - static_assert(!is_reference<value_type>::value, - "Instantiation of optional with a reference type is ill-formed."); - static_assert(!is_same<typename remove_cv<value_type>::type, in_place_t>::value, - "Instantiation of optional with a in_place_t type is ill-formed."); - static_assert(!is_same<typename remove_cv<value_type>::type, nullopt_t>::value, - "Instantiation of optional with a nullopt_t type is ill-formed."); - static_assert(is_object<value_type>::value, - "Instantiation of optional with a non-object type is undefined behavior."); - static_assert(is_nothrow_destructible<value_type>::value, - "Instantiation of optional with an object type that is not noexcept destructible is undefined behavior."); - - _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {} - _LIBCPP_INLINE_VISIBILITY optional(const optional&) = default; - _LIBCPP_INLINE_VISIBILITY optional(optional&&) = default; - _LIBCPP_INLINE_VISIBILITY ~optional() = default; - _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {} - _LIBCPP_INLINE_VISIBILITY constexpr optional(const value_type& __v) - : __base(__v) {} - _LIBCPP_INLINE_VISIBILITY constexpr optional(value_type&& __v) - : __base(_VSTD::move(__v)) {} - - template <class... _Args, - class = typename enable_if - < - is_constructible<value_type, _Args...>::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - constexpr - explicit optional(in_place_t, _Args&&... __args) - : __base(in_place, _VSTD::forward<_Args>(__args)...) {} - - template <class _Up, class... _Args, - class = typename enable_if - < - is_constructible<value_type, initializer_list<_Up>&, _Args...>::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - constexpr - explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args) - : __base(in_place, __il, _VSTD::forward<_Args>(__args)...) {} - - _LIBCPP_INLINE_VISIBILITY - optional& operator=(nullopt_t) noexcept - { - if (this->__engaged_) - { - this->__val_.~value_type(); - this->__engaged_ = false; - } - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - optional& - operator=(const optional& __opt) - { - if (this->__engaged_ == __opt.__engaged_) - { - if (this->__engaged_) - this->__val_ = __opt.__val_; - } - else - { - if (this->__engaged_) - this->__val_.~value_type(); - else - ::new((void*)_VSTD::addressof(this->__val_)) value_type(__opt.__val_); - this->__engaged_ = __opt.__engaged_; - } - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - optional& - operator=(optional&& __opt) - noexcept(is_nothrow_move_assignable<value_type>::value && - is_nothrow_move_constructible<value_type>::value) - { - if (this->__engaged_ == __opt.__engaged_) - { - if (this->__engaged_) - this->__val_ = _VSTD::move(__opt.__val_); - } - else - { - if (this->__engaged_) - this->__val_.~value_type(); - else - ::new((void*)_VSTD::addressof(this->__val_)) - value_type(_VSTD::move(__opt.__val_)); - this->__engaged_ = __opt.__engaged_; - } - return *this; - } - - template <class _Up, - class = typename enable_if - < - is_same<typename remove_reference<_Up>::type, value_type>::value && - is_constructible<value_type, _Up>::value && - is_assignable<value_type&, _Up>::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - optional& - operator=(_Up&& __v) - { - if (this->__engaged_) - this->__val_ = _VSTD::forward<_Up>(__v); - else - { - ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Up>(__v)); - this->__engaged_ = true; - } - return *this; - } - - template <class... _Args, - class = typename enable_if - < - is_constructible<value_type, _Args...>::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - void - emplace(_Args&&... __args) - { - *this = nullopt; - ::new((void*)_VSTD::addressof(this->__val_)) - value_type(_VSTD::forward<_Args>(__args)...); - this->__engaged_ = true; - } - - template <class _Up, class... _Args, - class = typename enable_if - < - is_constructible<value_type, initializer_list<_Up>&, _Args...>::value - >::type - > - _LIBCPP_INLINE_VISIBILITY - void - emplace(initializer_list<_Up> __il, _Args&&... __args) - { - *this = nullopt; - ::new((void*)_VSTD::addressof(this->__val_)) - value_type(__il, _VSTD::forward<_Args>(__args)...); - this->__engaged_ = true; - } - - _LIBCPP_INLINE_VISIBILITY - void - swap(optional& __opt) - noexcept(is_nothrow_move_constructible<value_type>::value && - __is_nothrow_swappable<value_type>::value) - { - using _VSTD::swap; - if (this->__engaged_ == __opt.__engaged_) - { - if (this->__engaged_) - swap(this->__val_, __opt.__val_); - } - else - { - if (this->__engaged_) - { - ::new((void*)_VSTD::addressof(__opt.__val_)) - value_type(_VSTD::move(this->__val_)); - this->__val_.~value_type(); - } - else - { - ::new((void*)_VSTD::addressof(this->__val_)) - value_type(_VSTD::move(__opt.__val_)); - __opt.__val_.~value_type(); - } - swap(this->__engaged_, __opt.__engaged_); - } - } - - _LIBCPP_INLINE_VISIBILITY - constexpr - value_type const* - operator->() const - { - _LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value"); -#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF - return __builtin_addressof(this->__val_); -#else - return __operator_arrow(__has_operator_addressof<value_type>{}); -#endif - } - - _LIBCPP_INLINE_VISIBILITY - value_type* - operator->() - { - _LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value"); - return _VSTD::addressof(this->__val_); - } - - _LIBCPP_INLINE_VISIBILITY - constexpr - const value_type& - operator*() const - { - _LIBCPP_ASSERT(this->__engaged_, "optional operator* called for disengaged value"); - return this->__val_; - } - - _LIBCPP_INLINE_VISIBILITY - value_type& - operator*() - { - _LIBCPP_ASSERT(this->__engaged_, "optional operator* called for disengaged value"); - return this->__val_; - } - - _LIBCPP_INLINE_VISIBILITY - constexpr explicit operator bool() const noexcept {return this->__engaged_;} - - _LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY -#ifndef _LIBCPP_NO_EXCEPTIONS -_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -#endif - constexpr void __throw_bad_optional_access() const - { -#ifndef _LIBCPP_NO_EXCEPTIONS - throw bad_optional_access(); -#else - _VSTD::abort(); -#endif - } - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS - constexpr value_type const& value() const - { - if (!this->__engaged_) - __throw_bad_optional_access(); - return this->__val_; - } - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS - value_type& value() - { - if (!this->__engaged_) - __throw_bad_optional_access(); - return this->__val_; - } - - template <class _Up> - _LIBCPP_INLINE_VISIBILITY - constexpr value_type value_or(_Up&& __v) const& - { - static_assert(is_copy_constructible<value_type>::value, - "optional<T>::value_or: T must be copy constructible"); - static_assert(is_convertible<_Up, value_type>::value, - "optional<T>::value_or: U must be convertible to T"); - return this->__engaged_ ? this->__val_ : - static_cast<value_type>(_VSTD::forward<_Up>(__v)); - } - - template <class _Up> - _LIBCPP_INLINE_VISIBILITY - value_type value_or(_Up&& __v) && - { - static_assert(is_move_constructible<value_type>::value, - "optional<T>::value_or: T must be move constructible"); - static_assert(is_convertible<_Up, value_type>::value, - "optional<T>::value_or: U must be convertible to T"); - return this->__engaged_ ? _VSTD::move(this->__val_) : - static_cast<value_type>(_VSTD::forward<_Up>(__v)); - } - -private: - _LIBCPP_INLINE_VISIBILITY - value_type const* - __operator_arrow(true_type) const - { - return _VSTD::addressof(this->__val_); - } - - _LIBCPP_INLINE_VISIBILITY - constexpr - value_type const* - __operator_arrow(false_type) const - { - return &this->__val_; - } -}; - -// Comparisons between optionals -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator==(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - if (static_cast<bool>(__x) != static_cast<bool>(__y)) - return false; - if (!static_cast<bool>(__x)) - return true; - return *__x == *__y; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator!=(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - return !(__x == __y); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - if (!static_cast<bool>(__y)) - return false; - if (!static_cast<bool>(__x)) - return true; - return *__x < *__y; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - return __y < __x; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<=(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - return !(__y < __x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>=(const optional<_Tp>& __x, const optional<_Tp>& __y) -{ - return !(__x < __y); -} - - -// Comparisons with nullopt -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator==(const optional<_Tp>& __x, nullopt_t) noexcept -{ - return !static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator==(nullopt_t, const optional<_Tp>& __x) noexcept -{ - return !static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator!=(const optional<_Tp>& __x, nullopt_t) noexcept -{ - return static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator!=(nullopt_t, const optional<_Tp>& __x) noexcept -{ - return static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<(const optional<_Tp>&, nullopt_t) noexcept -{ - return false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<(nullopt_t, const optional<_Tp>& __x) noexcept -{ - return static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<=(const optional<_Tp>& __x, nullopt_t) noexcept -{ - return !static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<=(nullopt_t, const optional<_Tp>&) noexcept -{ - return true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>(const optional<_Tp>& __x, nullopt_t) noexcept -{ - return static_cast<bool>(__x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>(nullopt_t, const optional<_Tp>&) noexcept -{ - return false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>=(const optional<_Tp>&, nullopt_t) noexcept -{ - return true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>=(nullopt_t, const optional<_Tp>& __x) noexcept -{ - return !static_cast<bool>(__x); -} - -// Comparisons with T -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator==(const optional<_Tp>& __x, const _Tp& __v) -{ - return static_cast<bool>(__x) ? *__x == __v : false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator==(const _Tp& __v, const optional<_Tp>& __x) -{ - return static_cast<bool>(__x) ? *__x == __v : false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator!=(const optional<_Tp>& __x, const _Tp& __v) -{ - return static_cast<bool>(__x) ? !(*__x == __v) : true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator!=(const _Tp& __v, const optional<_Tp>& __x) -{ - return static_cast<bool>(__x) ? !(*__x == __v) : true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<(const optional<_Tp>& __x, const _Tp& __v) -{ - return static_cast<bool>(__x) ? less<_Tp>{}(*__x, __v) : true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<(const _Tp& __v, const optional<_Tp>& __x) -{ - return static_cast<bool>(__x) ? less<_Tp>{}(__v, *__x) : false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<=(const optional<_Tp>& __x, const _Tp& __v) -{ - return !(__x > __v); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator<=(const _Tp& __v, const optional<_Tp>& __x) -{ - return !(__v > __x); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>(const optional<_Tp>& __x, const _Tp& __v) -{ - return static_cast<bool>(__x) ? __v < __x : false; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>(const _Tp& __v, const optional<_Tp>& __x) -{ - return static_cast<bool>(__x) ? __x < __v : true; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>=(const optional<_Tp>& __x, const _Tp& __v) -{ - return !(__x < __v); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -bool -operator>=(const _Tp& __v, const optional<_Tp>& __x) -{ - return !(__v < __x); -} - - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y))) -{ - __x.swap(__y); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -constexpr -optional<typename decay<_Tp>::type> -make_optional(_Tp&& __v) -{ - return optional<typename decay<_Tp>::type>(_VSTD::forward<_Tp>(__v)); -} - -_LIBCPP_END_NAMESPACE_LFTS - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS hash<std::experimental::optional<_Tp> > -{ - typedef std::experimental::optional<_Tp> argument_type; - typedef size_t result_type; - - _LIBCPP_INLINE_VISIBILITY - result_type operator()(const argument_type& __opt) const _NOEXCEPT - { - return static_cast<bool>(__opt) ? hash<_Tp>()(*__opt) : 0; - } -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER > 11 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP_EXPERIMENTAL_OPTIONAL +#error "<experimental/optional> has been removed. Use <optional> instead." diff --git a/include/experimental/propagate_const b/include/experimental/propagate_const index e7f7e9fc68314..188548596b849 100644 --- a/include/experimental/propagate_const +++ b/include/experimental/propagate_const @@ -463,8 +463,7 @@ template <class _Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - using _VSTD::swap; - swap(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); + __pc1.swap(__pc2); } template <class _Tp> diff --git a/include/experimental/ratio b/include/experimental/ratio index 757f24e086149..9c2bf2e4624e5 100644 --- a/include/experimental/ratio +++ b/include/experimental/ratio @@ -8,70 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_RATIO -#define _LIBCPP_EXPERIMENTAL_RATIO - -/** - experimental/ratio synopsis - C++1y -#include <ratio> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - // See C++14 20.11.5, ratio comparison - template <class R1, class R2> constexpr bool ratio_equal_v - = ratio_equal<R1, R2>::value; - template <class R1, class R2> constexpr bool ratio_not_equal_v - = ratio_not_equal<R1, R2>::value; - template <class R1, class R2> constexpr bool ratio_less_v - = ratio_less<R1, R2>::value; - template <class R1, class R2> constexpr bool ratio_less_equal_v - = ratio_less_equal<R1, R2>::value; - template <class R1, class R2> constexpr bool ratio_greater_v - = ratio_greater<R1, R2>::value; - template <class R1, class R2> constexpr bool ratio_greater_equal_v - = ratio_greater_equal<R1, R2>::value; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - -*/ - -#include <experimental/__config> - -#if _LIBCPP_STD_VER > 11 - -#include <ratio> - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v - = ratio_equal<_R1, _R2>::value; - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v - = ratio_not_equal<_R1, _R2>::value; - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v - = ratio_less<_R1, _R2>::value; - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v - = ratio_less_equal<_R1, _R2>::value; - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v - = ratio_greater<_R1, _R2>::value; - -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v - = ratio_greater_equal<_R1, _R2>::value; - -#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */ - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_STD_VER > 11 */ - -#endif // _LIBCPP_EXPERIMENTAL_RATIO +#error "<experimental/ratio> has been removed. Use <ratio> instead." diff --git a/include/experimental/simd b/include/experimental/simd new file mode 100644 index 0000000000000..4876ccb82d207 --- /dev/null +++ b/include/experimental/simd @@ -0,0 +1,1285 @@ +// -*- C++ -*- +//===------------------------------- simd ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP_EXPERIMENTAL_SIMD +#define _LIBCPP_EXPERIMENTAL_SIMD + +/* + experimental/simd synopsis + +namespace std::experimental { + +inline namespace parallelism_v2 { + +namespace simd_abi { + +struct scalar {}; +template <int N> struct fixed_size {}; +template <typename T> inline constexpr int max_fixed_size = implementation-defined; +template <typename T> using compatible = implementation-defined; +template <typename T> using native = implementation-defined; + +} // simd_abi + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> struct overaligned_tag {}; +inline constexpr element_aligned_tag element_aligned{}; +inline constexpr vector_aligned_tag vector_aligned{}; +template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; + +// traits [simd.traits] +template <class T> struct is_abi_tag; +template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; + +template <class T> struct is_simd; +template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; + +template <class T> struct is_simd_mask; +template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; + +template <class T> struct is_simd_flag_type; +template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; + +template <class T, size_t N> struct abi_for_size { using type = see below; }; +template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; + +template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; +template <class T, class Abi = simd_abi::compatible<T>> +inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; + +template <class T, class U = typename T::value_type> struct memory_alignment; +template <class T, class U = typename T::value_type> +inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; + +// class template simd [simd.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd; +template <class T> using native_simd = simd<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; + +// class template simd_mask [simd.mask.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; +template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; + +// casts [simd.casts] +template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); +template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); + +template <class T, class Abi> +fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; +template <class T, class Abi> +fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; +template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> +native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; +template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; + +template <size_t... Sizes, class T, class Abi> +tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); +template <size_t... Sizes, class T, class Abi> +tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd<typename V::value_type, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd_mask<typename V::value_type, Abi>&); + +template <class T, class... Abis> +simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); +template <class T, class... Abis> +simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); + +// reductions [simd.mask.reductions] +template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); +template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); + +bool all_of(see below) noexcept; +bool any_of(see below) noexcept; +bool none_of(see below) noexcept; +bool some_of(see below) noexcept; +int popcount(see below) noexcept; +int find_first_set(see below) noexcept; +int find_last_set(see below) noexcept; + +// masked assignment [simd.whereexpr] +template <class M, class T> class const_where_expression; +template <class M, class T> class where_expression; + +// masked assignment [simd.mask.where] +template <class T> struct nodeduce { using type = T; }; // exposition only + +template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; + +template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; + +template <class T> +const_where_expression<bool, const T> where(see below k, const T& d) noexcept; + +// reductions [simd.reductions] +template <class T, class Abi, class BinaryOperation = std::plus<>> +T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); + +template <class M, class V, class BinaryOperation> +typename V::value_type reduce(const const_where_expression<M, V>& x, +typename V::value_type neutral_element, BinaryOperation binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); + +template <class T, class Abi> T hmin(const simd<T, Abi>&); +template <class M, class V> T hmin(const const_where_expression<M, V>&); +template <class T, class Abi> T hmax(const simd<T, Abi>&); +template <class M, class V> T hmax(const const_where_expression<M, V>&); + +// algorithms [simd.alg] +template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); + +// [simd.whereexpr] +template <class M, class T> +class const_where_expression { + const M& mask; // exposition only + T& data; // exposition only +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + remove_const_t<T> operator-() const &&; + template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; +}; + +template <class M, class T> +class where_expression : public const_where_expression<M, T> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class U> void operator=(U&& x); + template <class U> void operator+=(U&& x); + template <class U> void operator-=(U&& x); + template <class U> void operator*=(U&& x); + template <class U> void operator/=(U&& x); + template <class U> void operator%=(U&& x); + template <class U> void operator&=(U&& x); + template <class U> void operator|=(U&& x); + template <class U> void operator^=(U&& x); + template <class U> void operator<<=(U&& x); + template <class U> void operator>>=(U&& x); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class U, class Flags> void copy_from(const U* mem, Flags); +}; + +// [simd.class] +template <class T, class Abi> class simd { +public: + using value_type = T; + using reference = see below; + using mask_type = simd_mask<T, Abi>; + + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd() = default; + + // implicit type conversion constructor + template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); + + // implicit broadcast constructor (see below for constraints) + template <class U> simd(U&& value); + + // generator constructor (see below for constraints) + template <class G> explicit simd(G&& gen); + + // load constructor + template <class U, class Flags> simd(const U* mem, Flags f); + + // loads [simd.load] + template <class U, class Flags> void copy_from(const U* mem, Flags f); + + // stores [simd.store] + template <class U, class Flags> void copy_to(U* mem, Flags f) const; + + // scalar access [simd.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; // see below + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+ (const simd&, const simd&); + friend simd operator- (const simd&, const simd&); + friend simd operator* (const simd&, const simd&); + friend simd operator/ (const simd&, const simd&); + friend simd operator% (const simd&, const simd&); + friend simd operator& (const simd&, const simd&); + friend simd operator| (const simd&, const simd&); + friend simd operator^ (const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+= (simd&, const simd&); + friend simd& operator-= (simd&, const simd&); + friend simd& operator*= (simd&, const simd&); + friend simd& operator/= (simd&, const simd&); + friend simd& operator%= (simd&, const simd&); + + friend simd& operator&= (simd&, const simd&); + friend simd& operator|= (simd&, const simd&); + friend simd& operator^= (simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator> (const simd&, const simd&); + friend mask_type operator< (const simd&, const simd&); +}; + +// [simd.math] +template <class Abi> using scharv = simd<signed char, Abi>; // exposition only +template <class Abi> using shortv = simd<short, Abi>; // exposition only +template <class Abi> using intv = simd<int, Abi>; // exposition only +template <class Abi> using longv = simd<long int, Abi>; // exposition only +template <class Abi> using llongv = simd<long long int, Abi>; // exposition only +template <class Abi> using floatv = simd<float, Abi>; // exposition only +template <class Abi> using doublev = simd<double, Abi>; // exposition only +template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only +template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only + +template <class Abi> floatv<Abi> acos(floatv<Abi> x); +template <class Abi> doublev<Abi> acos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asin(floatv<Abi> x); +template <class Abi> doublev<Abi> asin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan(floatv<Abi> x); +template <class Abi> doublev<Abi> atan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); +template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cos(floatv<Abi> x); +template <class Abi> doublev<Abi> cos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sin(floatv<Abi> x); +template <class Abi> doublev<Abi> sin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tan(floatv<Abi> x); +template <class Abi> doublev<Abi> tan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> acosh(floatv<Abi> x); +template <class Abi> doublev<Abi> acosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asinh(floatv<Abi> x); +template <class Abi> doublev<Abi> asinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atanh(floatv<Abi> x); +template <class Abi> doublev<Abi> atanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cosh(floatv<Abi> x); +template <class Abi> doublev<Abi> cosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sinh(floatv<Abi> x); +template <class Abi> doublev<Abi> sinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tanh(floatv<Abi> x); +template <class Abi> doublev<Abi> tanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp(floatv<Abi> x); +template <class Abi> doublev<Abi> exp(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp2(floatv<Abi> x); +template <class Abi> doublev<Abi> exp2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> expm1(floatv<Abi> x); +template <class Abi> doublev<Abi> expm1(doublev<Abi> x); +template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); +template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); +template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); + +template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); +template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); +template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); + +template <class Abi> floatv<Abi> log(floatv<Abi> x); +template <class Abi> doublev<Abi> log(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log10(floatv<Abi> x); +template <class Abi> doublev<Abi> log10(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log1p(floatv<Abi> x); +template <class Abi> doublev<Abi> log1p(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log2(floatv<Abi> x); +template <class Abi> doublev<Abi> log2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> logb(floatv<Abi> x); +template <class Abi> doublev<Abi> logb(doublev<Abi> x); +template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); +template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); +template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); + +template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); +template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); + +template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); +template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); + +template <class Abi> scharv<Abi> abs(scharv<Abi> j); +template <class Abi> shortv<Abi> abs(shortv<Abi> j); +template <class Abi> intv<Abi> abs(intv<Abi> j); +template <class Abi> longv<Abi> abs(longv<Abi> j); +template <class Abi> llongv<Abi> abs(llongv<Abi> j); +template <class Abi> floatv<Abi> abs(floatv<Abi> j); +template <class Abi> doublev<Abi> abs(doublev<Abi> j); +template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); + +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); +template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> erf(floatv<Abi> x); +template <class Abi> doublev<Abi> erf(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); +template <class Abi> floatv<Abi> erfc(floatv<Abi> x); +template <class Abi> doublev<Abi> erfc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ceil(floatv<Abi> x); +template <class Abi> doublev<Abi> ceil(doublev<Abi> x); +template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> floor(floatv<Abi> x); +template <class Abi> doublev<Abi> floor(doublev<Abi> x); +template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); +template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> rint(floatv<Abi> x); +template <class Abi> doublev<Abi> rint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); + +template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> round(floatv<Abi> x); +template <class Abi> doublev<Abi> round(doublev<Abi> x); +template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); +template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> trunc(floatv<Abi> x); +template <class Abi> doublev<Abi> trunc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); +template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); +template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); + +template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> doublev<Abi> nan(const char* tagp); +template <class Abi> floatv<Abi> nanf(const char* tagp); +template <class Abi> ldoublev<Abi> nanl(const char* tagp); + +template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); +template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); +template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class V> struct simd_div_t { V quot, rem; }; +template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); +template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); +template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); +template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); +template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); + +// [simd.mask.class] +template <class T, class Abi> +class simd_mask { +public: + using value_type = bool; + using reference = see below; + using simd_type = simd<T, Abi>; + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class Flags> simd_mask(const value_type* mem, Flags); + + // loads [simd.mask.copy] + template <class Flags> void copy_from(const value_type* mem, Flags); + template <class Flags> void copy_to(value_type* mem, Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + +} // parallelism_v2 +} // std::experimental + +*/ + +#include <experimental/__config> +#include <array> +#include <cstddef> +#include <functional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + +enum class _StorageKind { + _Scalar, + _Array, +}; + +template <_StorageKind __kind, int _Np> +struct __simd_abi {}; + +template <class _Tp, class _Abi> +struct __simd_storage_traits {}; + +template <class _Tp, int __num_element> +struct __simd_storage_traits<_Tp, + __simd_abi<_StorageKind::_Array, __num_element>> { + using type = std::array<_Tp, __num_element>; +}; + +template <class _Tp> +struct __simd_storage_traits<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> { + using type = _Tp; +}; + +template <class _To, class _From> +constexpr decltype(_To{std::declval<_From>()}, true) +__is_non_narrowing_convertible_impl(_From) { + return true; +} + +template <class _To> +constexpr bool __is_non_narrowing_convertible_impl(...) { + return false; +} + +template <class _From, class _To> +constexpr typename std::enable_if<std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value, + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return __is_non_narrowing_convertible_impl<_To>(_From{}); +} + +template <class _From, class _To> +constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value), + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return false; +} + +template <class _Tp> +constexpr _Tp __variadic_sum() { + return _Tp{}; +} + +template <class _Tp, class _Up, class... _Args> +constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { + return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); +} + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI + +using scalar = __simd_abi<_StorageKind::_Scalar, 1>; + +template <int _Np> +using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template <class _Tp> +_LIBCPP_INLINE_VAR constexpr int max_fixed_size = 32; +#endif +template <class _Tp> +using compatible = fixed_size<16 / sizeof(_Tp)>; +template <class _Tp> +using native = compatible<_Tp>; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd; +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd_mask; + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> +struct overaligned_tag {}; +#if _LIBCPP_STD_VER > 14 +_LIBCPP_INLINE_VAR constexpr element_aligned_tag element_aligned{}; +_LIBCPP_INLINE_VAR constexpr vector_aligned_tag vector_aligned{}; +#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template <size_t _Np> +_LIBCPP_INLINE_VAR constexpr overaligned_tag<_Np> overaligned{}; +#endif +#endif + +// traits [simd.traits] +template <class _Tp> +struct is_abi_tag : std::integral_constant<bool, false> {}; + +template <_StorageKind __kind, int _Np> +struct is_abi_tag<__simd_abi<__kind, _Np>> + : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd_mask : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { +}; + +template <class _Tp> +struct is_simd_flag_type : std::integral_constant<bool, false> {}; + +template <> +struct is_simd_flag_type<element_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <> +struct is_simd_flag_type<vector_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <size_t _Align> +struct is_simd_flag_type<overaligned_tag<_Align>> + : std::integral_constant<bool, true> {}; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template <class _Tp> +_LIBCPP_INLINE_VAR constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value; +template <class _Tp> +_LIBCPP_INLINE_VAR constexpr bool is_simd_v = is_simd<_Tp>::value; +template <class _Tp> +_LIBCPP_INLINE_VAR constexpr bool is_simd_mask_v = is_simd_mask<_Tp>::value; +template <class _Tp> +_LIBCPP_INLINE_VAR constexpr bool is_simd_flag_type_v = + is_simd_flag_type<_Tp>::value; +#endif +template <class _Tp, size_t _Np> +struct abi_for_size { + using type = simd_abi::fixed_size<_Np>; +}; +template <class _Tp, size_t _Np> +using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +struct simd_size; + +template <class _Tp, _StorageKind __kind, int _Np> +struct simd_size<_Tp, __simd_abi<__kind, _Np>> + : std::integral_constant<size_t, _Np> { + static_assert( + std::is_arithmetic<_Tp>::value && + !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, + "Element type should be vectorizable"); +}; + +template <class _Tp, class _Up = typename _Tp::value_type> +struct memory_alignment; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +_LIBCPP_INLINE_VAR constexpr size_t simd_size_v = simd_size<_Tp, _Abi>::value; + +template <class _Tp, class _Up = typename _Tp::value_type> +_LIBCPP_INLINE_VAR constexpr size_t memory_alignment_v = + memory_alignment<_Tp, _Up>::value; +#endif + +// class template simd [simd.class] +template <class _Tp> +using native_simd = simd<_Tp, simd_abi::native<_Tp>>; +template <class _Tp, int _Np> +using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; + +// class template simd_mask [simd.mask.class] +template <class _Tp> +using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; + +template <class _Tp, int _Np> +using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; + +// casts [simd.casts] +template <class _Tp> +struct __static_simd_cast_traits { + template <class _Up, class _Abi> + static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if<simd<_Up, _Abi>::size() == + simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp> +struct __simd_cast_traits { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), + simd<_Tp, _Abi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && + simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _Up, class _Abi> +auto simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { + return __simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Up, class _Abi> +auto static_simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { + return __static_simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Abi> +fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> +split(const simd_mask<_Tp, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd<typename _SimdType::value_type, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd_mask<typename _SimdType::value_type, _Abi>&); + +template <class _Tp, class... _Abis> +simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd<_Tp, _Abis>&...); + +template <class _Tp, class... _Abis> +simd_mask<_Tp, + abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd_mask<_Tp, _Abis>&...); + +// reductions [simd.mask.reductions] +template <class _Tp, class _Abi> +bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int popcount(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int find_first_set(const simd_mask<_Tp, _Abi>&); +template <class _Tp, class _Abi> +int find_last_set(const simd_mask<_Tp, _Abi>&); +bool all_of(bool) noexcept; +bool any_of(bool) noexcept; +bool none_of(bool) noexcept; +bool some_of(bool) noexcept; +int popcount(bool) noexcept; +int find_first_set(bool) noexcept; +int find_last_set(bool) noexcept; + +// masked assignment [simd.whereexpr] +template <class _MaskType, class _Tp> +class const_where_expression; +template <class _MaskType, class _Tp> +class where_expression; + +// masked assignment [simd.mask.where] +template <class _Tp> +struct __nodeduce { + using type = _Tp; +}; + +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, + const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp> +where_expression<bool, _Tp> where(bool, _Tp&) noexcept; + +template <class _Tp> +const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; + +// reductions [simd.reductions] +template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> +_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); + +template <class _MaskType, class _SimdType, class _BinaryOp> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + typename _SimdType::value_type neutral_element, _BinaryOp binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + plus<typename _SimdType::value_type> binary_op = {}); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + multiplies<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_and<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_or<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_xor<typename _SimdType::value_type> binary_op); + +template <class _Tp, class _Abi> +_Tp hmin(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmin(const const_where_expression<_MaskType, _SimdType>&); +template <class _Tp, class _Abi> +_Tp hmax(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmax(const const_where_expression<_MaskType, _SimdType>&); + +// algorithms [simd.alg] +template <class _Tp, class _Abi> +simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> +minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, + const simd<_Tp, _Abi>&); + +// [simd.whereexpr] +// TODO implement where expressions. +template <class _MaskType, class _Tp> +class const_where_expression { +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + typename remove_const<_Tp>::type operator-() const&&; + template <class _Up, class _Flags> + void copy_to(_Up*, _Flags) const&&; +}; + +template <class _MaskType, class _Tp> +class where_expression : public const_where_expression<_MaskType, _Tp> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class _Up> + void operator=(_Up&&); + template <class _Up> + void operator+=(_Up&&); + template <class _Up> + void operator-=(_Up&&); + template <class _Up> + void operator*=(_Up&&); + template <class _Up> + void operator/=(_Up&&); + template <class _Up> + void operator%=(_Up&&); + template <class _Up> + void operator&=(_Up&&); + template <class _Up> + void operator|=(_Up&&); + template <class _Up> + void operator^=(_Up&&); + template <class _Up> + void operator<<=(_Up&&); + template <class _Up> + void operator>>=(_Up&&); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class _Up, class _Flags> + void copy_from(const _Up*, _Flags); +}; + +// [simd.class] +// TODO: implement simd +template <class _Tp, class _Abi> +class simd { +private: + template <class _Up> + static constexpr bool __can_broadcast() { + return (std::is_arithmetic<_Up>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || + (!std::is_arithmetic<_Up>::value && + std::is_convertible<_Up, _Tp>::value) || + std::is_same<typename std::remove_const<_Up>::type, int>::value || + (std::is_same<typename std::remove_const<_Up>::type, + unsigned int>::value && + std::is_unsigned<_Tp>::value); + } + +public: + using value_type = _Tp; + // TODO: this is strawman implementation. Turn it into a proxy type. + using reference = _Tp&; + using mask_type = simd_mask<_Tp, _Abi>; + + using abi_type = _Abi; + + static constexpr size_t size() noexcept { + return simd_size<_Tp, _Abi>::value; + } + + simd() = default; + + // implicit type conversion constructor + template <class _Up, + class = typename std::enable_if< + std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> + simd(const simd<_Up, simd_abi::fixed_size<size()>>&) {} + + // implicit broadcast constructor + template <class _Up, + class = typename std::enable_if<__can_broadcast<_Up>()>::type> + simd(_Up&&); + + // generator constructor + // TODO: for now only check for the index 0. This is because C++11 doesn't + // have index_sequence, and it's hard to check for all indicies without using + // index_sequence. + template <class _Generator, + int = decltype(simd(std::declval<_Generator>()( + std::integral_constant<size_t, 0>())), + int())()> + explicit simd(_Generator&&); + + // load constructor + template <class _Up, class _Flags> + simd(const _Up*, _Flags); + + // loads [simd.load] + template <class _Up, class _Flags> + void copy_from(const _Up*, _Flags); + + // stores [simd.store] + template <class _Up, class _Flags> + void copy_to(_Up*, _Flags) const; + + // scalar access [simd.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+(const simd&, const simd&); + friend simd operator-(const simd&, const simd&); + friend simd operator*(const simd&, const simd&); + friend simd operator/(const simd&, const simd&); + friend simd operator%(const simd&, const simd&); + friend simd operator&(const simd&, const simd&); + friend simd operator|(const simd&, const simd&); + friend simd operator^(const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+=(simd&, const simd&); + friend simd& operator-=(simd&, const simd&); + friend simd& operator*=(simd&, const simd&); + friend simd& operator/=(simd&, const simd&); + friend simd& operator%=(simd&, const simd&); + + friend simd& operator&=(simd&, const simd&); + friend simd& operator|=(simd&, const simd&); + friend simd& operator^=(simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator>(const simd&, const simd&); + friend mask_type operator<(const simd&, const simd&); +}; + +// [simd.mask.class] +template <class _Tp, class _Abi> +// TODO: implement simd_mask +class simd_mask { +public: + using value_type = bool; + // TODO: this is strawman implementation. Turn it into a proxy type. + using reference = bool&; + using simd_type = simd<_Tp, _Abi>; + using abi_type = _Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class _Up> + simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class _Flags> + simd_mask(const value_type*, _Flags); + + // loads [simd.mask.copy] + template <class _Flags> + void copy_from(const value_type*, _Flags); + template <class _Flags> + void copy_to(value_type*, _Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; + friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD + +#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ diff --git a/include/experimental/string_view b/include/experimental/string_view index da104f9a1210d..f13bff54d531a 100644 --- a/include/experimental/string_view +++ b/include/experimental/string_view @@ -8,811 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_LFTS_STRING_VIEW -#define _LIBCPP_LFTS_STRING_VIEW - -/* -string_view synopsis - -namespace std { - namespace experimental { - inline namespace library_fundamentals_v1 { - - // 7.2, Class template basic_string_view - template<class charT, class traits = char_traits<charT>> - class basic_string_view; - - // 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<charT, traits> y) noexcept; - template<class charT, class traits> - constexpr bool operator!=(basic_string_view<charT, traits> x, - basic_string_view<charT, traits> y) noexcept; - template<class charT, class traits> - constexpr bool operator< (basic_string_view<charT, traits> x, - basic_string_view<charT, traits> y) noexcept; - template<class charT, class traits> - constexpr bool operator> (basic_string_view<charT, traits> x, - basic_string_view<charT, traits> y) noexcept; - template<class charT, class traits> - constexpr bool operator<=(basic_string_view<charT, traits> x, - basic_string_view<charT, traits> y) noexcept; - template<class charT, class traits> - constexpr bool operator>=(basic_string_view<charT, traits> x, - basic_string_view<charT, traits> y) noexcept; - // see below, sufficient additional overloads of comparison functions - - // 7.10, Inserters and extractors - template<class charT, class traits> - basic_ostream<charT, traits>& - operator<<(basic_ostream<charT, traits>& os, - basic_string_view<charT, traits> str); - - // basic_string_view typedef names - typedef basic_string_view<char> string_view; - typedef basic_string_view<char16_t> u16string_view; - typedef basic_string_view<char32_t> u32string_view; - typedef basic_string_view<wchar_t> wstring_view; - - template<class charT, class traits = char_traits<charT>> - class basic_string_view { - public: - // types - typedef traits traits_type; - typedef charT value_type; - typedef charT* pointer; - typedef const charT* const_pointer; - typedef charT& reference; - typedef const charT& const_reference; - typedef implementation-defined const_iterator; - typedef const_iterator iterator; - typedef reverse_iterator<const_iterator> const_reverse_iterator; - typedef const_reverse_iterator reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - static constexpr size_type npos = size_type(-1); - - // 7.3, basic_string_view constructors and assignment operators - constexpr basic_string_view() noexcept; - constexpr basic_string_view(const basic_string_view&) noexcept = default; - basic_string_view& operator=(const basic_string_view&) noexcept = default; - template<class Allocator> - basic_string_view(const basic_string<charT, traits, Allocator>& str) noexcept; - constexpr basic_string_view(const charT* str); - constexpr basic_string_view(const charT* str, size_type len); - - // 7.4, basic_string_view iterator support - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr const_iterator cbegin() const noexcept; - constexpr const_iterator cend() const noexcept; - const_reverse_iterator rbegin() const noexcept; - const_reverse_iterator rend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // 7.5, basic_string_view capacity - constexpr size_type size() const noexcept; - constexpr size_type length() const noexcept; - constexpr size_type max_size() const noexcept; - constexpr bool empty() const noexcept; - - // 7.6, basic_string_view element access - constexpr const_reference operator[](size_type pos) const; - constexpr const_reference at(size_type pos) const; - constexpr const_reference front() const; - constexpr const_reference back() const; - constexpr const_pointer data() const noexcept; - - // 7.7, basic_string_view modifiers - constexpr void clear() noexcept; - constexpr void remove_prefix(size_type n); - constexpr void remove_suffix(size_type n); - constexpr void swap(basic_string_view& s) noexcept; - - // 7.8, basic_string_view string operations - template<class Allocator> - explicit operator basic_string<charT, traits, Allocator>() const; - template<class Allocator = allocator<charT>> - basic_string<charT, traits, Allocator> to_string( - const Allocator& a = Allocator()) const; - - size_type copy(charT* s, size_type n, size_type pos = 0) const; - - constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; - constexpr int compare(basic_string_view s) const noexcept; - constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const; - constexpr int compare(size_type pos1, size_type n1, - basic_string_view s, size_type pos2, size_type n2) const; - constexpr int compare(const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, - 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 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 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_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_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_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; - - private: - const_pointer data_; // exposition only - size_type size_; // exposition only - }; - - } // namespace fundamentals_v1 - } // namespace experimental - - // 7.11, Hash support - template <class T> struct hash; - template <> struct hash<experimental::string_view>; - template <> struct hash<experimental::u16string_view>; - template <> struct hash<experimental::u32string_view>; - template <> struct hash<experimental::wstring_view>; - -} // namespace std - - -*/ - -#include <experimental/__config> - -#include <string> -#include <algorithm> -#include <iterator> -#include <ostream> -#include <stdexcept> -#include <iomanip> - -#include <__debug> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_LFTS - - template<class _CharT, class _Traits = _VSTD::char_traits<_CharT> > - class _LIBCPP_TEMPLATE_VIS basic_string_view { - public: - // types - typedef _Traits traits_type; - typedef _CharT value_type; - typedef const _CharT* pointer; - typedef const _CharT* const_pointer; - typedef const _CharT& reference; - typedef const _CharT& const_reference; - typedef const_pointer const_iterator; // See [string.view.iterators] - typedef const_iterator iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; - typedef const_reverse_iterator reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1); - - // [string.view.cons], construct/copy - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {} - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(const basic_string_view&) _NOEXCEPT = default; - - _LIBCPP_INLINE_VISIBILITY - basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default; - - template<class _Allocator> - _LIBCPP_INLINE_VISIBILITY - basic_string_view(const basic_string<_CharT, _Traits, _Allocator>& __str) _NOEXCEPT - : __data (__str.data()), __size(__str.size()) {} - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(const _CharT* __s, size_type __len) - : __data(__s), __size(__len) - { -// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr"); - } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(const _CharT* __s) - : __data(__s), __size(_Traits::length(__s)) {} - - // [string.view.iterators], iterators - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const _NOEXCEPT { return cbegin(); } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator end() const _NOEXCEPT { return cend(); } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator cbegin() const _NOEXCEPT { return __data; } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_iterator cend() const _NOEXCEPT { return __data + __size; } - - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); } - - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); } - - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); } - - _LIBCPP_INLINE_VISIBILITY - const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); } - - // [string.view.capacity], capacity - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - size_type size() const _NOEXCEPT { return __size; } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - size_type length() const _NOEXCEPT { return __size; } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - size_type max_size() const _NOEXCEPT { return _VSTD::numeric_limits<size_type>::max(); } - - _LIBCPP_CONSTEXPR bool _LIBCPP_INLINE_VISIBILITY - empty() const _NOEXCEPT { return __size == 0; } - - // [string.view.access], element access - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_reference operator[](size_type __pos) const { return __data[__pos]; } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_reference at(size_type __pos) const - { - return __pos >= size() - ? (__throw_out_of_range("string_view::at"), __data[0]) - : __data[__pos]; - } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_reference front() const - { - return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0]; - } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_reference back() const - { - return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1]; - } - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - const_pointer data() const _NOEXCEPT { return __data; } - - // [string.view.modifiers], modifiers: - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - void clear() _NOEXCEPT - { - __data = nullptr; - __size = 0; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - void remove_prefix(size_type __n) _NOEXCEPT - { - _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()"); - __data += __n; - __size -= __n; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - void remove_suffix(size_type __n) _NOEXCEPT - { - _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()"); - __size -= __n; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - void swap(basic_string_view& __other) _NOEXCEPT - { - const value_type *__p = __data; - __data = __other.__data; - __other.__data = __p; - - size_type __sz = __size; - __size = __other.__size; - __other.__size = __sz; -// _VSTD::swap( __data, __other.__data ); -// _VSTD::swap( __size, __other.__size ); - } - - // [string.view.ops], string operations: - template<class _Allocator> - _LIBCPP_INLINE_VISIBILITY - _LIBCPP_EXPLICIT operator basic_string<_CharT, _Traits, _Allocator>() const - { return basic_string<_CharT, _Traits, _Allocator>( begin(), end()); } - - template<class _Allocator = allocator<_CharT> > - _LIBCPP_INLINE_VISIBILITY - basic_string<_CharT, _Traits, _Allocator> - to_string( const _Allocator& __a = _Allocator()) const - { return basic_string<_CharT, _Traits, _Allocator> ( begin(), end(), __a ); } - - size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const - { - if ( __pos > size()) - __throw_out_of_range("string_view::copy"); - size_type __rlen = _VSTD::min( __n, size() - __pos ); - _VSTD::copy_n(begin() + __pos, __rlen, __s ); - return __rlen; - } - - _LIBCPP_CONSTEXPR - basic_string_view substr(size_type __pos = 0, size_type __n = npos) const - { -// if (__pos > size()) -// __throw_out_of_range("string_view::substr"); -// size_type __rlen = _VSTD::min( __n, size() - __pos ); -// return basic_string_view(data() + __pos, __rlen); - return __pos > size() - ? (__throw_out_of_range("string_view::substr"), basic_string_view()) - : basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos)); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 int compare(basic_string_view __sv) const _NOEXCEPT - { - size_type __rlen = _VSTD::min( size(), __sv.size()); - int __retval = _Traits::compare(data(), __sv.data(), __rlen); - if ( __retval == 0 ) // first __rlen chars matched - __retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 ); - return __retval; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - int compare(size_type __pos1, size_type __n1, basic_string_view __sv) const - { - return substr(__pos1, __n1).compare(__sv); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - int compare( size_type __pos1, size_type __n1, - basic_string_view _sv, size_type __pos2, size_type __n2) const - { - return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2)); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - int compare(const _CharT* __s) const - { - return compare(basic_string_view(__s)); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - int compare(size_type __pos1, size_type __n1, const _CharT* __s) const - { - return substr(__pos1, __n1).compare(basic_string_view(__s)); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const - { - return substr(__pos1, __n1).compare(basic_string_view(__s, __n2)); - } - - // find - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr"); - return _VSTD::__str_find<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find(_CharT __c, size_type __pos = 0) const _NOEXCEPT - { - return _VSTD::__str_find<value_type, size_type, traits_type, npos> - (data(), size(), __c, __pos); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find(const _CharT* __s, size_type __pos, size_type __n) const - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr"); - return _VSTD::__str_find<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find(const _CharT* __s, size_type __pos = 0) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr"); - return _VSTD::__str_find<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - // rfind - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr"); - return _VSTD::__str_rfind<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT - { - return _VSTD::__str_rfind<value_type, size_type, traits_type, npos> - (data(), size(), __c, __pos); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr"); - return _VSTD::__str_rfind<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type rfind(const _CharT* __s, size_type __pos=npos) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr"); - return _VSTD::__str_rfind<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - // find_first_of - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr"); - return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT - { 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 - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr"); - return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_of(const _CharT* __s, size_type __pos=0) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr"); - return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - // find_last_of - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr"); - return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT - { 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 - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr"); - return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(const _CharT* __s, size_type __pos=npos) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr"); - return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - // find_first_not_of - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr"); - return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_not_of(_CharT __c, size_type __pos=0) const _NOEXCEPT - { - return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __c, __pos); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr"); - return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr"); - return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - // find_last_not_of - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT - { - _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr"); - return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s.data(), __pos, __s.size()); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(_CharT __c, size_type __pos=npos) const _NOEXCEPT - { - return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __c, __pos); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const - { - _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr"); - return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, __n); - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const - { - _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr"); - return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos> - (data(), size(), __s, __pos, traits_type::length(__s)); - } - - private: - const value_type* __data; - size_type __size; - }; - - - // [string.view.comparison] - // operator == - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator==(basic_string_view<_CharT, _Traits> __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) return false; - return __lhs.compare(__rhs) == 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator==(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) return false; - return __lhs.compare(__rhs) == 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator==(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) return false; - return __lhs.compare(__rhs) == 0; - } - - - // operator != - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) - return true; - return __lhs.compare(__rhs) != 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator!=(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) - return true; - return __lhs.compare(__rhs) != 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator!=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - if ( __lhs.size() != __rhs.size()) - return true; - return __lhs.compare(__rhs) != 0; - } - - - // operator < - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) < 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) < 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) < 0; - } - - - // operator > - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator> (basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) > 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator>(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) > 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator>(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) > 0; - } - - - // operator <= - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) <= 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<=(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) <= 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator<=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) <= 0; - } - - - // operator >= - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator>=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) >= 0; - } - - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator>=(basic_string_view<_CharT, _Traits> __lhs, - typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) >= 0; - } - - template<class _CharT, class _Traits> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator>=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs, - basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT - { - return __lhs.compare(__rhs) >= 0; - } - - - // [string.view.io] - template<class _CharT, class _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __sv) - { - return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size()); - } - - typedef basic_string_view<char> string_view; - typedef basic_string_view<char16_t> u16string_view; - typedef basic_string_view<char32_t> u32string_view; - typedef basic_string_view<wchar_t> wstring_view; - -_LIBCPP_END_NAMESPACE_LFTS -_LIBCPP_BEGIN_NAMESPACE_STD - -// [string.view.hash] -// Shamelessly stolen from <string> -template<class _CharT, class _Traits> -struct _LIBCPP_TEMPLATE_VIS hash<std::experimental::basic_string_view<_CharT, _Traits> > - : public unary_function<std::experimental::basic_string_view<_CharT, _Traits>, size_t> -{ - size_t operator()(const std::experimental::basic_string_view<_CharT, _Traits>& __val) const _NOEXCEPT; -}; - -template<class _CharT, class _Traits> -size_t -hash<std::experimental::basic_string_view<_CharT, _Traits> >::operator()( - const std::experimental::basic_string_view<_CharT, _Traits>& __val) const _NOEXCEPT -{ - return __do_string_hash(__val.data(), __val.data() + __val.size()); -} - -#if _LIBCPP_STD_VER > 11 -template <class _CharT, class _Traits> -__quoted_output_proxy<_CharT, const _CharT *, _Traits> -quoted ( std::experimental::basic_string_view <_CharT, _Traits> __sv, - _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\')) -{ - return __quoted_output_proxy<_CharT, const _CharT *, _Traits> - ( __sv.data(), __sv.data() + __sv.size(), __delim, __escape ); -} -#endif - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP_LFTS_STRING_VIEW +#error "<experimental/string_view> has been removed. Use <string_view> instead." diff --git a/include/experimental/system_error b/include/experimental/system_error index 2ec238544615e..7937357fa1414 100644 --- a/include/experimental/system_error +++ b/include/experimental/system_error @@ -8,56 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR -#define _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR - -/** - experimental/system_error synopsis - -// C++1y - -#include <system_error> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - // See C++14 19.5, System error support - template <class T> constexpr bool is_error_code_enum_v - = is_error_code_enum<T>::value; - template <class T> constexpr bool is_error_condition_enum_v - = is_error_condition_enum<T>::value; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - -*/ - -#include <experimental/__config> - -#if _LIBCPP_STD_VER > 11 - -#include <system_error> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_error_code_enum_v - = is_error_code_enum<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_error_condition_enum_v - = is_error_condition_enum<_Tp>::value; - -#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */ - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_STD_VER > 11 */ - -#endif /* _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR */ +#error "<experimental/system_error> has been removed. Use <system_error> instead." diff --git a/include/experimental/tuple b/include/experimental/tuple index e00d2ec1a92fb..1f37a6293bac1 100644 --- a/include/experimental/tuple +++ b/include/experimental/tuple @@ -8,75 +8,4 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_TUPLE -#define _LIBCPP_EXPERIMENTAL_TUPLE - -/* - experimental/tuple synopsis - -// C++1y - -#include <tuple> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - // See C++14 20.4.2.5, tuple helper classes - template <class T> constexpr size_t tuple_size_v - = tuple_size<T>::value; - - // 3.2.2, Calling a function with a tuple of arguments - template <class F, class Tuple> - constexpr decltype(auto) apply(F&& f, Tuple&& t); - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -# include <experimental/__config> - -#if _LIBCPP_STD_VER > 11 - -# include <tuple> -# include <utility> -# include <__functional_base> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES -template <class _Tp> -_LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value; -#endif - -template <class _Fn, class _Tuple, size_t ..._Id> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX11 -decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t, - integer_sequence<size_t, _Id...>) { - return _VSTD::__invoke_constexpr( - _VSTD::forward<_Fn>(__f), - _VSTD::get<_Id>(_VSTD::forward<_Tuple>(__t))... - ); -} - -template <class _Fn, class _Tuple> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -decltype(auto) apply(_Fn && __f, _Tuple && __t) { - return _VSTD_LFTS::__apply_tuple_impl( - _VSTD::forward<_Fn>(__f), _VSTD::forward<_Tuple>(__t), - make_index_sequence<tuple_size<typename decay<_Tuple>::type>::value>() - ); -} - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_STD_VER > 11 */ - -#endif /* _LIBCPP_EXPERIMENTAL_TUPLE */ +#error "<experimental/tuple> has been removed. Use <tuple> instead." diff --git a/include/experimental/type_traits b/include/experimental/type_traits index 3a7593620a7e5..afe491567cec5 100644 --- a/include/experimental/type_traits +++ b/include/experimental/type_traits @@ -21,146 +21,6 @@ namespace std { namespace experimental { inline namespace fundamentals_v1 { - // See C++14 20.10.4.1, primary type categories - template <class T> constexpr bool is_void_v - = is_void<T>::value; - template <class T> constexpr bool is_null_pointer_v - = is_null_pointer<T>::value; - template <class T> constexpr bool is_integral_v - = is_integral<T>::value; - template <class T> constexpr bool is_floating_point_v - = is_floating_point<T>::value; - template <class T> constexpr bool is_array_v - = is_array<T>::value; - template <class T> constexpr bool is_pointer_v - = is_pointer<T>::value; - template <class T> constexpr bool is_lvalue_reference_v - = is_lvalue_reference<T>::value; - template <class T> constexpr bool is_rvalue_reference_v - = is_rvalue_reference<T>::value; - template <class T> constexpr bool is_member_object_pointer_v - = is_member_object_pointer<T>::value; - template <class T> constexpr bool is_member_function_pointer_v - = is_member_function_pointer<T>::value; - template <class T> constexpr bool is_enum_v - = is_enum<T>::value; - template <class T> constexpr bool is_union_v - = is_union<T>::value; - template <class T> constexpr bool is_class_v - = is_class<T>::value; - template <class T> constexpr bool is_function_v - = is_function<T>::value; - - // See C++14 20.10.4.2, composite type categories - template <class T> constexpr bool is_reference_v - = is_reference<T>::value; - template <class T> constexpr bool is_arithmetic_v - = is_arithmetic<T>::value; - template <class T> constexpr bool is_fundamental_v - = is_fundamental<T>::value; - template <class T> constexpr bool is_object_v - = is_object<T>::value; - template <class T> constexpr bool is_scalar_v - = is_scalar<T>::value; - template <class T> constexpr bool is_compound_v - = is_compound<T>::value; - template <class T> constexpr bool is_member_pointer_v - = is_member_pointer<T>::value; - - // See C++14 20.10.4.3, type properties - template <class T> constexpr bool is_const_v - = is_const<T>::value; - template <class T> constexpr bool is_volatile_v - = is_volatile<T>::value; - template <class T> constexpr bool is_trivial_v - = is_trivial<T>::value; - template <class T> constexpr bool is_trivially_copyable_v - = is_trivially_copyable<T>::value; - template <class T> constexpr bool is_standard_layout_v - = is_standard_layout<T>::value; - template <class T> constexpr bool is_pod_v - = is_pod<T>::value; - template <class T> constexpr bool is_literal_type_v - = is_literal_type<T>::value; - template <class T> constexpr bool is_empty_v - = is_empty<T>::value; - template <class T> constexpr bool is_polymorphic_v - = is_polymorphic<T>::value; - template <class T> constexpr bool is_abstract_v - = is_abstract<T>::value; - template <class T> constexpr bool is_final_v - = is_final<T>::value; - template <class T> constexpr bool is_signed_v - = is_signed<T>::value; - template <class T> constexpr bool is_unsigned_v - = is_unsigned<T>::value; - template <class T, class... Args> constexpr bool is_constructible_v - = is_constructible<T, Args...>::value; - template <class T> constexpr bool is_default_constructible_v - = is_default_constructible<T>::value; - template <class T> constexpr bool is_copy_constructible_v - = is_copy_constructible<T>::value; - template <class T> constexpr bool is_move_constructible_v - = is_move_constructible<T>::value; - template <class T, class U> constexpr bool is_assignable_v - = is_assignable<T, U>::value; - template <class T> constexpr bool is_copy_assignable_v - = is_copy_assignable<T>::value; - template <class T> constexpr bool is_move_assignable_v - = is_move_assignable<T>::value; - template <class T> constexpr bool is_destructible_v - = is_destructible<T>::value; - template <class T, class... Args> constexpr bool is_trivially_constructible_v - = is_trivially_constructible<T, Args...>::value; - template <class T> constexpr bool is_trivially_default_constructible_v - = is_trivially_default_constructible<T>::value; - template <class T> constexpr bool is_trivially_copy_constructible_v - = is_trivially_copy_constructible<T>::value; - template <class T> constexpr bool is_trivially_move_constructible_v - = is_trivially_move_constructible<T>::value; - template <class T, class U> constexpr bool is_trivially_assignable_v - = is_trivially_assignable<T, U>::value; - template <class T> constexpr bool is_trivially_copy_assignable_v - = is_trivially_copy_assignable<T>::value; - template <class T> constexpr bool is_trivially_move_assignable_v - = is_trivially_move_assignable<T>::value; - template <class T> constexpr bool is_trivially_destructible_v - = is_trivially_destructible<T>::value; - template <class T, class... Args> constexpr bool is_nothrow_constructible_v - = is_nothrow_constructible<T, Args...>::value; - template <class T> constexpr bool is_nothrow_default_constructible_v - = is_nothrow_default_constructible<T>::value; - template <class T> constexpr bool is_nothrow_copy_constructible_v - = is_nothrow_copy_constructible<T>::value; - template <class T> constexpr bool is_nothrow_move_constructible_v - = is_nothrow_move_constructible<T>::value; - template <class T, class U> constexpr bool is_nothrow_assignable_v - = is_nothrow_assignable<T, U>::value; - template <class T> constexpr bool is_nothrow_copy_assignable_v - = is_nothrow_copy_assignable<T>::value; - template <class T> constexpr bool is_nothrow_move_assignable_v - = is_nothrow_move_assignable<T>::value; - template <class T> constexpr bool is_nothrow_destructible_v - = is_nothrow_destructible<T>::value; - template <class T> constexpr bool has_virtual_destructor_v - = has_virtual_destructor<T>::value; - - // See C++14 20.10.5, type property queries - template <class T> constexpr size_t alignment_of_v - = alignment_of<T>::value; - template <class T> constexpr size_t rank_v - = rank<T>::value; - template <class T, unsigned I = 0> constexpr size_t extent_v - = extent<T, I>::value; - - // See C++14 20.10.6, type relations - template <class T, class U> constexpr bool is_same_v - = is_same<T, U>::value; - template <class Base, class Derived> constexpr bool is_base_of_v - = is_base_of<Base, Derived>::value; - template <class From, class To> constexpr bool is_convertible_v - = is_convertible<From, To>::value; - // 3.3.2, Other type transformations template <class> class invocation_type; // not defined template <class F, class... ArgTypes> class invocation_type<F(ArgTypes...)>; @@ -172,14 +32,6 @@ inline namespace fundamentals_v1 { template <class T> using raw_invocation_type_t = typename raw_invocation_type<T>::type; - // 3.3.3, Logical operator traits - template<class... B> struct conjunction; - template<class... B> constexpr bool conjunction_v = conjunction<B...>::value; - template<class... B> struct disjunction; - template<class... B> constexpr bool disjunction_v = disjunction<B...>::value; - template<class B> struct negation; - template<class B> constexpr bool negation_v = negation<B>::value; - // 3.3.4, Detection idiom template <class...> using void_t = void; @@ -229,215 +81,6 @@ inline namespace fundamentals_v1 { _LIBCPP_BEGIN_NAMESPACE_LFTS -#ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES - -// C++14 20.10.4.1, primary type categories - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_void_v - = is_void<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_null_pointer_v - = is_null_pointer<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_integral_v - = is_integral<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_floating_point_v - = is_floating_point<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_array_v - = is_array<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_pointer_v - = is_pointer<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_lvalue_reference_v - = is_lvalue_reference<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_rvalue_reference_v - = is_rvalue_reference<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_object_pointer_v - = is_member_object_pointer<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_function_pointer_v - = is_member_function_pointer<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_enum_v - = is_enum<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_union_v - = is_union<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_class_v - = is_class<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_function_v - = is_function<_Tp>::value; - -// C++14 20.10.4.2, composite type categories - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_reference_v - = is_reference<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_arithmetic_v - = is_arithmetic<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_fundamental_v - = is_fundamental<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_object_v - = is_object<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_scalar_v - = is_scalar<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_compound_v - = is_compound<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_pointer_v - = is_member_pointer<_Tp>::value; - -// C++14 20.10.4.3, type properties - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_const_v - = is_const<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_volatile_v - = is_volatile<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivial_v - = is_trivial<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copyable_v - = is_trivially_copyable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_standard_layout_v - = is_standard_layout<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_pod_v - = is_pod<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_literal_type_v - = is_literal_type<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_empty_v - = is_empty<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_polymorphic_v - = is_polymorphic<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_abstract_v - = is_abstract<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_final_v - = is_final<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_signed_v - = is_signed<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_unsigned_v - = is_unsigned<_Tp>::value; - -template <class _Tp, class ..._Ts> _LIBCPP_CONSTEXPR bool is_constructible_v - = is_constructible<_Tp, _Ts...>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v - = is_default_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_constructible_v - = is_copy_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_constructible_v - = is_move_constructible<_Tp>::value; - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_assignable_v - = is_assignable<_Tp, _Up>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v - = is_copy_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_assignable_v - = is_move_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v - = is_destructible<_Tp>::value; - -template <class _Tp, class ..._Ts> _LIBCPP_CONSTEXPR bool is_trivially_constructible_v - = is_trivially_constructible<_Tp, _Ts...>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v - = is_trivially_default_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v - = is_trivially_copy_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v - = is_trivially_move_constructible<_Tp>::value; - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_trivially_assignable_v - = is_trivially_assignable<_Tp, _Up>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v - = is_trivially_copy_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v - = is_trivially_move_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_destructible_v - = is_trivially_destructible<_Tp>::value; - -template <class _Tp, class ..._Ts> _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v - = is_nothrow_constructible<_Tp, _Ts...>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v - = is_nothrow_default_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v - = is_nothrow_copy_constructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v - = is_nothrow_move_constructible<_Tp>::value; - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v - = is_nothrow_assignable<_Tp, _Up>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v - = is_nothrow_copy_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v - = is_nothrow_move_assignable<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v - = is_nothrow_destructible<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR bool has_virtual_destructor_v - = has_virtual_destructor<_Tp>::value; - -// C++14 20.10.5, type properties queries - -template <class _Tp> _LIBCPP_CONSTEXPR size_t alignment_of_v - = alignment_of<_Tp>::value; - -template <class _Tp> _LIBCPP_CONSTEXPR size_t rank_v - = rank<_Tp>::value; - -template <class _Tp, unsigned _Id = 0> _LIBCPP_CONSTEXPR size_t extent_v - = extent<_Tp, _Id>::value; - -// C++14 20.10.6, type relations - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_same_v - = is_same<_Tp, _Up>::value; - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_base_of_v - = is_base_of<_Tp, _Up>::value; - -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_convertible_v - = is_convertible<_Tp, _Up>::value; - -#endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */ - // 3.3.2, Other type transformations /* template <class> @@ -459,24 +102,6 @@ template <class _Tp> using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type; */ -// 3.3.3, Logical operator traits -template <class...> using void_t = void; - -template <class... _Args> -struct conjunction : _VSTD::__and_<_Args...> {}; -template <class... _Args> -_LIBCPP_CONSTEXPR bool conjunction_v = conjunction<_Args...>::value; - -template <class... _Args> -struct disjunction : _VSTD::__or_<_Args...> {}; -template <class... _Args> -_LIBCPP_CONSTEXPR bool disjunction_v = disjunction<_Args...>::value; - -template <class _Tp> -struct negation : _VSTD::__not_<_Tp> {}; -template<class _Tp> -_LIBCPP_CONSTEXPR bool negation_v = negation<_Tp>::value; - // 3.3.4, Detection idiom template <class...> using void_t = void; diff --git a/include/filesystem b/include/filesystem new file mode 100644 index 0000000000000..aa1d718007254 --- /dev/null +++ b/include/filesystem @@ -0,0 +1,2682 @@ +// -*- C++ -*- +//===--------------------------- filesystem -------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP_FILESYSTEM +#define _LIBCPP_FILESYSTEM +/* + filesystem synopsis + + namespace std { namespace filesystem { + + class path; + + void swap(path& lhs, path& rhs) noexcept; + size_t hash_value(const path& p) noexcept; + + bool operator==(const path& lhs, const path& rhs) noexcept; + bool operator!=(const path& lhs, const path& rhs) noexcept; + bool operator< (const path& lhs, const path& rhs) noexcept; + bool operator<=(const path& lhs, const path& rhs) noexcept; + bool operator> (const path& lhs, const path& rhs) noexcept; + bool operator>=(const path& lhs, const path& rhs) noexcept; + + path operator/ (const path& lhs, const path& rhs); + + // fs.path.io operators are friends of path. + template <class charT, class traits> + friend basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const path& p); + + template <class charT, class traits> + friend basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, path& p); + + template <class Source> + path u8path(const Source& source); + template <class InputIterator> + path u8path(InputIterator first, InputIterator last); + + class filesystem_error; + class directory_entry; + + class directory_iterator; + + // enable directory_iterator range-based for statements + directory_iterator begin(directory_iterator iter) noexcept; + directory_iterator end(const directory_iterator&) noexcept; + + class recursive_directory_iterator; + + // enable recursive_directory_iterator range-based for statements + recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept; + recursive_directory_iterator end(const recursive_directory_iterator&) noexcept; + + class file_status; + + struct space_info + { + uintmax_t capacity; + uintmax_t free; + uintmax_t available; + }; + + enum class file_type; + enum class perms; + enum class perm_options; + enum class copy_options; + enum class directory_options; + + typedef chrono::time_point<trivial-clock> file_time_type; + + // operational functions + + path absolute(const path& p); + path absolute(const path& p, error_code &ec); + + path canonical(const path& p); + path canonical(const path& p, error_code& ec); + + void copy(const path& from, const path& to); + void copy(const path& from, const path& to, error_code& ec); + void copy(const path& from, const path& to, copy_options options); + void copy(const path& from, const path& to, copy_options options, + error_code& ec); + + bool copy_file(const path& from, const path& to); + bool copy_file(const path& from, const path& to, error_code& ec); + bool copy_file(const path& from, const path& to, copy_options option); + bool copy_file(const path& from, const path& to, copy_options option, + error_code& ec); + + void copy_symlink(const path& existing_symlink, const path& new_symlink); + void copy_symlink(const path& existing_symlink, const path& new_symlink, + error_code& ec) noexcept; + + bool create_directories(const path& p); + bool create_directories(const path& p, error_code& ec); + + bool create_directory(const path& p); + bool create_directory(const path& p, error_code& ec) noexcept; + + bool create_directory(const path& p, const path& attributes); + bool create_directory(const path& p, const path& attributes, + error_code& ec) noexcept; + + void create_directory_symlink(const path& to, const path& new_symlink); + void create_directory_symlink(const path& to, const path& new_symlink, + error_code& ec) noexcept; + + void create_hard_link(const path& to, const path& new_hard_link); + void create_hard_link(const path& to, const path& new_hard_link, + error_code& ec) noexcept; + + void create_symlink(const path& to, const path& new_symlink); + void create_symlink(const path& to, const path& new_symlink, + error_code& ec) noexcept; + + path current_path(); + path current_path(error_code& ec); + void current_path(const path& p); + void current_path(const path& p, error_code& ec) noexcept; + + bool exists(file_status s) noexcept; + bool exists(const path& p); + bool exists(const path& p, error_code& ec) noexcept; + + bool equivalent(const path& p1, const path& p2); + bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; + + uintmax_t file_size(const path& p); + uintmax_t file_size(const path& p, error_code& ec) noexcept; + + uintmax_t hard_link_count(const path& p); + uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; + + bool is_block_file(file_status s) noexcept; + bool is_block_file(const path& p); + bool is_block_file(const path& p, error_code& ec) noexcept; + + bool is_character_file(file_status s) noexcept; + bool is_character_file(const path& p); + bool is_character_file(const path& p, error_code& ec) noexcept; + + bool is_directory(file_status s) noexcept; + bool is_directory(const path& p); + bool is_directory(const path& p, error_code& ec) noexcept; + + bool is_empty(const path& p); + bool is_empty(const path& p, error_code& ec) noexcept; + + bool is_fifo(file_status s) noexcept; + bool is_fifo(const path& p); + bool is_fifo(const path& p, error_code& ec) noexcept; + + bool is_other(file_status s) noexcept; + bool is_other(const path& p); + bool is_other(const path& p, error_code& ec) noexcept; + + bool is_regular_file(file_status s) noexcept; + bool is_regular_file(const path& p); + bool is_regular_file(const path& p, error_code& ec) noexcept; + + bool is_socket(file_status s) noexcept; + bool is_socket(const path& p); + bool is_socket(const path& p, error_code& ec) noexcept; + + bool is_symlink(file_status s) noexcept; + bool is_symlink(const path& p); + bool is_symlink(const path& p, error_code& ec) noexcept; + + file_time_type last_write_time(const path& p); + file_time_type last_write_time(const path& p, error_code& ec) noexcept; + void last_write_time(const path& p, file_time_type new_time); + void last_write_time(const path& p, file_time_type new_time, + error_code& ec) noexcept; + + void permissions(const path& p, perms prms, + perm_options opts=perm_options::replace); + void permissions(const path& p, perms prms, error_code& ec) noexcept; + void permissions(const path& p, perms prms, perm_options opts, + error_code& ec); + + path proximate(const path& p, error_code& ec); + path proximate(const path& p, const path& base = current_path()); + path proximate(const path& p, const path& base, error_code &ec); + + path read_symlink(const path& p); + path read_symlink(const path& p, error_code& ec); + + path relative(const path& p, error_code& ec); + path relative(const path& p, const path& base=current_path()); + path relative(const path& p, const path& base, error_code& ec); + + bool remove(const path& p); + bool remove(const path& p, error_code& ec) noexcept; + + uintmax_t remove_all(const path& p); + uintmax_t remove_all(const path& p, error_code& ec); + + void rename(const path& from, const path& to); + void rename(const path& from, const path& to, error_code& ec) noexcept; + + void resize_file(const path& p, uintmax_t size); + void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept; + + space_info space(const path& p); + space_info space(const path& p, error_code& ec) noexcept; + + file_status status(const path& p); + file_status status(const path& p, error_code& ec) noexcept; + + bool status_known(file_status s) noexcept; + + file_status symlink_status(const path& p); + file_status symlink_status(const path& p, error_code& ec) noexcept; + + path temp_directory_path(); + path temp_directory_path(error_code& ec); + + path weakly_canonical(path const& p); + path weakly_canonical(path const& p, error_code& ec); + + +} } // namespaces std::filesystem + +*/ + +#include <__config> +#include <cstddef> +#include <cstdlib> +#include <chrono> +#include <iterator> +#include <iosfwd> +#include <locale> +#include <memory> +#include <stack> +#include <string> +#include <system_error> +#include <utility> +#include <iomanip> // for quoted +#include <string_view> + +#include <__debug> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +#ifndef _LIBCPP_CXX03_LANG + +#if _LIBCPP_STD_VER >= 17 +#define __cpp_lib_filesystem 201703 +#endif + +_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM + +struct _FilesystemClock { +#if !defined(_LIBCPP_HAS_NO_INT128) + typedef __int128_t rep; + typedef nano period; +#else + typedef long long rep; + typedef nano period; +#endif + + typedef chrono::duration<rep, period> duration; + typedef chrono::time_point<_FilesystemClock> time_point; + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false; + + _LIBCPP_FUNC_VIS static time_point now() noexcept; + + _LIBCPP_INLINE_VISIBILITY + static time_t to_time_t(const time_point& __t) noexcept { + typedef chrono::duration<rep> __secs; + return time_t( + chrono::duration_cast<__secs>(__t.time_since_epoch()).count()); + } + + _LIBCPP_INLINE_VISIBILITY + static time_point from_time_t(time_t __t) noexcept { + typedef chrono::duration<rep> __secs; + return time_point(__secs(__t)); + } +}; + +typedef chrono::time_point<_FilesystemClock> file_time_type; + +struct _LIBCPP_TYPE_VIS space_info { + uintmax_t capacity; + uintmax_t free; + uintmax_t available; +}; + +enum class _LIBCPP_ENUM_VIS file_type : signed char { + none = 0, + not_found = -1, + regular = 1, + directory = 2, + symlink = 3, + block = 4, + character = 5, + fifo = 6, + socket = 7, + unknown = 8 +}; + +enum class _LIBCPP_ENUM_VIS perms : unsigned { + none = 0, + + owner_read = 0400, + owner_write = 0200, + owner_exec = 0100, + owner_all = 0700, + + group_read = 040, + group_write = 020, + group_exec = 010, + group_all = 070, + + others_read = 04, + others_write = 02, + others_exec = 01, + others_all = 07, + + all = 0777, + + set_uid = 04000, + set_gid = 02000, + sticky_bit = 01000, + mask = 07777, + unknown = 0xFFFF, +}; + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perms operator&(perms _LHS, perms _RHS) { + return static_cast<perms>(static_cast<unsigned>(_LHS) & + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perms operator|(perms _LHS, perms _RHS) { + return static_cast<perms>(static_cast<unsigned>(_LHS) | + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perms operator^(perms _LHS, perms _RHS) { + return static_cast<perms>(static_cast<unsigned>(_LHS) ^ + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perms operator~(perms _LHS) { + return static_cast<perms>(~static_cast<unsigned>(_LHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline perms& operator&=(perms& _LHS, perms _RHS) { return _LHS = _LHS & _RHS; } + +_LIBCPP_INLINE_VISIBILITY +inline perms& operator|=(perms& _LHS, perms _RHS) { return _LHS = _LHS | _RHS; } + +_LIBCPP_INLINE_VISIBILITY +inline perms& operator^=(perms& _LHS, perms _RHS) { return _LHS = _LHS ^ _RHS; } + +enum class _LIBCPP_ENUM_VIS perm_options : unsigned char { + replace = 1, + add = 2, + remove = 4, + nofollow = 8 +}; + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perm_options operator&(perm_options _LHS, perm_options _RHS) { + return static_cast<perm_options>(static_cast<unsigned>(_LHS) & + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perm_options operator|(perm_options _LHS, perm_options _RHS) { + return static_cast<perm_options>(static_cast<unsigned>(_LHS) | + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perm_options operator^(perm_options _LHS, perm_options _RHS) { + return static_cast<perm_options>(static_cast<unsigned>(_LHS) ^ + static_cast<unsigned>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr perm_options operator~(perm_options _LHS) { + return static_cast<perm_options>(~static_cast<unsigned>(_LHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline perm_options& operator&=(perm_options& _LHS, perm_options _RHS) { + return _LHS = _LHS & _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline perm_options& operator|=(perm_options& _LHS, perm_options _RHS) { + return _LHS = _LHS | _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline perm_options& operator^=(perm_options& _LHS, perm_options _RHS) { + return _LHS = _LHS ^ _RHS; +} + +enum class _LIBCPP_ENUM_VIS copy_options : unsigned short { + none = 0, + skip_existing = 1, + overwrite_existing = 2, + update_existing = 4, + recursive = 8, + copy_symlinks = 16, + skip_symlinks = 32, + directories_only = 64, + create_symlinks = 128, + create_hard_links = 256, + __in_recursive_copy = 512, +}; + +_LIBCPP_INLINE_VISIBILITY +inline constexpr copy_options operator&(copy_options _LHS, copy_options _RHS) { + return static_cast<copy_options>(static_cast<unsigned short>(_LHS) & + static_cast<unsigned short>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr copy_options operator|(copy_options _LHS, copy_options _RHS) { + return static_cast<copy_options>(static_cast<unsigned short>(_LHS) | + static_cast<unsigned short>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr copy_options operator^(copy_options _LHS, copy_options _RHS) { + return static_cast<copy_options>(static_cast<unsigned short>(_LHS) ^ + static_cast<unsigned short>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr copy_options operator~(copy_options _LHS) { + return static_cast<copy_options>(~static_cast<unsigned short>(_LHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline copy_options& operator&=(copy_options& _LHS, copy_options _RHS) { + return _LHS = _LHS & _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline copy_options& operator|=(copy_options& _LHS, copy_options _RHS) { + return _LHS = _LHS | _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline copy_options& operator^=(copy_options& _LHS, copy_options _RHS) { + return _LHS = _LHS ^ _RHS; +} + +enum class _LIBCPP_ENUM_VIS directory_options : unsigned char { + none = 0, + follow_directory_symlink = 1, + skip_permission_denied = 2 +}; + +_LIBCPP_INLINE_VISIBILITY +inline constexpr directory_options operator&(directory_options _LHS, + directory_options _RHS) { + return static_cast<directory_options>(static_cast<unsigned char>(_LHS) & + static_cast<unsigned char>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr directory_options operator|(directory_options _LHS, + directory_options _RHS) { + return static_cast<directory_options>(static_cast<unsigned char>(_LHS) | + static_cast<unsigned char>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr directory_options operator^(directory_options _LHS, + directory_options _RHS) { + return static_cast<directory_options>(static_cast<unsigned char>(_LHS) ^ + static_cast<unsigned char>(_RHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline constexpr directory_options operator~(directory_options _LHS) { + return static_cast<directory_options>(~static_cast<unsigned char>(_LHS)); +} + +_LIBCPP_INLINE_VISIBILITY +inline directory_options& operator&=(directory_options& _LHS, + directory_options _RHS) { + return _LHS = _LHS & _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline directory_options& operator|=(directory_options& _LHS, + directory_options _RHS) { + return _LHS = _LHS | _RHS; +} + +_LIBCPP_INLINE_VISIBILITY +inline directory_options& operator^=(directory_options& _LHS, + directory_options _RHS) { + return _LHS = _LHS ^ _RHS; +} + +class _LIBCPP_TYPE_VIS file_status { +public: + // constructors + _LIBCPP_INLINE_VISIBILITY + file_status() noexcept : file_status(file_type::none) {} + _LIBCPP_INLINE_VISIBILITY + explicit file_status(file_type __ft, perms __prms = perms::unknown) noexcept + : __ft_(__ft), + __prms_(__prms) {} + + file_status(const file_status&) noexcept = default; + file_status(file_status&&) noexcept = default; + + _LIBCPP_INLINE_VISIBILITY + ~file_status() {} + + file_status& operator=(const file_status&) noexcept = default; + file_status& operator=(file_status&&) noexcept = default; + + // observers + _LIBCPP_INLINE_VISIBILITY + file_type type() const noexcept { return __ft_; } + + _LIBCPP_INLINE_VISIBILITY + perms permissions() const noexcept { return __prms_; } + + // modifiers + _LIBCPP_INLINE_VISIBILITY + void type(file_type __ft) noexcept { __ft_ = __ft; } + + _LIBCPP_INLINE_VISIBILITY + void permissions(perms __p) noexcept { __prms_ = __p; } + +private: + file_type __ft_; + perms __prms_; +}; + +class _LIBCPP_TYPE_VIS directory_entry; + +template <class _Tp> +struct __can_convert_char { + static const bool value = false; +}; +template <class _Tp> +struct __can_convert_char<const _Tp> : public __can_convert_char<_Tp> {}; +template <> +struct __can_convert_char<char> { + static const bool value = true; + using __char_type = char; +}; +template <> +struct __can_convert_char<wchar_t> { + static const bool value = true; + using __char_type = wchar_t; +}; +template <> +struct __can_convert_char<char16_t> { + static const bool value = true; + using __char_type = char16_t; +}; +template <> +struct __can_convert_char<char32_t> { + static const bool value = true; + using __char_type = char32_t; +}; + +template <class _ECharT> +typename enable_if<__can_convert_char<_ECharT>::value, bool>::type +__is_separator(_ECharT __e) { + return __e == _ECharT('/'); +}; + +struct _NullSentinal {}; + +template <class _Tp> +using _Void = void; + +template <class _Tp, class = void> +struct __is_pathable_string : public false_type {}; + +template <class _ECharT, class _Traits, class _Alloc> +struct __is_pathable_string< + basic_string<_ECharT, _Traits, _Alloc>, + _Void<typename __can_convert_char<_ECharT>::__char_type> > + : public __can_convert_char<_ECharT> { + using _Str = basic_string<_ECharT, _Traits, _Alloc>; + using _Base = __can_convert_char<_ECharT>; + static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); } + static _ECharT const* __range_end(_Str const& __s) { + return __s.data() + __s.length(); + } + static _ECharT __first_or_null(_Str const& __s) { + return __s.empty() ? _ECharT{} : __s[0]; + } +}; + +template <class _ECharT, class _Traits> +struct __is_pathable_string< + basic_string_view<_ECharT, _Traits>, + _Void<typename __can_convert_char<_ECharT>::__char_type> > + : public __can_convert_char<_ECharT> { + using _Str = basic_string_view<_ECharT, _Traits>; + using _Base = __can_convert_char<_ECharT>; + static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); } + static _ECharT const* __range_end(_Str const& __s) { + return __s.data() + __s.length(); + } + static _ECharT __first_or_null(_Str const& __s) { + return __s.empty() ? _ECharT{} : __s[0]; + } +}; + +template <class _Source, class _DS = typename decay<_Source>::type, + class _UnqualPtrType = + typename remove_const<typename remove_pointer<_DS>::type>::type, + bool _IsCharPtr = is_pointer<_DS>::value&& + __can_convert_char<_UnqualPtrType>::value> +struct __is_pathable_char_array : false_type {}; + +template <class _Source, class _ECharT, class _UPtr> +struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true> + : __can_convert_char<typename remove_const<_ECharT>::type> { + using _Base = __can_convert_char<typename remove_const<_ECharT>::type>; + + 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{}; + _Iter __e = __b; + for (; *__e != __sentinal; ++__e) + ; + return __e; + } + + static _ECharT __first_or_null(const _ECharT* __b) { return *__b; } +}; + +template <class _Iter, bool _IsIt = __is_input_iterator<_Iter>::value, + class = void> +struct __is_pathable_iter : false_type {}; + +template <class _Iter> +struct __is_pathable_iter< + _Iter, true, + _Void<typename __can_convert_char< + typename iterator_traits<_Iter>::value_type>::__char_type> > + : __can_convert_char<typename iterator_traits<_Iter>::value_type> { + using _ECharT = typename iterator_traits<_Iter>::value_type; + using _Base = __can_convert_char<_ECharT>; + + static _Iter __range_begin(_Iter __b) { return __b; } + static _NullSentinal __range_end(_Iter) { return _NullSentinal{}; } + + static _ECharT __first_or_null(_Iter __b) { return *__b; } +}; + +template <class _Tp, bool _IsStringT = __is_pathable_string<_Tp>::value, + bool _IsCharIterT = __is_pathable_char_array<_Tp>::value, + bool _IsIterT = !_IsCharIterT && __is_pathable_iter<_Tp>::value> +struct __is_pathable : false_type { + static_assert(!_IsStringT && !_IsCharIterT && !_IsIterT, "Must all be false"); +}; + +template <class _Tp> +struct __is_pathable<_Tp, true, false, false> : __is_pathable_string<_Tp> {}; + +template <class _Tp> +struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> { +}; + +template <class _Tp> +struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {}; + +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; + + static void __append_range(string& __dest, _ECharT const* __b, + _ECharT const* __e) { + _Narrower()(back_inserter(__dest), __b, __e); + } + + template <class _Iter> + static void __append_range(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); + _Narrower()(back_inserter(__dest), __tmp.data(), + __tmp.data() + __tmp.length()); + } + + template <class _Iter> + static void __append_range(string& __dest, _Iter __b, _NullSentinal) { + static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload"); + const _ECharT __sentinal = _ECharT{}; + if (*__b == __sentinal) + return; + basic_string<_ECharT> __tmp; + for (; *__b != __sentinal; ++__b) + __tmp.push_back(*__b); + _Narrower()(back_inserter(__dest), __tmp.data(), + __tmp.data() + __tmp.length()); + } + + template <class _Source> + static void __append_source(string& __dest, _Source const& __s) { + using _Traits = __is_pathable<_Source>; + __append_range(__dest, _Traits::__range_begin(__s), + _Traits::__range_end(__s)); + } +}; + +template <> +struct _PathCVT<char> { + + template <class _Iter> + static typename enable_if<__is_exactly_input_iterator<_Iter>::value>::type + __append_range(string& __dest, _Iter __b, _Iter __e) { + for (; __b != __e; ++__b) + __dest.push_back(*__b); + } + + template <class _Iter> + static typename enable_if<__is_forward_iterator<_Iter>::value>::type + __append_range(string& __dest, _Iter __b, _Iter __e) { + __dest.__append_forward_unsafe(__b, __e); + } + + template <class _Iter> + static void __append_range(string& __dest, _Iter __b, _NullSentinal) { + const char __sentinal = char{}; + for (; *__b != __sentinal; ++__b) + __dest.push_back(*__b); + } + + template <class _Source> + static void __append_source(string& __dest, _Source const& __s) { + using _Traits = __is_pathable<_Source>; + __append_range(__dest, _Traits::__range_begin(__s), + _Traits::__range_end(__s)); + } +}; + +class _LIBCPP_TYPE_VIS path { + template <class _SourceOrIter, class _Tp = path&> + using _EnableIfPathable = + typename enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type; + + template <class _Tp> + using _SourceChar = typename __is_pathable<_Tp>::__char_type; + + template <class _Tp> + using _SourceCVT = _PathCVT<_SourceChar<_Tp> >; + +public: + typedef char value_type; + typedef basic_string<value_type> string_type; + typedef _VSTD::string_view __string_view; + static constexpr value_type preferred_separator = '/'; + + enum class _LIBCPP_ENUM_VIS format : unsigned char { + auto_format, + native_format, + generic_format + }; + + // constructors and destructor + _LIBCPP_INLINE_VISIBILITY path() noexcept {} + _LIBCPP_INLINE_VISIBILITY path(const path& __p) : __pn_(__p.__pn_) {} + _LIBCPP_INLINE_VISIBILITY path(path&& __p) noexcept + : __pn_(_VSTD::move(__p.__pn_)) {} + + _LIBCPP_INLINE_VISIBILITY + path(string_type&& __s, format = format::auto_format) noexcept + : __pn_(_VSTD::move(__s)) {} + + template <class _Source, class = _EnableIfPathable<_Source, void> > + path(const _Source& __src, format = format::auto_format) { + _SourceCVT<_Source>::__append_source(__pn_, __src); + } + + template <class _InputIt> + path(_InputIt __first, _InputIt __last, format = format::auto_format) { + typedef typename iterator_traits<_InputIt>::value_type _ItVal; + _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); + } + + // 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); + + _LIBCPP_INLINE_VISIBILITY + ~path() = default; + + // assignments + _LIBCPP_INLINE_VISIBILITY + path& operator=(const path& __p) { + __pn_ = __p.__pn_; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& operator=(path&& __p) noexcept { + __pn_ = _VSTD::move(__p.__pn_); + return *this; + } + + template <class = void> + _LIBCPP_INLINE_VISIBILITY path& operator=(string_type&& __s) noexcept { + __pn_ = _VSTD::move(__s); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& assign(string_type&& __s) noexcept { + __pn_ = _VSTD::move(__s); + return *this; + } + + template <class _Source> + _LIBCPP_INLINE_VISIBILITY _EnableIfPathable<_Source> + operator=(const _Source& __src) { + return this->assign(__src); + } + + template <class _Source> + _EnableIfPathable<_Source> assign(const _Source& __src) { + __pn_.clear(); + _SourceCVT<_Source>::__append_source(__pn_, __src); + return *this; + } + + template <class _InputIt> + path& assign(_InputIt __first, _InputIt __last) { + typedef typename iterator_traits<_InputIt>::value_type _ItVal; + __pn_.clear(); + _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); + return *this; + } + +private: + template <class _ECharT> + static bool __source_is_absolute(_ECharT __first_or_null) { + return __is_separator(__first_or_null); + } + +public: + // appends + path& operator/=(const path& __p) { + if (__p.is_absolute()) { + __pn_ = __p.__pn_; + return *this; + } + if (has_filename()) + __pn_ += preferred_separator; + __pn_ += __p.native(); + return *this; + } + + // FIXME: Use _LIBCPP_DIAGNOSE_WARNING to produce a diagnostic when __src + // is known at compile time to be "/' since the user almost certainly intended + // to append a separator instead of overwriting the path with "/" + template <class _Source> + _LIBCPP_INLINE_VISIBILITY _EnableIfPathable<_Source> + operator/=(const _Source& __src) { + return this->append(__src); + } + + template <class _Source> + _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))) + __pn_.clear(); + else if (has_filename()) + __pn_ += preferred_separator; + _CVT::__append_source(__pn_, __src); + return *this; + } + + template <class _InputIt> + path& append(_InputIt __first, _InputIt __last) { + 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)) + __pn_.clear(); + else if (has_filename()) + __pn_ += preferred_separator; + _CVT::__append_range(__pn_, __first, __last); + return *this; + } + + // concatenation + _LIBCPP_INLINE_VISIBILITY + path& operator+=(const path& __x) { + __pn_ += __x.__pn_; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& operator+=(const string_type& __x) { + __pn_ += __x; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& operator+=(__string_view __x) { + __pn_ += __x; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& operator+=(const value_type* __x) { + __pn_ += __x; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + path& operator+=(value_type __x) { + __pn_ += __x; + return *this; + } + + 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); + return *this; + } + + template <class _Source> + _EnableIfPathable<_Source> operator+=(const _Source& __x) { + return this->concat(__x); + } + + template <class _Source> + _EnableIfPathable<_Source> concat(const _Source& __x) { + _SourceCVT<_Source>::__append_source(__pn_, __x); + return *this; + } + + template <class _InputIt> + path& concat(_InputIt __first, _InputIt __last) { + typedef typename iterator_traits<_InputIt>::value_type _ItVal; + _PathCVT<_ItVal>::__append_range(__pn_, __first, __last); + return *this; + } + + // modifiers + _LIBCPP_INLINE_VISIBILITY + void clear() noexcept { __pn_.clear(); } + + path& make_preferred() { return *this; } + + _LIBCPP_INLINE_VISIBILITY + path& remove_filename() { + auto __fname = __filename(); + if (!__fname.empty()) + __pn_.erase(__fname.data() - __pn_.data()); + return *this; + } + + path& replace_filename(const path& __replacement) { + remove_filename(); + return (*this /= __replacement); + } + + path& replace_extension(const path& __replacement = path()); + + _LIBCPP_INLINE_VISIBILITY + void swap(path& __rhs) noexcept { __pn_.swap(__rhs.__pn_); } + + // private helper to allow reserving memory in the path + _LIBCPP_INLINE_VISIBILITY + void __reserve(size_t __s) { __pn_.reserve(__s); } + + // native format observers + _LIBCPP_INLINE_VISIBILITY + const string_type& native() const noexcept { return __pn_; } + + _LIBCPP_INLINE_VISIBILITY + const value_type* c_str() const noexcept { return __pn_.c_str(); } + + _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; } + + template <class _ECharT, class _Traits = char_traits<_ECharT>, + class _Allocator = allocator<_ECharT> > + basic_string<_ECharT, _Traits, _Allocator> + string(const _Allocator& __a = _Allocator()) const { + using _CVT = __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__>; + using _Str = basic_string<_ECharT, _Traits, _Allocator>; + _Str __s(__a); + __s.reserve(__pn_.size()); + _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size()); + return __s; + } + + _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; } + _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const { + return string<wchar_t>(); + } + _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; } + _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const { + return string<char16_t>(); + } + _LIBCPP_INLINE_VISIBILITY std::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 { + 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>(); } + +private: + int __compare(__string_view) const; + __string_view __root_name() const; + __string_view __root_directory() const; + __string_view __root_path_raw() const; + __string_view __relative_path() const; + __string_view __parent_path() const; + __string_view __filename() const; + __string_view __stem() const; + __string_view __extension() const; + +public: + // compare + _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const noexcept { + return __compare(__p.__pn_); + } + _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const { + return __compare(__s); + } + _LIBCPP_INLINE_VISIBILITY int compare(__string_view __s) const { + return __compare(__s); + } + _LIBCPP_INLINE_VISIBILITY int compare(const value_type* __s) const { + return __compare(__s); + } + + // decomposition + _LIBCPP_INLINE_VISIBILITY path root_name() const { + return string_type(__root_name()); + } + _LIBCPP_INLINE_VISIBILITY path root_directory() const { + return string_type(__root_directory()); + } + _LIBCPP_INLINE_VISIBILITY path root_path() const { + return root_name().append(string_type(__root_directory())); + } + _LIBCPP_INLINE_VISIBILITY path relative_path() const { + return string_type(__relative_path()); + } + _LIBCPP_INLINE_VISIBILITY path parent_path() const { + return string_type(__parent_path()); + } + _LIBCPP_INLINE_VISIBILITY path filename() const { + return string_type(__filename()); + } + _LIBCPP_INLINE_VISIBILITY path stem() const { return string_type(__stem()); } + _LIBCPP_INLINE_VISIBILITY path extension() const { + return string_type(__extension()); + } + + // query + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool + empty() const noexcept { + return __pn_.empty(); + } + + _LIBCPP_INLINE_VISIBILITY bool has_root_name() const { + return !__root_name().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { + return !__root_directory().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_root_path() const { + return !__root_path_raw().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_relative_path() const { + return !__relative_path().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_parent_path() const { + return !__parent_path().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_filename() const { + return !__filename().empty(); + } + _LIBCPP_INLINE_VISIBILITY bool has_stem() const { return !__stem().empty(); } + _LIBCPP_INLINE_VISIBILITY bool has_extension() const { + return !__extension().empty(); + } + + _LIBCPP_INLINE_VISIBILITY bool is_absolute() const { + return has_root_directory(); + } + _LIBCPP_INLINE_VISIBILITY bool is_relative() const { return !is_absolute(); } + + // relative paths + path lexically_normal() const; + path lexically_relative(const path& __base) const; + + _LIBCPP_INLINE_VISIBILITY path lexically_proximate(const path& __base) const { + path __result = this->lexically_relative(__base); + if (__result.native().empty()) + return *this; + return __result; + } + + // iterators + class _LIBCPP_TYPE_VIS iterator; + typedef iterator const_iterator; + + iterator begin() const; + iterator end() const; + + template <class _CharT, class _Traits> + _LIBCPP_INLINE_VISIBILITY friend + typename enable_if<is_same<_CharT, char>::value && + is_same<_Traits, char_traits<char> >::value, + basic_ostream<_CharT, _Traits>&>::type + operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) { + __os << std::__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, + basic_ostream<_CharT, _Traits>&>::type + operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) { + __os << std::__quoted(__p.string<_CharT, _Traits>()); + return __os; + } + + template <class _CharT, class _Traits> + _LIBCPP_INLINE_VISIBILITY friend basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, path& __p) { + basic_string<_CharT, _Traits> __tmp; + __is >> __quoted(__tmp); + __p = __tmp; + return __is; + } + +private: + inline _LIBCPP_INLINE_VISIBILITY path& + __assign_view(__string_view const& __s) noexcept { + __pn_ = string_type(__s); + return *this; + } + string_type __pn_; +}; + +inline _LIBCPP_INLINE_VISIBILITY void swap(path& __lhs, path& __rhs) noexcept { + __lhs.swap(__rhs); +} + +_LIBCPP_FUNC_VIS +size_t hash_value(const path& __p) noexcept; + +inline _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) == 0; +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) != 0; +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator<(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) < 0; +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator<=(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) <= 0; +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator>(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) > 0; +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator>=(const path& __lhs, + const path& __rhs) noexcept { + return __lhs.compare(__rhs) >= 0; +} + +inline _LIBCPP_INLINE_VISIBILITY path operator/(const path& __lhs, + const path& __rhs) { + path __result(__lhs); + __result /= __rhs; + return __result; +} + +template <class _Source> +_LIBCPP_INLINE_VISIBILITY + typename enable_if<__is_pathable<_Source>::value, path>::type + u8path(const _Source& __s) { + 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); +} + +template <class _InputIt> +_LIBCPP_INLINE_VISIBILITY + typename enable_if<__is_pathable<_InputIt>::value, path>::type + u8path(_InputIt __f, _InputIt __l) { + static_assert( + 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); +} + +class _LIBCPP_TYPE_VIS path::iterator { +public: + enum _ParserState : unsigned char { + _Singular, + _BeforeBegin, + _InRootName, + _InRootDir, + _InFilenames, + _InTrailingSep, + _AtEnd + }; + +public: + typedef bidirectional_iterator_tag iterator_category; + + typedef path value_type; + typedef std::ptrdiff_t difference_type; + typedef const path* pointer; + typedef const path& reference; + + typedef void + __stashing_iterator_tag; // See reverse_iterator and __is_stashing_iterator + +public: + _LIBCPP_INLINE_VISIBILITY + iterator() + : __stashed_elem_(), __path_ptr_(nullptr), __entry_(), + __state_(_Singular) {} + + iterator(const iterator&) = default; + ~iterator() = default; + + iterator& operator=(const iterator&) = default; + + _LIBCPP_INLINE_VISIBILITY + reference operator*() const { return __stashed_elem_; } + + _LIBCPP_INLINE_VISIBILITY + pointer operator->() const { return &__stashed_elem_; } + + _LIBCPP_INLINE_VISIBILITY + iterator& operator++() { + _LIBCPP_ASSERT(__state_ != _Singular, + "attempting to increment a singular iterator"); + _LIBCPP_ASSERT(__state_ != _AtEnd, + "attempting to increment the end iterator"); + return __increment(); + } + + _LIBCPP_INLINE_VISIBILITY + iterator operator++(int) { + iterator __it(*this); + this->operator++(); + return __it; + } + + _LIBCPP_INLINE_VISIBILITY + iterator& operator--() { + _LIBCPP_ASSERT(__state_ != _Singular, + "attempting to decrement a singular iterator"); + _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(), + "attempting to decrement the begin iterator"); + return __decrement(); + } + + _LIBCPP_INLINE_VISIBILITY + iterator operator--(int) { + iterator __it(*this); + this->operator--(); + return __it; + } + +private: + friend class path; + + inline _LIBCPP_INLINE_VISIBILITY friend bool operator==(const iterator&, + const iterator&); + + iterator& __increment(); + iterator& __decrement(); + + path __stashed_elem_; + const path* __path_ptr_; + path::__string_view __entry_; + _ParserState __state_; +}; + +inline _LIBCPP_INLINE_VISIBILITY bool operator==(const path::iterator& __lhs, + const path::iterator& __rhs) { + return __lhs.__path_ptr_ == __rhs.__path_ptr_ && + __lhs.__entry_.data() == __rhs.__entry_.data(); +} + +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const path::iterator& __lhs, + const path::iterator& __rhs) { + return !(__lhs == __rhs); +} + +class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error { +public: + _LIBCPP_INLINE_VISIBILITY + filesystem_error(const string& __what, error_code __ec) + : system_error(__ec, __what), + __storage_(make_shared<_Storage>(path(), path())) { + __create_what(0); + } + + _LIBCPP_INLINE_VISIBILITY + filesystem_error(const string& __what, const path& __p1, error_code __ec) + : system_error(__ec, __what), + __storage_(make_shared<_Storage>(__p1, path())) { + __create_what(1); + } + + _LIBCPP_INLINE_VISIBILITY + filesystem_error(const string& __what, const path& __p1, const path& __p2, + error_code __ec) + : system_error(__ec, __what), + __storage_(make_shared<_Storage>(__p1, __p2)) { + __create_what(2); + } + + _LIBCPP_INLINE_VISIBILITY + const path& path1() const noexcept { return __storage_->__p1_; } + + _LIBCPP_INLINE_VISIBILITY + const path& path2() const noexcept { return __storage_->__p2_; } + + ~filesystem_error() override; // key function + + _LIBCPP_INLINE_VISIBILITY + const char* what() const noexcept override { + return __storage_->__what_.c_str(); + } + + _LIBCPP_FUNC_VIS + void __create_what(int __num_paths); + +private: + struct _Storage { + _LIBCPP_INLINE_VISIBILITY + _Storage(const path& __p1, const path& __p2) : __p1_(__p1), __p2_(__p2) {} + + path __p1_; + path __p2_; + string __what_; + }; + shared_ptr<_Storage> __storage_; +}; + +template <class... _Args> +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY +#ifndef _LIBCPP_NO_EXCEPTIONS + void + __throw_filesystem_error(_Args&&... __args) { + throw filesystem_error(std::forward<_Args>(__args)...); +} +#else + void + __throw_filesystem_error(_Args&&...) { + _VSTD::abort(); +} +#endif + +// operational functions + +_LIBCPP_FUNC_VIS +path __absolute(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +path __canonical(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +void __copy(const path& __from, const path& __to, copy_options __opt, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +bool __copy_file(const path& __from, const path& __to, copy_options __opt, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +void __copy_symlink(const path& __existing_symlink, const path& __new_symlink, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +bool __create_directories(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +bool __create_directory(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +bool __create_directory(const path& p, const path& attributes, + error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +void __create_directory_symlink(const path& __to, const path& __new_symlink, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +void __create_hard_link(const path& __to, const path& __new_hard_link, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +void __create_symlink(const path& __to, const path& __new_symlink, + error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +path __current_path(error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +void __current_path(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +bool __equivalent(const path&, const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +uintmax_t __file_size(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +uintmax_t __hard_link_count(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +bool __fs_is_empty(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +file_time_type __last_write_time(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +void __last_write_time(const path& p, file_time_type new_time, + error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +void __permissions(const path&, perms, perm_options, error_code* = nullptr); +_LIBCPP_FUNC_VIS +path __read_symlink(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +bool __remove(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +uintmax_t __remove_all(const path& p, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +void __rename(const path& from, const path& to, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +void __resize_file(const path& p, uintmax_t size, error_code* ec = nullptr); +_LIBCPP_FUNC_VIS +space_info __space(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +file_status __status(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +file_status __symlink_status(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +path __system_complete(const path&, error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +path __temp_directory_path(error_code* __ec = nullptr); +_LIBCPP_FUNC_VIS +path __weakly_canonical(path const& __p, error_code* __ec = nullptr); + +inline _LIBCPP_INLINE_VISIBILITY path current_path() { + return __current_path(); +} + +inline _LIBCPP_INLINE_VISIBILITY path current_path(error_code& __ec) { + return __current_path(&__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void current_path(const path& __p) { + __current_path(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY void current_path(const path& __p, + error_code& __ec) noexcept { + __current_path(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path absolute(const path& __p) { + return __absolute(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY path absolute(const path& __p, + error_code& __ec) { + return __absolute(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path canonical(const path& __p) { + return __canonical(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY path canonical(const path& __p, + error_code& __ec) { + return __canonical(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void copy(const path& __from, + const path& __to) { + __copy(__from, __to, copy_options::none); +} + +inline _LIBCPP_INLINE_VISIBILITY void copy(const path& __from, const path& __to, + error_code& __ec) { + __copy(__from, __to, copy_options::none, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void copy(const path& __from, const path& __to, + copy_options __opt) { + __copy(__from, __to, __opt); +} + +inline _LIBCPP_INLINE_VISIBILITY void copy(const path& __from, const path& __to, + copy_options __opt, + error_code& __ec) { + __copy(__from, __to, __opt, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool copy_file(const path& __from, + const path& __to) { + return __copy_file(__from, __to, copy_options::none); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +copy_file(const path& __from, const path& __to, error_code& __ec) { + return __copy_file(__from, __to, copy_options::none, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +copy_file(const path& __from, const path& __to, copy_options __opt) { + return __copy_file(__from, __to, __opt); +} + +inline _LIBCPP_INLINE_VISIBILITY bool copy_file(const path& __from, + const path& __to, + copy_options __opt, + error_code& __ec) { + return __copy_file(__from, __to, __opt, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void copy_symlink(const path& __existing, + const path& __new) { + __copy_symlink(__existing, __new); +} + +inline _LIBCPP_INLINE_VISIBILITY void +copy_symlink(const path& __ext, const path& __new, error_code& __ec) noexcept { + __copy_symlink(__ext, __new, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool create_directories(const path& __p) { + return __create_directories(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY bool create_directories(const path& __p, + error_code& __ec) { + return __create_directories(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool create_directory(const path& __p) { + return __create_directory(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +create_directory(const path& __p, error_code& __ec) noexcept { + return __create_directory(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool create_directory(const path& __p, + const path& __attrs) { + return __create_directory(__p, __attrs); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +create_directory(const path& __p, const path& __attrs, + error_code& __ec) noexcept { + return __create_directory(__p, __attrs, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void +create_directory_symlink(const path& __to, const path& __new) { + __create_directory_symlink(__to, __new); +} + +inline _LIBCPP_INLINE_VISIBILITY void +create_directory_symlink(const path& __to, const path& __new, + error_code& __ec) noexcept { + __create_directory_symlink(__to, __new, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void create_hard_link(const path& __to, + const path& __new) { + __create_hard_link(__to, __new); +} + +inline _LIBCPP_INLINE_VISIBILITY void +create_hard_link(const path& __to, const path& __new, + error_code& __ec) noexcept { + __create_hard_link(__to, __new, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void create_symlink(const path& __to, + const path& __new) { + __create_symlink(__to, __new); +} + +inline _LIBCPP_INLINE_VISIBILITY void +create_symlink(const path& __to, const path& __new, error_code& __ec) noexcept { + return __create_symlink(__to, __new, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool status_known(file_status __s) noexcept { + return __s.type() != file_type::none; +} + +inline _LIBCPP_INLINE_VISIBILITY bool exists(file_status __s) noexcept { + return status_known(__s) && __s.type() != file_type::not_found; +} + +inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p) { + return exists(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p, + error_code& __ec) noexcept { + auto __s = __status(__p, &__ec); + if (status_known(__s)) + __ec.clear(); + return exists(__s); +} + +inline _LIBCPP_INLINE_VISIBILITY bool equivalent(const path& __p1, + const path& __p2) { + return __equivalent(__p1, __p2); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +equivalent(const path& __p1, const path& __p2, error_code& __ec) noexcept { + return __equivalent(__p1, __p2, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t file_size(const path& __p) { + return __file_size(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t +file_size(const path& __p, error_code& __ec) noexcept { + return __file_size(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t hard_link_count(const path& __p) { + return __hard_link_count(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t +hard_link_count(const path& __p, error_code& __ec) noexcept { + return __hard_link_count(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_block_file(file_status __s) noexcept { + return __s.type() == file_type::block; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_block_file(const path& __p) { + return is_block_file(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_block_file(const path& __p, + error_code& __ec) noexcept { + return is_block_file(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +is_character_file(file_status __s) noexcept { + return __s.type() == file_type::character; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_character_file(const path& __p) { + return is_character_file(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +is_character_file(const path& __p, error_code& __ec) noexcept { + return is_character_file(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_directory(file_status __s) noexcept { + return __s.type() == file_type::directory; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_directory(const path& __p) { + return is_directory(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_directory(const path& __p, + error_code& __ec) noexcept { + return is_directory(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_empty(const path& __p) { + return __fs_is_empty(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_empty(const path& __p, + error_code& __ec) { + return __fs_is_empty(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_fifo(file_status __s) noexcept { + return __s.type() == file_type::fifo; +} +inline _LIBCPP_INLINE_VISIBILITY bool is_fifo(const path& __p) { + return is_fifo(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_fifo(const path& __p, + error_code& __ec) noexcept { + return is_fifo(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +is_regular_file(file_status __s) noexcept { + return __s.type() == file_type::regular; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_regular_file(const path& __p) { + return is_regular_file(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool +is_regular_file(const path& __p, error_code& __ec) noexcept { + return is_regular_file(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_socket(file_status __s) noexcept { + return __s.type() == file_type::socket; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_socket(const path& __p) { + return is_socket(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_socket(const path& __p, + error_code& __ec) noexcept { + return is_socket(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_symlink(file_status __s) noexcept { + return __s.type() == file_type::symlink; +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_symlink(const path& __p) { + return is_symlink(__symlink_status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_symlink(const path& __p, + error_code& __ec) noexcept { + return is_symlink(__symlink_status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_other(file_status __s) noexcept { + return exists(__s) && !is_regular_file(__s) && !is_directory(__s) && + !is_symlink(__s); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_other(const path& __p) { + return is_other(__status(__p)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool is_other(const path& __p, + error_code& __ec) noexcept { + return is_other(__status(__p, &__ec)); +} + +inline _LIBCPP_INLINE_VISIBILITY file_time_type +last_write_time(const path& __p) { + return __last_write_time(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY file_time_type +last_write_time(const path& __p, error_code& __ec) noexcept { + return __last_write_time(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void last_write_time(const path& __p, + file_time_type __t) { + __last_write_time(__p, __t); +} + +inline _LIBCPP_INLINE_VISIBILITY void +last_write_time(const path& __p, file_time_type __t, + error_code& __ec) noexcept { + __last_write_time(__p, __t, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void +permissions(const path& __p, perms __prms, + perm_options __opts = perm_options::replace) { + __permissions(__p, __prms, __opts); +} + +inline _LIBCPP_INLINE_VISIBILITY void permissions(const path& __p, perms __prms, + error_code& __ec) noexcept { + __permissions(__p, __prms, perm_options::replace, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void permissions(const path& __p, perms __prms, + perm_options __opts, + error_code& __ec) { + __permissions(__p, __prms, __opts, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path proximate(const path& __p, + const path& __base, + error_code& __ec) { + path __tmp = __weakly_canonical(__p, &__ec); + if (__ec) + return {}; + path __tmp_base = __weakly_canonical(__base, &__ec); + if (__ec) + return {}; + return __tmp.lexically_proximate(__tmp_base); +} + +inline _LIBCPP_INLINE_VISIBILITY path proximate(const path& __p, + error_code& __ec) { + return proximate(__p, current_path(), __ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path +proximate(const path& __p, const path& __base = current_path()) { + return __weakly_canonical(__p).lexically_proximate( + __weakly_canonical(__base)); +} + +inline _LIBCPP_INLINE_VISIBILITY path read_symlink(const path& __p) { + return __read_symlink(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY path read_symlink(const path& __p, + error_code& __ec) { + return __read_symlink(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path relative(const path& __p, + const path& __base, + error_code& __ec) { + path __tmp = __weakly_canonical(__p, &__ec); + if (__ec) + return path(); + path __tmpbase = __weakly_canonical(__base, &__ec); + if (__ec) + return path(); + return __tmp.lexically_relative(__tmpbase); +} + +inline _LIBCPP_INLINE_VISIBILITY path relative(const path& __p, + error_code& __ec) { + return relative(__p, current_path(), __ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path +relative(const path& __p, const path& __base = current_path()) { + return __weakly_canonical(__p).lexically_relative(__weakly_canonical(__base)); +} + +inline _LIBCPP_INLINE_VISIBILITY bool remove(const path& __p) { + return __remove(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY bool remove(const path& __p, + error_code& __ec) noexcept { + return __remove(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t remove_all(const path& __p) { + return __remove_all(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY uintmax_t remove_all(const path& __p, + error_code& __ec) { + return __remove_all(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void rename(const path& __from, + const path& __to) { + return __rename(__from, __to); +} + +inline _LIBCPP_INLINE_VISIBILITY void +rename(const path& __from, const path& __to, error_code& __ec) noexcept { + return __rename(__from, __to, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY void resize_file(const path& __p, + uintmax_t __ns) { + return __resize_file(__p, __ns); +} + +inline _LIBCPP_INLINE_VISIBILITY void +resize_file(const path& __p, uintmax_t __ns, error_code& __ec) noexcept { + return __resize_file(__p, __ns, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY space_info space(const path& __p) { + return __space(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY space_info space(const path& __p, + error_code& __ec) noexcept { + return __space(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY file_status status(const path& __p) { + return __status(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY file_status status(const path& __p, + error_code& __ec) noexcept { + return __status(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY file_status symlink_status(const path& __p) { + return __symlink_status(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY file_status +symlink_status(const path& __p, error_code& __ec) noexcept { + return __symlink_status(__p, &__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path() { + return __temp_directory_path(); +} + +inline _LIBCPP_INLINE_VISIBILITY path temp_directory_path(error_code& __ec) { + return __temp_directory_path(&__ec); +} + +inline _LIBCPP_INLINE_VISIBILITY path weakly_canonical(path const& __p) { + return __weakly_canonical(__p); +} + +inline _LIBCPP_INLINE_VISIBILITY path weakly_canonical(path const& __p, + error_code& __ec) { + return __weakly_canonical(__p, &__ec); +} + +class directory_iterator; +class recursive_directory_iterator; +class __dir_stream; + +class directory_entry { + typedef _VSTD_FS::path _Path; + +public: + // constructors and destructors + directory_entry() noexcept = default; + directory_entry(directory_entry const&) = default; + directory_entry(directory_entry&&) noexcept = default; + + _LIBCPP_INLINE_VISIBILITY + explicit directory_entry(_Path const& __p) : __p_(__p) { + error_code __ec; + __refresh(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + directory_entry(_Path const& __p, error_code& __ec) : __p_(__p) { + __refresh(&__ec); + } + + ~directory_entry() {} + + directory_entry& operator=(directory_entry const&) = default; + directory_entry& operator=(directory_entry&&) noexcept = default; + + _LIBCPP_INLINE_VISIBILITY + void assign(_Path const& __p) { + __p_ = __p; + error_code __ec; + __refresh(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + void assign(_Path const& __p, error_code& __ec) { + __p_ = __p; + __refresh(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + void replace_filename(_Path const& __p) { + __p_.replace_filename(__p); + error_code __ec; + __refresh(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + void replace_filename(_Path const& __p, error_code& __ec) { + __p_ = __p_.parent_path() / __p; + __refresh(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + void refresh() { __refresh(); } + + _LIBCPP_INLINE_VISIBILITY + void refresh(error_code& __ec) noexcept { __refresh(&__ec); } + + _LIBCPP_INLINE_VISIBILITY + _Path const& path() const noexcept { return __p_; } + + _LIBCPP_INLINE_VISIBILITY + operator const _Path&() const noexcept { return __p_; } + + _LIBCPP_INLINE_VISIBILITY + bool exists() const { return _VSTD_FS::exists(file_status{__get_ft()}); } + + _LIBCPP_INLINE_VISIBILITY + bool exists(error_code& __ec) const noexcept { + return _VSTD_FS::exists(file_status{__get_ft(&__ec)}); + } + + _LIBCPP_INLINE_VISIBILITY + bool is_block_file() const { return __get_ft() == file_type::block; } + + _LIBCPP_INLINE_VISIBILITY + bool is_block_file(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::block; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_character_file() const { return __get_ft() == file_type::character; } + + _LIBCPP_INLINE_VISIBILITY + bool is_character_file(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::character; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_directory() const { return __get_ft() == file_type::directory; } + + _LIBCPP_INLINE_VISIBILITY + bool is_directory(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::directory; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_fifo() const { return __get_ft() == file_type::fifo; } + + _LIBCPP_INLINE_VISIBILITY + bool is_fifo(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::fifo; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_other() const { return _VSTD_FS::is_other(file_status{__get_ft()}); } + + _LIBCPP_INLINE_VISIBILITY + bool is_other(error_code& __ec) const noexcept { + return _VSTD_FS::is_other(file_status{__get_ft(&__ec)}); + } + + _LIBCPP_INLINE_VISIBILITY + bool is_regular_file() const { return __get_ft() == file_type::regular; } + + _LIBCPP_INLINE_VISIBILITY + bool is_regular_file(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::regular; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_socket() const { return __get_ft() == file_type::socket; } + + _LIBCPP_INLINE_VISIBILITY + bool is_socket(error_code& __ec) const noexcept { + return __get_ft(&__ec) == file_type::socket; + } + + _LIBCPP_INLINE_VISIBILITY + bool is_symlink() const { return __get_sym_ft() == file_type::symlink; } + + _LIBCPP_INLINE_VISIBILITY + bool is_symlink(error_code& __ec) const noexcept { + return __get_sym_ft(&__ec) == file_type::symlink; + } + _LIBCPP_INLINE_VISIBILITY + uintmax_t file_size() const { return __get_size(); } + + _LIBCPP_INLINE_VISIBILITY + uintmax_t file_size(error_code& __ec) const noexcept { + return __get_size(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + uintmax_t hard_link_count() const { return __get_nlink(); } + + _LIBCPP_INLINE_VISIBILITY + uintmax_t hard_link_count(error_code& __ec) const noexcept { + return __get_nlink(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + file_time_type last_write_time() const { return __get_write_time(); } + + _LIBCPP_INLINE_VISIBILITY + file_time_type last_write_time(error_code& __ec) const noexcept { + return __get_write_time(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + file_status status() const { return __get_status(); } + + _LIBCPP_INLINE_VISIBILITY + file_status status(error_code& __ec) const noexcept { + return __get_status(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + file_status symlink_status() const { return __get_symlink_status(); } + + _LIBCPP_INLINE_VISIBILITY + file_status symlink_status(error_code& __ec) const noexcept { + return __get_symlink_status(&__ec); + } + + _LIBCPP_INLINE_VISIBILITY + bool operator<(directory_entry const& __rhs) const noexcept { + return __p_ < __rhs.__p_; + } + + _LIBCPP_INLINE_VISIBILITY + bool operator==(directory_entry const& __rhs) const noexcept { + return __p_ == __rhs.__p_; + } + + _LIBCPP_INLINE_VISIBILITY + bool operator!=(directory_entry const& __rhs) const noexcept { + return __p_ != __rhs.__p_; + } + + _LIBCPP_INLINE_VISIBILITY + bool operator<=(directory_entry const& __rhs) const noexcept { + return __p_ <= __rhs.__p_; + } + + _LIBCPP_INLINE_VISIBILITY + bool operator>(directory_entry const& __rhs) const noexcept { + return __p_ > __rhs.__p_; + } + + _LIBCPP_INLINE_VISIBILITY + bool operator>=(directory_entry const& __rhs) const noexcept { + return __p_ >= __rhs.__p_; + } + +private: + friend class directory_iterator; + friend class recursive_directory_iterator; + friend class __dir_stream; + + enum _CacheType : unsigned char { + _Empty, + _IterSymlink, + _IterNonSymlink, + _RefreshSymlink, + _RefreshSymlinkUnresolved, + _RefreshNonSymlink + }; + + struct __cached_data { + uintmax_t __size_; + uintmax_t __nlink_; + file_time_type __write_time_; + perms __sym_perms_; + perms __non_sym_perms_; + file_type __type_; + _CacheType __cache_type_; + + _LIBCPP_INLINE_VISIBILITY + __cached_data() noexcept { __reset(); } + + _LIBCPP_INLINE_VISIBILITY + void __reset() { + __cache_type_ = _Empty; + __type_ = file_type::none; + __sym_perms_ = __non_sym_perms_ = perms::unknown; + __size_ = __nlink_ = uintmax_t(-1); + __write_time_ = file_time_type::min(); + } + }; + + _LIBCPP_INLINE_VISIBILITY + static __cached_data __create_iter_result(file_type __ft) { + __cached_data __data; + __data.__type_ = __ft; + __data.__cache_type_ = [&]() { + switch (__ft) { + case file_type::none: + return _Empty; + case file_type::symlink: + return _IterSymlink; + default: + return _IterNonSymlink; + } + }(); + return __data; + } + + _LIBCPP_INLINE_VISIBILITY + void __assign_iter_entry(_Path&& __p, __cached_data __dt) { + __p_ = std::move(__p); + __data_ = __dt; + } + + _LIBCPP_FUNC_VIS + error_code __do_refresh() noexcept; + + _LIBCPP_INLINE_VISIBILITY + static bool __is_dne_error(error_code const& __ec) { + if (!__ec) + return true; + switch (static_cast<errc>(__ec.value())) { + case errc::no_such_file_or_directory: + case errc::not_a_directory: + return true; + default: + return false; + } + } + + _LIBCPP_INLINE_VISIBILITY + void __handle_error(const char* __msg, error_code* __dest_ec, + error_code const& __ec, bool __allow_dne = false) const { + if (__dest_ec) { + *__dest_ec = __ec; + return; + } + if (__ec && (!__allow_dne || !__is_dne_error(__ec))) + __throw_filesystem_error(__msg, __p_, __ec); + } + + _LIBCPP_INLINE_VISIBILITY + void __refresh(error_code* __ec = nullptr) { + __handle_error("in directory_entry::refresh", __ec, __do_refresh(), + /*allow_dne*/ true); + } + + _LIBCPP_INLINE_VISIBILITY + file_type __get_sym_ft(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + return __symlink_status(__p_, __ec).type(); + case _IterSymlink: + case _RefreshSymlink: + case _RefreshSymlinkUnresolved: + if (__ec) + __ec->clear(); + return file_type::symlink; + case _IterNonSymlink: + case _RefreshNonSymlink: + file_status __st(__data_.__type_); + if (__ec && !_VSTD_FS::exists(__st)) + *__ec = make_error_code(errc::no_such_file_or_directory); + else if (__ec) + __ec->clear(); + return __data_.__type_; + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + file_type __get_ft(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterSymlink: + case _RefreshSymlinkUnresolved: + return __status(__p_, __ec).type(); + case _IterNonSymlink: + case _RefreshNonSymlink: + case _RefreshSymlink: { + file_status __st(__data_.__type_); + if (__ec && !_VSTD_FS::exists(__st)) + *__ec = make_error_code(errc::no_such_file_or_directory); + else if (__ec) + __ec->clear(); + return __data_.__type_; + } + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + file_status __get_status(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterNonSymlink: + case _IterSymlink: + case _RefreshSymlinkUnresolved: + return __status(__p_, __ec); + case _RefreshNonSymlink: + case _RefreshSymlink: + return file_status(__get_ft(__ec), __data_.__non_sym_perms_); + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + file_status __get_symlink_status(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterNonSymlink: + case _IterSymlink: + return __symlink_status(__p_, __ec); + case _RefreshNonSymlink: + return file_status(__get_sym_ft(__ec), __data_.__non_sym_perms_); + case _RefreshSymlink: + case _RefreshSymlinkUnresolved: + return file_status(__get_sym_ft(__ec), __data_.__sym_perms_); + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + uintmax_t __get_size(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterNonSymlink: + case _IterSymlink: + case _RefreshSymlinkUnresolved: + return _VSTD_FS::__file_size(__p_, __ec); + case _RefreshSymlink: + case _RefreshNonSymlink: { + error_code __m_ec; + file_status __st(__get_ft(&__m_ec)); + __handle_error("in directory_entry::file_size", __ec, __m_ec); + if (_VSTD_FS::exists(__st) && !_VSTD_FS::is_regular_file(__st)) { + errc __err_kind = _VSTD_FS::is_directory(__st) ? errc::is_a_directory + : errc::not_supported; + __handle_error("in directory_entry::file_size", __ec, + make_error_code(__err_kind)); + } + return __data_.__size_; + } + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + uintmax_t __get_nlink(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterNonSymlink: + case _IterSymlink: + case _RefreshSymlinkUnresolved: + return _VSTD_FS::__hard_link_count(__p_, __ec); + case _RefreshSymlink: + case _RefreshNonSymlink: { + error_code __m_ec; + (void)__get_ft(&__m_ec); + __handle_error("in directory_entry::hard_link_count", __ec, __m_ec); + return __data_.__nlink_; + } + } + _LIBCPP_UNREACHABLE(); + } + + _LIBCPP_INLINE_VISIBILITY + file_time_type __get_write_time(error_code* __ec = nullptr) const { + switch (__data_.__cache_type_) { + case _Empty: + case _IterNonSymlink: + case _IterSymlink: + case _RefreshSymlinkUnresolved: + return _VSTD_FS::__last_write_time(__p_, __ec); + case _RefreshSymlink: + case _RefreshNonSymlink: { + error_code __m_ec; + file_status __st(__get_ft(&__m_ec)); + __handle_error("in directory_entry::last_write_time", __ec, __m_ec); + if (_VSTD_FS::exists(__st) && + __data_.__write_time_ == file_time_type::min()) + __handle_error("in directory_entry::last_write_time", __ec, + make_error_code(errc::value_too_large)); + return __data_.__write_time_; + } + } + _LIBCPP_UNREACHABLE(); + } + +private: + _Path __p_; + __cached_data __data_; +}; + +class __dir_element_proxy { +public: + inline _LIBCPP_INLINE_VISIBILITY directory_entry operator*() { + return _VSTD::move(__elem_); + } + +private: + friend class directory_iterator; + friend class recursive_directory_iterator; + explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {} + __dir_element_proxy(__dir_element_proxy&& __o) + : __elem_(_VSTD::move(__o.__elem_)) {} + directory_entry __elem_; +}; + +class directory_iterator { +public: + typedef directory_entry value_type; + typedef ptrdiff_t difference_type; + typedef value_type const* pointer; + typedef value_type const& reference; + typedef input_iterator_tag iterator_category; + +public: + //ctor & dtor + directory_iterator() noexcept {} + + explicit directory_iterator(const path& __p) + : directory_iterator(__p, nullptr) {} + + directory_iterator(const path& __p, directory_options __opts) + : directory_iterator(__p, nullptr, __opts) {} + + directory_iterator(const path& __p, error_code& __ec) + : directory_iterator(__p, &__ec) {} + + directory_iterator(const path& __p, directory_options __opts, + error_code& __ec) + : directory_iterator(__p, &__ec, __opts) {} + + directory_iterator(const directory_iterator&) = default; + directory_iterator(directory_iterator&&) = default; + directory_iterator& operator=(const directory_iterator&) = default; + + directory_iterator& operator=(directory_iterator&& __o) noexcept { + // non-default implementation provided to support self-move assign. + if (this != &__o) { + __imp_ = _VSTD::move(__o.__imp_); + } + return *this; + } + + ~directory_iterator() = default; + + const directory_entry& operator*() const { + _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced"); + return __dereference(); + } + + const directory_entry* operator->() const { return &**this; } + + directory_iterator& operator++() { return __increment(); } + + __dir_element_proxy operator++(int) { + __dir_element_proxy __p(**this); + __increment(); + return __p; + } + + directory_iterator& increment(error_code& __ec) { return __increment(&__ec); } + +private: + inline _LIBCPP_INLINE_VISIBILITY friend bool + operator==(const directory_iterator& __lhs, + const directory_iterator& __rhs) noexcept; + + // construct the dir_stream + _LIBCPP_FUNC_VIS + directory_iterator(const path&, error_code*, + directory_options = directory_options::none); + + _LIBCPP_FUNC_VIS + directory_iterator& __increment(error_code* __ec = nullptr); + + _LIBCPP_FUNC_VIS + const directory_entry& __dereference() const; + +private: + shared_ptr<__dir_stream> __imp_; +}; + +inline _LIBCPP_INLINE_VISIBILITY bool +operator==(const directory_iterator& __lhs, + const directory_iterator& __rhs) noexcept { + return __lhs.__imp_ == __rhs.__imp_; +} + +inline _LIBCPP_INLINE_VISIBILITY bool +operator!=(const directory_iterator& __lhs, + const directory_iterator& __rhs) noexcept { + return !(__lhs == __rhs); +} + +// enable directory_iterator range-based for statements +inline _LIBCPP_INLINE_VISIBILITY directory_iterator +begin(directory_iterator __iter) noexcept { + return __iter; +} + +inline _LIBCPP_INLINE_VISIBILITY directory_iterator +end(const directory_iterator&) noexcept { + return directory_iterator(); +} + +class recursive_directory_iterator { +public: + using value_type = directory_entry; + using difference_type = std::ptrdiff_t; + using pointer = directory_entry const*; + using reference = directory_entry const&; + using iterator_category = std::input_iterator_tag; + +public: + // constructors and destructor + _LIBCPP_INLINE_VISIBILITY + recursive_directory_iterator() noexcept : __rec_(false) {} + + _LIBCPP_INLINE_VISIBILITY + explicit recursive_directory_iterator( + const path& __p, directory_options __xoptions = directory_options::none) + : recursive_directory_iterator(__p, __xoptions, nullptr) {} + + _LIBCPP_INLINE_VISIBILITY + recursive_directory_iterator(const path& __p, directory_options __xoptions, + error_code& __ec) + : recursive_directory_iterator(__p, __xoptions, &__ec) {} + + _LIBCPP_INLINE_VISIBILITY + recursive_directory_iterator(const path& __p, error_code& __ec) + : recursive_directory_iterator(__p, directory_options::none, &__ec) {} + + recursive_directory_iterator(const recursive_directory_iterator&) = default; + recursive_directory_iterator(recursive_directory_iterator&&) = default; + + recursive_directory_iterator& + operator=(const recursive_directory_iterator&) = default; + + _LIBCPP_INLINE_VISIBILITY + recursive_directory_iterator& + operator=(recursive_directory_iterator&& __o) noexcept { + // non-default implementation provided to support self-move assign. + if (this != &__o) { + __imp_ = _VSTD::move(__o.__imp_); + __rec_ = __o.__rec_; + } + return *this; + } + + ~recursive_directory_iterator() = default; + + _LIBCPP_INLINE_VISIBILITY + const directory_entry& operator*() const { return __dereference(); } + + _LIBCPP_INLINE_VISIBILITY + const directory_entry* operator->() const { return &__dereference(); } + + recursive_directory_iterator& operator++() { return __increment(); } + + _LIBCPP_INLINE_VISIBILITY + __dir_element_proxy operator++(int) { + __dir_element_proxy __p(**this); + __increment(); + return __p; + } + + _LIBCPP_INLINE_VISIBILITY + recursive_directory_iterator& increment(error_code& __ec) { + return __increment(&__ec); + } + + _LIBCPP_FUNC_VIS directory_options options() const; + _LIBCPP_FUNC_VIS int depth() const; + + _LIBCPP_INLINE_VISIBILITY + void pop() { __pop(); } + + _LIBCPP_INLINE_VISIBILITY + void pop(error_code& __ec) { __pop(&__ec); } + + _LIBCPP_INLINE_VISIBILITY + bool recursion_pending() const { return __rec_; } + + _LIBCPP_INLINE_VISIBILITY + void disable_recursion_pending() { __rec_ = false; } + +private: + recursive_directory_iterator(const path& __p, directory_options __opt, + error_code* __ec); + + _LIBCPP_FUNC_VIS + const directory_entry& __dereference() const; + + _LIBCPP_FUNC_VIS + bool __try_recursion(error_code* __ec); + + _LIBCPP_FUNC_VIS + void __advance(error_code* __ec = nullptr); + + _LIBCPP_FUNC_VIS + recursive_directory_iterator& __increment(error_code* __ec = nullptr); + + _LIBCPP_FUNC_VIS + void __pop(error_code* __ec = nullptr); + + inline _LIBCPP_INLINE_VISIBILITY friend bool + operator==(const recursive_directory_iterator&, + const recursive_directory_iterator&) noexcept; + + struct __shared_imp; + shared_ptr<__shared_imp> __imp_; + bool __rec_; +}; // class recursive_directory_iterator + +inline _LIBCPP_INLINE_VISIBILITY bool +operator==(const recursive_directory_iterator& __lhs, + const recursive_directory_iterator& __rhs) noexcept { + return __lhs.__imp_ == __rhs.__imp_; +} + +_LIBCPP_INLINE_VISIBILITY +inline bool operator!=(const recursive_directory_iterator& __lhs, + const recursive_directory_iterator& __rhs) noexcept { + return !(__lhs == __rhs); +} +// enable recursive_directory_iterator range-based for statements +inline _LIBCPP_INLINE_VISIBILITY recursive_directory_iterator +begin(recursive_directory_iterator __iter) noexcept { + return __iter; +} + +inline _LIBCPP_INLINE_VISIBILITY recursive_directory_iterator +end(const recursive_directory_iterator&) noexcept { + return recursive_directory_iterator(); +} + +_LIBCPP_END_NAMESPACE_FILESYSTEM + +#endif // !_LIBCPP_CXX03_LANG + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP_FILESYSTEM diff --git a/include/forward_list b/include/forward_list index 7b82041372018..571afdc925b04 100644 --- a/include/forward_list +++ b/include/forward_list @@ -134,6 +134,11 @@ public: void reverse() noexcept; }; + +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + forward_list(InputIterator, InputIterator, Allocator = Allocator()) + -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 + template <class T, class Allocator> bool operator==(const forward_list<T, Allocator>& x, const forward_list<T, Allocator>& y); @@ -452,6 +457,10 @@ protected: typedef typename allocator_traits<__begin_node_allocator>::pointer __begin_node_pointer; + static_assert((!is_same<allocator_type, __node_allocator>::value), + "internal allocator type must differ from user-specified " + "type; otherwise overload resolution breaks"); + __compressed_pair<__begin_node, __node_allocator> __before_begin_; _LIBCPP_INLINE_VISIBILITY @@ -476,9 +485,11 @@ protected: _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value) : __before_begin_(__begin_node()) {} _LIBCPP_INLINE_VISIBILITY - __forward_list_base(const allocator_type& __a) + explicit __forward_list_base(const allocator_type& __a) : __before_begin_(__begin_node(), __node_allocator(__a)) {} - + _LIBCPP_INLINE_VISIBILITY + explicit __forward_list_base(const __node_allocator& __a) + : __before_begin_(__begin_node(), __a) {} #ifndef _LIBCPP_CXX03_LANG public: _LIBCPP_INLINE_VISIBILITY @@ -845,6 +856,23 @@ private: __sort(__node_pointer __f, difference_type __sz, _Compare& __comp); }; + +#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 + > +forward_list(_InputIterator, _InputIterator) + -> forward_list<typename iterator_traits<_InputIterator>::value_type, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +forward_list(_InputIterator, _InputIterator, _Alloc) + -> forward_list<typename iterator_traits<_InputIterator>::value_type, _Alloc>; +#endif + template <class _Tp, class _Alloc> inline forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a) @@ -932,12 +960,9 @@ forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l, template <class _Tp, class _Alloc> forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x) - : base(allocator_type( - __node_traits::select_on_container_copy_construction(__x.__alloc()) - ) - ) -{ - insert_after(cbefore_begin(), __x.begin(), __x.end()); + : base( + __node_traits::select_on_container_copy_construction(__x.__alloc())) { + insert_after(cbefore_begin(), __x.begin(), __x.end()); } template <class _Tp, class _Alloc> diff --git a/include/fstream b/include/fstream index f57908c8dfaf4..332b4747c1af0 100644 --- a/include/fstream +++ b/include/fstream @@ -38,6 +38,7 @@ public: bool is_open() const; basic_filebuf* open(const char* s, ios_base::openmode mode); basic_filebuf* open(const string& s, ios_base::openmode mode); + basic_filebuf* open(const filesystem::path& p, ios_base::openmode mode); // C++17 basic_filebuf* close(); protected: @@ -77,6 +78,8 @@ public: basic_ifstream(); explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); + explicit basic_ifstream(const filesystem::path& p, + ios_base::openmode mode = ios_base::in); // C++17 basic_ifstream(basic_ifstream&& rhs); basic_ifstream& operator=(basic_ifstream&& rhs); @@ -86,6 +89,8 @@ public: bool is_open() const; void open(const char* s, ios_base::openmode mode = ios_base::in); void open(const string& s, ios_base::openmode mode = ios_base::in); + void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in); // C++17 + void close(); }; @@ -110,6 +115,8 @@ public: basic_ofstream(); explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); + explicit basic_ofstream(const filesystem::path& p, + ios_base::openmode mode = ios_base::out); // C++17 basic_ofstream(basic_ofstream&& rhs); basic_ofstream& operator=(basic_ofstream&& rhs); @@ -119,6 +126,9 @@ public: bool is_open() const; void open(const char* s, ios_base::openmode mode = ios_base::out); void open(const string& s, ios_base::openmode mode = ios_base::out); + void open(const filesystem::path& p, + ios_base::openmode mode = ios_base::out); // C++17 + void close(); }; @@ -143,6 +153,8 @@ public: basic_fstream(); explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); + explicit basic_fstream(const filesystem::path& p, + ios_base::openmode mode = ios_base::in|ios_base::out); C++17 basic_fstream(basic_fstream&& rhs); basic_fstream& operator=(basic_fstream&& rhs); @@ -152,6 +164,9 @@ public: bool is_open() const; void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); void open(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); + void open(const filesystem::path& s, + ios_base::openmode mode = ios_base::in|ios_base::out); // C++17 + void close(); }; @@ -170,6 +185,8 @@ typedef basic_fstream<wchar_t> wfstream; #include <istream> #include <__locale> #include <cstdio> +#include <cstdlib> +#include <filesystem> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -212,12 +229,28 @@ public: bool is_open() const; #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE basic_filebuf* open(const char* __s, ios_base::openmode __mode); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode); +#endif _LIBCPP_INLINE_VISIBILITY basic_filebuf* open(const string& __s, ios_base::openmode __mode); + +#if _LIBCPP_STD_VER >= 17 + _LIBCPP_INLINE_VISIBILITY + basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) { + return open(__p.c_str(), __mode); + } +#endif + _LIBCPP_INLINE_VISIBILITY + basic_filebuf* __open(int __fd, ios_base::openmode __mode); #endif basic_filebuf* close(); -protected: + _LIBCPP_INLINE_VISIBILITY + inline static const char* + __make_mdstring(ios_base::openmode __mode) _NOEXCEPT; + + protected: // 27.9.1.5 Overridden virtual functions: virtual int_type underflow(); virtual int_type pbackfail(int_type __c = traits_type::eof()); @@ -231,25 +264,25 @@ protected: virtual void imbue(const locale& __loc); private: - char* __extbuf_; - const char* __extbufnext_; - const char* __extbufend_; - char __extbuf_min_[8]; - size_t __ebs_; - char_type* __intbuf_; - size_t __ibs_; - FILE* __file_; - const codecvt<char_type, char, state_type>* __cv_; - state_type __st_; - state_type __st_last_; - ios_base::openmode __om_; - ios_base::openmode __cm_; - bool __owns_eb_; - bool __owns_ib_; - bool __always_noconv_; - - bool __read_mode(); - void __write_mode(); + char* __extbuf_; + const char* __extbufnext_; + const char* __extbufend_; + char __extbuf_min_[8]; + size_t __ebs_; + char_type* __intbuf_; + size_t __ibs_; + FILE* __file_; + const codecvt<char_type, char, state_type>* __cv_; + state_type __st_; + state_type __st_last_; + ios_base::openmode __om_; + ios_base::openmode __cm_; + bool __owns_eb_; + bool __owns_ib_; + bool __always_noconv_; + + bool __read_mode(); + void __write_mode(); }; template <class _CharT, class _Traits> @@ -470,6 +503,46 @@ basic_filebuf<_CharT, _Traits>::is_open() const return __file_ != 0; } +template <class _CharT, class _Traits> +const char* basic_filebuf<_CharT, _Traits>::__make_mdstring( + ios_base::openmode __mode) _NOEXCEPT { + switch (__mode & ~ios_base::ate) { + case ios_base::out: + case ios_base::out | ios_base::trunc: + return "w"; + case ios_base::out | ios_base::app: + case ios_base::app: + return "a"; + case ios_base::in: + return "r"; + case ios_base::in | ios_base::out: + return "r+"; + case ios_base::in | ios_base::out | ios_base::trunc: + return "w+"; + case ios_base::in | ios_base::out | ios_base::app: + case ios_base::in | ios_base::app: + return "a+"; + case ios_base::out | ios_base::binary: + case ios_base::out | ios_base::trunc | ios_base::binary: + return "wb"; + case ios_base::out | ios_base::app | ios_base::binary: + case ios_base::app | ios_base::binary: + return "ab"; + case ios_base::in | ios_base::binary: + return "rb"; + case ios_base::in | ios_base::out | ios_base::binary: + return "r+b"; + case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary: + return "w+b"; + case ios_base::in | ios_base::out | ios_base::app | ios_base::binary: + case ios_base::in | ios_base::app | ios_base::binary: + return "a+b"; + default: + return nullptr; + } + _LIBCPP_UNREACHABLE(); +} + #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE template <class _CharT, class _Traits> basic_filebuf<_CharT, _Traits>* @@ -478,51 +551,104 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) basic_filebuf<_CharT, _Traits>* __rt = 0; if (__file_ == 0) { + if (const char* __mdstr = __make_mdstring(__mode)) { __rt = this; - const char* __mdstr; + __file_ = fopen(__s, __mdstr); + if (__file_) { + __om_ = __mode; + if (__mode & ios_base::ate) { + if (fseek(__file_, 0, SEEK_END)) { + fclose(__file_); + __file_ = 0; + __rt = 0; + } + } + } else + __rt = 0; + } + } + return __rt; +} + +template <class _CharT, class _Traits> +_LIBCPP_INLINE_VISIBILITY basic_filebuf<_CharT, _Traits>* +basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) { + basic_filebuf<_CharT, _Traits>* __rt = 0; + if (__file_ == 0) { + if (const char* __mdstr = __make_mdstring(__mode)) { + __rt = this; + __file_ = fdopen(__fd, __mdstr); + if (__file_) { + __om_ = __mode; + if (__mode & ios_base::ate) { + if (fseek(__file_, 0, SEEK_END)) { + fclose(__file_); + __file_ = 0; + __rt = 0; + } + } + } else + __rt = 0; + } + } + return __rt; +} + +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +// This is basically the same as the char* overload except that it uses _wfopen +// and long mode strings. +template <class _CharT, class _Traits> +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) + { + __rt = this; + const wchar_t* __mdstr; switch (__mode & ~ios_base::ate) { case ios_base::out: case ios_base::out | ios_base::trunc: - __mdstr = "w"; + __mdstr = L"w"; break; case ios_base::out | ios_base::app: case ios_base::app: - __mdstr = "a"; + __mdstr = L"a"; break; case ios_base::in: - __mdstr = "r"; + __mdstr = L"r"; break; case ios_base::in | ios_base::out: - __mdstr = "r+"; + __mdstr = L"r+"; break; case ios_base::in | ios_base::out | ios_base::trunc: - __mdstr = "w+"; + __mdstr = L"w+"; break; case ios_base::in | ios_base::out | ios_base::app: case ios_base::in | ios_base::app: - __mdstr = "a+"; + __mdstr = L"a+"; break; case ios_base::out | ios_base::binary: case ios_base::out | ios_base::trunc | ios_base::binary: - __mdstr = "wb"; + __mdstr = L"wb"; break; case ios_base::out | ios_base::app | ios_base::binary: case ios_base::app | ios_base::binary: - __mdstr = "ab"; + __mdstr = L"ab"; break; case ios_base::in | ios_base::binary: - __mdstr = "rb"; + __mdstr = L"rb"; break; case ios_base::in | ios_base::out | ios_base::binary: - __mdstr = "r+b"; + __mdstr = L"r+b"; break; case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary: - __mdstr = "w+b"; + __mdstr = L"w+b"; break; case ios_base::in | ios_base::out | ios_base::app | ios_base::binary: case ios_base::in | ios_base::app | ios_base::binary: - __mdstr = "a+b"; + __mdstr = L"a+b"; break; default: __rt = 0; @@ -530,7 +656,7 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) } if (__rt) { - __file_ = fopen(__s, __mdstr); + __file_ = _wfopen(__s, __mdstr); if (__file_) { __om_ = __mode; @@ -550,6 +676,7 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) } return __rt; } +#endif template <class _CharT, class _Traits> inline @@ -1017,8 +1144,17 @@ public: #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + _LIBCPP_INLINE_VISIBILITY + explicit basic_ifstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); +#endif _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); +#if _LIBCPP_STD_VER >= 17 + _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 @@ -1036,7 +1172,20 @@ public: bool is_open() const; #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::in); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + 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 + _LIBCPP_INLINE_VISIBILITY + void open(const filesystem::path& __p, + ios_base::openmode __mode = ios_base::in) { + return open(__p.c_str(), __mode); + } +#endif // _LIBCPP_STD_VER >= 17 + + _LIBCPP_INLINE_VISIBILITY + void __open(int __fd, ios_base::openmode __mode); #endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1062,6 +1211,17 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openm this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +inline +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) + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> inline basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode) @@ -1139,6 +1299,18 @@ basic_ifstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +void +basic_ifstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +{ + if (__sb_.open(__s, __mode | ios_base::in)) + this->clear(); + else + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> void basic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode) @@ -1148,6 +1320,15 @@ basic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo else this->setstate(ios_base::failbit); } + +template <class _CharT, class _Traits> +void basic_ifstream<_CharT, _Traits>::__open(int __fd, + ios_base::openmode __mode) { + if (__sb_.__open(__fd, __mode | ios_base::in)) + this->clear(); + else + this->setstate(ios_base::failbit); +} #endif template <class _CharT, class _Traits> @@ -1176,8 +1357,19 @@ public: basic_ofstream(); _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + _LIBCPP_INLINE_VISIBILITY + explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); +#endif _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); + +#if _LIBCPP_STD_VER >= 17 + _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); @@ -1194,7 +1386,19 @@ public: bool is_open() const; #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::out); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); +#endif void open(const string& __s, ios_base::openmode __mode = ios_base::out); + +#if _LIBCPP_STD_VER >= 17 + _LIBCPP_INLINE_VISIBILITY + void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out) + { return open(__p.c_str(), __mode); } +#endif // _LIBCPP_STD_VER >= 17 + + _LIBCPP_INLINE_VISIBILITY + void __open(int __fd, ios_base::openmode __mode); #endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1220,6 +1424,17 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openm this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +inline +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) + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> inline basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode) @@ -1297,6 +1512,18 @@ basic_ofstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +void +basic_ofstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +{ + if (__sb_.open(__s, __mode | ios_base::out)) + this->clear(); + else + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> void basic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode) @@ -1306,6 +1533,15 @@ basic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo else this->setstate(ios_base::failbit); } + +template <class _CharT, class _Traits> +void basic_ofstream<_CharT, _Traits>::__open(int __fd, + ios_base::openmode __mode) { + if (__sb_.__open(__fd, __mode | ios_base::out)) + this->clear(); + else + this->setstate(ios_base::failbit); +} #endif template <class _CharT, class _Traits> @@ -1335,8 +1571,19 @@ public: #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + _LIBCPP_INLINE_VISIBILITY + explicit basic_fstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); +#endif _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); + +#if _LIBCPP_STD_VER >= 17 + _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 @@ -1354,7 +1601,17 @@ public: bool is_open() const; #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); +#endif void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); + +#if _LIBCPP_STD_VER >= 17 + _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); } +#endif // _LIBCPP_STD_VER >= 17 + #endif _LIBCPP_INLINE_VISIBILITY void close(); @@ -1380,6 +1637,17 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmod this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +inline +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) + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> inline basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode) @@ -1457,6 +1725,18 @@ basic_fstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) this->setstate(ios_base::failbit); } +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +template <class _CharT, class _Traits> +void +basic_fstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +{ + if (__sb_.open(__s, __mode)) + this->clear(); + else + this->setstate(ios_base::failbit); +} +#endif + template <class _CharT, class _Traits> void basic_fstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode) diff --git a/include/functional b/include/functional index f73c3ca56a8e3..80261895e6e5c 100644 --- a/include/functional +++ b/include/functional @@ -213,9 +213,9 @@ template<class T> struct is_bind_expression; template<class T> struct is_placeholder; // See C++14 20.9.9, Function object binders -template <class T> constexpr bool is_bind_expression_v +template <class T> inline constexpr bool is_bind_expression_v = is_bind_expression<T>::value; // C++17 -template <class T> constexpr int is_placeholder_v +template <class T> inline constexpr int is_placeholder_v = is_placeholder<T>::value; // C++17 @@ -1399,7 +1399,7 @@ public: #endif }; -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_bad_function_call() { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -1818,11 +1818,7 @@ template<class _Rp, class ..._ArgTypes> function<_Rp(_ArgTypes...)>& function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT { - if ((void *)__f_ == &__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); - __f_ = 0; + *this = nullptr; if (__f.__f_ == 0) __f_ = 0; else if ((void *)__f.__f_ == &__f.__buf_) @@ -1842,11 +1838,12 @@ template<class _Rp, class ..._ArgTypes> function<_Rp(_ArgTypes...)>& function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT { - if ((void *)__f_ == &__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); + __base* __t = __f_; __f_ = 0; + if ((void *)__t == &__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); return *this; } @@ -1991,7 +1988,7 @@ template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression #if _LIBCPP_STD_VER > 14 template <class _Tp> -constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value; +_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> {}; @@ -2000,7 +1997,7 @@ template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder #if _LIBCPP_STD_VER > 14 template <class _Tp> -constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value; #endif namespace placeholders @@ -2020,16 +2017,16 @@ _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 -constexpr __ph<1> _1{}; -constexpr __ph<2> _2{}; -constexpr __ph<3> _3{}; -constexpr __ph<4> _4{}; -constexpr __ph<5> _5{}; -constexpr __ph<6> _6{}; -constexpr __ph<7> _7{}; -constexpr __ph<8> _8{}; -constexpr __ph<9> _9{}; -constexpr __ph<10> _10{}; +/* _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_BIND) } // placeholders @@ -2411,6 +2408,117 @@ __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) { // 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 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 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 make_pair(__first1, __m1); + if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found + return 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 make_pair(__first1, __first1); + const _D1 __len1 = __last1 - __first1; + if (__len1 < __len2) + return 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 make_pair(__last1, __last1); + if (__pred(*__first1, *__first2)) + break; + ++__first1; + } + + _RandomAccessIterator1 __m1 = __first1; + _RandomAccessIterator2 __m2 = __first2; + while (true) + { + if (++__m2 == __last2) + return 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 + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_FUNCTIONAL diff --git a/include/future b/include/future index a7c28a4746cf6..0f6d42678ef5c 100644 --- a/include/future +++ b/include/future @@ -409,7 +409,7 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch) #ifndef _LIBCPP_HAS_NO_STRONG_ENUMS -#ifdef _LIBCXX_UNDERLYING_TYPE +#ifdef _LIBCPP_UNDERLYING_TYPE typedef underlying_type<launch>::type __launch_underlying_type; #else typedef int __launch_underlying_type; @@ -514,7 +514,7 @@ public: virtual ~future_error() _NOEXCEPT; }; -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_NO_EXCEPTIONS _LIBCPP_AVAILABILITY_FUTURE_ERROR #endif @@ -2021,7 +2021,7 @@ public: class = typename enable_if < !is_same< - typename decay<_Fp>::type, + typename __uncvref<_Fp>::type, packaged_task >::value >::type @@ -2032,7 +2032,7 @@ public: class = typename enable_if < !is_same< - typename decay<_Fp>::type, + typename __uncvref<_Fp>::type, packaged_task >::value >::type @@ -2150,7 +2150,7 @@ public: class = typename enable_if < !is_same< - typename decay<_Fp>::type, + typename __uncvref<_Fp>::type, packaged_task >::value >::type @@ -2161,7 +2161,7 @@ public: class = typename enable_if < !is_same< - typename decay<_Fp>::type, + typename __uncvref<_Fp>::type, packaged_task >::value >::type diff --git a/include/initializer_list b/include/initializer_list index 8c234aaaab2ac..b934637b83d37 100644 --- a/include/initializer_list +++ b/include/initializer_list @@ -61,7 +61,7 @@ class _LIBCPP_TEMPLATE_VIS initializer_list const _Ep* __begin_; size_t __size_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT : __begin_(__b), @@ -76,19 +76,19 @@ public: typedef const _Ep* iterator; typedef const _Ep* const_iterator; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 size_t size() const _NOEXCEPT {return __size_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Ep* begin() const _NOEXCEPT {return __begin_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Ep* end() const _NOEXCEPT {return __begin_ + __size_;} }; diff --git a/include/ios b/include/ios index 61d00b90ee048..040b2d4e04f1e 100644 --- a/include/ios +++ b/include/ios @@ -337,9 +337,9 @@ protected: } void init(void* __sb); - _LIBCPP_ALWAYS_INLINE void* rdbuf() const {return __rdbuf_;} + _LIBCPP_INLINE_VISIBILITY void* rdbuf() const {return __rdbuf_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void rdbuf(void* __sb) { __rdbuf_ = __sb; @@ -351,7 +351,7 @@ protected: void move(ios_base&); void swap(ios_base&) _NOEXCEPT; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void set_rdbuf(void* __sb) { __rdbuf_ = __sb; @@ -592,30 +592,33 @@ public: typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; + 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) - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY operator __cxx03_bool::__bool_type() const { return !fail() ? &__cxx03_bool::__true_value : nullptr; } #else - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const {return !fail();} #endif - _LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();} - _LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();} - _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);} - _LIBCPP_ALWAYS_INLINE void setstate(iostate __state) {ios_base::setstate(__state);} - _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();} - _LIBCPP_ALWAYS_INLINE bool eof() const {return ios_base::eof();} - _LIBCPP_ALWAYS_INLINE bool fail() const {return ios_base::fail();} - _LIBCPP_ALWAYS_INLINE bool bad() const {return ios_base::bad();} + _LIBCPP_INLINE_VISIBILITY bool operator!() const {return fail();} + _LIBCPP_INLINE_VISIBILITY iostate rdstate() const {return ios_base::rdstate();} + _LIBCPP_INLINE_VISIBILITY void clear(iostate __state = goodbit) {ios_base::clear(__state);} + _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state) {ios_base::setstate(__state);} + _LIBCPP_INLINE_VISIBILITY bool good() const {return ios_base::good();} + _LIBCPP_INLINE_VISIBILITY bool eof() const {return ios_base::eof();} + _LIBCPP_INLINE_VISIBILITY bool fail() const {return ios_base::fail();} + _LIBCPP_INLINE_VISIBILITY bool bad() const {return ios_base::bad();} - _LIBCPP_ALWAYS_INLINE iostate exceptions() const {return ios_base::exceptions();} - _LIBCPP_ALWAYS_INLINE void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);} + _LIBCPP_INLINE_VISIBILITY iostate exceptions() const {return ios_base::exceptions();} + _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);} // 27.5.4.1 Constructor/destructor: _LIBCPP_INLINE_VISIBILITY @@ -649,7 +652,7 @@ public: char_type widen(char __c) const; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY basic_ios() {// purposefully does no initialization } _LIBCPP_INLINE_VISIBILITY @@ -658,7 +661,7 @@ protected: _LIBCPP_INLINE_VISIBILITY void move(basic_ios& __rhs); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void move(basic_ios&& __rhs) {move(__rhs);} #endif _LIBCPP_INLINE_VISIBILITY @@ -667,7 +670,7 @@ protected: void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb); private: basic_ostream<char_type, traits_type>* __tie_; - mutable int_type __fill_; + mutable int_type __fill_; }; template <class _CharT, class _Traits> diff --git a/include/istream b/include/istream index 5c73df38f650c..71c162b0d41a3 100644 --- a/include/istream +++ b/include/istream @@ -358,381 +358,162 @@ basic_istream<_CharT, _Traits>::~basic_istream() { } -template <class _CharT, class _Traits> +template <class _Tp, class _CharT, class _Traits> +_LIBCPP_INLINE_VISIBILITY basic_istream<_CharT, _Traits>& -basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n) -{ +__input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) { #ifndef _LIBCPP_NO_EXCEPTIONS try { #endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); + typename basic_istream<_CharT, _Traits>::sentry __s(__is); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef num_get<_CharT, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); + use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __err, __n); + __is.setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) { - this->__set_badbit_and_consider_rethrow(); + __is.__set_badbit_and_consider_rethrow(); } #endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return __is; +} + +template <class _CharT, class _Traits> +basic_istream<_CharT, _Traits>& +basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n) +{ + return _VSTD::__input_arithmetic<unsigned short>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<unsigned int>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(long& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<long>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<unsigned long>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(long long& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<long long>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<unsigned long long>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(float& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<float>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(double& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<double>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(long double& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<long double>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(bool& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<bool>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(void*& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic<void*>(*this, __n); } -template <class _CharT, class _Traits> +template <class _Tp, class _CharT, class _Traits> +_LIBCPP_INLINE_VISIBILITY basic_istream<_CharT, _Traits>& -basic_istream<_CharT, _Traits>::operator>>(short& __n) -{ +__input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp& __n) { #ifndef _LIBCPP_NO_EXCEPTIONS try { #endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); + typename basic_istream<_CharT, _Traits>::sentry __s(__is); if (__s) { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; + typedef istreambuf_iterator<_CharT, _Traits> _Ip; + typedef num_get<_CharT, _Ip> _Fp; ios_base::iostate __err = ios_base::goodbit; long __temp; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp); - if (__temp < numeric_limits<short>::min()) + use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __err, __temp); + if (__temp < numeric_limits<_Tp>::min()) { __err |= ios_base::failbit; - __n = numeric_limits<short>::min(); + __n = numeric_limits<_Tp>::min(); } - else if (__temp > numeric_limits<short>::max()) + else if (__temp > numeric_limits<_Tp>::max()) { __err |= ios_base::failbit; - __n = numeric_limits<short>::max(); + __n = numeric_limits<_Tp>::max(); } else - __n = static_cast<short>(__temp); - this->setstate(__err); + __n = static_cast<_Tp>(__temp); + __is.setstate(__err); } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) { - this->__set_badbit_and_consider_rethrow(); + __is.__set_badbit_and_consider_rethrow(); } #endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return __is; +} + +template <class _CharT, class _Traits> +basic_istream<_CharT, _Traits>& +basic_istream<_CharT, _Traits>::operator>>(short& __n) +{ + return _VSTD::__input_arithmetic_with_numeric_limits<short>(*this, __n); } template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>>(int& __n) { -#ifndef _LIBCPP_NO_EXCEPTIONS - try - { -#endif // _LIBCPP_NO_EXCEPTIONS - sentry __s(*this); - if (__s) - { - typedef istreambuf_iterator<char_type, traits_type> _Ip; - typedef num_get<char_type, _Ip> _Fp; - ios_base::iostate __err = ios_base::goodbit; - long __temp; - use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp); - if (__temp < numeric_limits<int>::min()) - { - __err |= ios_base::failbit; - __n = numeric_limits<int>::min(); - } - else if (__temp > numeric_limits<int>::max()) - { - __err |= ios_base::failbit; - __n = numeric_limits<int>::max(); - } - else - __n = static_cast<int>(__temp); - this->setstate(__err); - } -#ifndef _LIBCPP_NO_EXCEPTIONS - } - catch (...) - { - this->__set_badbit_and_consider_rethrow(); - } -#endif // _LIBCPP_NO_EXCEPTIONS - return *this; + return _VSTD::__input_arithmetic_with_numeric_limits<int>(*this, __n); } template<class _CharT, class _Traits> @@ -960,7 +741,6 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __ ++__gc_; this->rdbuf()->sbumpc(); } - *__s = char_type(); if (__gc_ == 0) __err |= ios_base::failbit; this->setstate(__err); @@ -968,10 +748,14 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __ else this->setstate(ios_base::failbit); } + if (__n > 0) + *__s = char_type(); #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) { + if (__n > 0) + *__s = char_type(); this->__set_badbit_and_consider_rethrow(); } #endif // _LIBCPP_NO_EXCEPTIONS diff --git a/include/iterator b/include/iterator index 8b887db037b90..9415e0b83967d 100644 --- a/include/iterator +++ b/include/iterator @@ -1217,38 +1217,38 @@ make_move_iterator(_Iter __i) template <class _Iter> class __wrap_iter; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; #ifndef _LIBCPP_CXX03_LANG template <class _Iter1, class _Iter2> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG -> decltype(__x.base() - __y.base()); @@ -1260,7 +1260,7 @@ operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBU #endif template <class _Iter> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter<_Iter> operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT_DEBUG; @@ -1272,7 +1272,7 @@ template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, #if _LIBCPP_DEBUG_LEVEL < 2 template <class _Tp> -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1283,7 +1283,7 @@ __unwrap_iter(__wrap_iter<_Tp*>); #else template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1306,7 +1306,7 @@ public: private: iterator_type __i; public: - _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT_DEBUG #if _LIBCPP_STD_VER > 11 : __i{} #endif @@ -1315,22 +1315,23 @@ public: __get_db()->__insert_i(this); #endif } - template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u, - typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT_DEBUG - : __i(__u.base()) + 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_DEBUG + : __i(__u.base()) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__iterator_copy(this, &__u); #endif } #if _LIBCPP_DEBUG_LEVEL >= 2 - _LIBCPP_INLINE_VISIBILITY + _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_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator=(const __wrap_iter& __x) { if (this != &__x) @@ -1340,13 +1341,13 @@ public: } return *this; } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG ~__wrap_iter() { __get_db()->__erase_i(this); } #endif - _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), @@ -1354,7 +1355,7 @@ public: #endif return *__i; } - _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), @@ -1362,7 +1363,7 @@ public: #endif return (pointer)_VSTD::addressof(*__i); } - _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), @@ -1371,9 +1372,10 @@ public: ++__i; return *this; } - _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT_DEBUG {__wrap_iter __tmp(*this); ++(*this); return __tmp;} - _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT_DEBUG + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), @@ -1382,11 +1384,11 @@ public: --__i; return *this; } - _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT_DEBUG {__wrap_iter __tmp(*this); --(*this); return __tmp;} - _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG {__wrap_iter __w(*this); __w += __n; return __w;} - _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n), @@ -1395,11 +1397,11 @@ public: __i += __n; return *this; } - _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG {return *this + (-__n);} - _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG {*this += -__n; return *this;} - _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT_DEBUG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT_DEBUG { #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n), @@ -1408,67 +1410,68 @@ public: return __i[__n]; } - _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT_DEBUG {return __i;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT_DEBUG {return __i;} private: #if _LIBCPP_DEBUG_LEVEL >= 2 - _LIBCPP_INLINE_VISIBILITY __wrap_iter(const void* __p, iterator_type __x) : __i(__x) + _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 __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __i(__x) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __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, ptrdiff_t> friend class _LIBCPP_TEMPLATE_VIS span; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend bool operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; #ifndef _LIBCPP_CXX03_LANG template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG -> decltype(__x.base() - __y.base()); #else template <class _Iter1, class _Iter2> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend typename __wrap_iter<_Iter1>::difference_type operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG; #endif template <class _Iter1> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG; @@ -1479,7 +1482,7 @@ private: #if _LIBCPP_DEBUG_LEVEL < 2 template <class _Tp> - friend + _LIBCPP_CONSTEXPR_IF_NODEBUG friend typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1488,7 +1491,7 @@ private: __unwrap_iter(__wrap_iter<_Tp*>); #else template <class _Tp> - inline _LIBCPP_INLINE_VISIBILITY + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1499,7 +1502,7 @@ private: }; template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1507,7 +1510,7 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1519,7 +1522,7 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1527,7 +1530,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1535,7 +1538,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1543,7 +1546,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG { @@ -1551,7 +1554,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX } template <class _Iter1> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG { @@ -1559,7 +1562,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX } template <class _Iter1> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG { @@ -1567,7 +1570,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXC } template <class _Iter1> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG { @@ -1575,7 +1578,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX } template <class _Iter1> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG { @@ -1584,7 +1587,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX #ifndef _LIBCPP_CXX03_LANG template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG -> decltype(__x.base() - __y.base()) @@ -1597,7 +1600,7 @@ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC } #else template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +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_DEBUG { @@ -1610,7 +1613,7 @@ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC #endif template <class _Iter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter<_Iter> operator+(typename __wrap_iter<_Iter>::difference_type __n, __wrap_iter<_Iter> __x) _NOEXCEPT_DEBUG diff --git a/include/list b/include/list index 32e9a27bd2a4b..d2e78cd66afb8 100644 --- a/include/list +++ b/include/list @@ -147,6 +147,11 @@ public: void reverse() noexcept; }; + +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + list(InputIterator, InputIterator, Allocator = Allocator()) + -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 + template <class T, class Alloc> bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y); template <class T, class Alloc> @@ -527,11 +532,12 @@ class __list_imp { __list_imp(const __list_imp&); __list_imp& operator=(const __list_imp&); -protected: - typedef _Tp value_type; +public: typedef _Alloc allocator_type; typedef allocator_traits<allocator_type> __alloc_traits; typedef typename __alloc_traits::size_type size_type; +protected: + typedef _Tp value_type; typedef typename __alloc_traits::void_pointer __void_pointer; typedef __list_iterator<value_type, __void_pointer> iterator; typedef __list_const_iterator<value_type, __void_pointer> const_iterator; @@ -550,6 +556,9 @@ protected: typedef typename __rebind_alloc_helper<__alloc_traits, __node_base>::type __node_base_allocator; typedef typename allocator_traits<__node_base_allocator>::pointer __node_base_pointer; + static_assert((!is_same<allocator_type, __node_allocator>::value), + "internal allocator type must differ from user-specified " + "type; otherwise overload resolution breaks"); __node_base __end_; __compressed_pair<size_type, __node_allocator> __size_alloc_; @@ -584,6 +593,11 @@ protected: _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value); _LIBCPP_INLINE_VISIBILITY __list_imp(const allocator_type& __a); + _LIBCPP_INLINE_VISIBILITY + __list_imp(const __node_allocator& __a); +#ifndef _LIBCPP_CXX03_LANG + __list_imp(__node_allocator&& __a) _NOEXCEPT; +#endif ~__list_imp(); void clear() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -707,9 +721,18 @@ __list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a) } template <class _Tp, class _Alloc> -__list_imp<_Tp, _Alloc>::~__list_imp() -{ - clear(); +inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a) + : __size_alloc_(0, __a) {} + +#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)) {} +#endif + +template <class _Tp, class _Alloc> +__list_imp<_Tp, _Alloc>::~__list_imp() { + clear(); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__erase_c(this); #endif @@ -1106,6 +1129,22 @@ private: void __move_assign(list& __c, false_type); }; +#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 + > +list(_InputIterator, _InputIterator) + -> list<typename iterator_traits<_InputIterator>::value_type, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +list(_InputIterator, _InputIterator, _Alloc) + -> list<typename iterator_traits<_InputIterator>::value_type, _Alloc>; +#endif + // Link in nodes [__f, __l] just prior to __p template <class _Tp, class _Alloc> inline @@ -1226,10 +1265,8 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a, template <class _Tp, class _Alloc> list<_Tp, _Alloc>::list(const list& __c) - : base(allocator_type( - __node_alloc_traits::select_on_container_copy_construction( - __c.__node_alloc()))) -{ + : base(__node_alloc_traits::select_on_container_copy_construction( + __c.__node_alloc())) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); #endif @@ -1274,11 +1311,9 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il) } template <class _Tp, class _Alloc> -inline -list<_Tp, _Alloc>::list(list&& __c) +inline list<_Tp, _Alloc>::list(list&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value) - : base(allocator_type(_VSTD::move(__c.__node_alloc()))) -{ + : base(_VSTD::move(__c.__node_alloc())) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); #endif @@ -2058,15 +2093,15 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con #endif if (__f != __l) { + __link_pointer __first = __f.__ptr_; + --__l; + __link_pointer __last = __l.__ptr_; if (this != &__c) { - size_type __s = _VSTD::distance(__f, __l); + size_type __s = _VSTD::distance(__f, __l) + 1; __c.__sz() -= __s; base::__sz() += __s; } - __link_pointer __first = __f.__ptr_; - --__l; - __link_pointer __last = __l.__ptr_; base::__unlink_nodes(__first, __last); __link_nodes(__p.__ptr_, __first, __last); #if _LIBCPP_DEBUG_LEVEL >= 2 diff --git a/include/locale b/include/locale index a86645d2cc4bc..e240799f38318 100644 --- a/include/locale +++ b/include/locale @@ -573,81 +573,81 @@ public: typedef _CharT char_type; typedef _InputIterator iter_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit num_get(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, bool& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long long& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned short& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned int& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, unsigned long long& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, float& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, double& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { return do_get(__b, __e, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, void*& __v) const { @@ -657,7 +657,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~num_get() {} template <class _Fp> @@ -768,10 +768,10 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end, { if (__a != __a_end) { - if (*__a == '-') - { - __err = ios_base::failbit; - return 0; + const bool __negate = *__a == '-'; + if (__negate && ++__a == __a_end) { + __err = ios_base::failbit; + return 0; } typename remove_reference<decltype(errno)>::type __save_errno = errno; errno = 0; @@ -785,13 +785,14 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end, __err = ios_base::failbit; return 0; } - else if (__current_errno == ERANGE || - numeric_limits<_Tp>::max() < __ll) + else if (__current_errno == ERANGE || numeric_limits<_Tp>::max() < __ll) { __err = ios_base::failbit; return numeric_limits<_Tp>::max(); } - return static_cast<_Tp>(__ll); + _Tp __res = static_cast<_Tp>(__ll); + if (__negate) __res = -__res; + return __res; } __err = ios_base::failbit; return 0; @@ -1260,60 +1261,60 @@ public: typedef _CharT char_type; typedef _OutputIterator iter_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, bool __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long long __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, unsigned long long __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, double __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, long double __v) const { return do_put(__s, __iob, __fl, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, const void* __v) const { @@ -1323,7 +1324,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~num_put() {} virtual iter_type do_put(iter_type __s, ios_base& __iob, char_type __fl, @@ -1737,7 +1738,7 @@ protected: virtual const string_type& __x() const; virtual const string_type& __X() const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~__time_get_c_storage() {} }; @@ -1769,52 +1770,52 @@ public: typedef time_base::dateorder dateorder; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_get(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY dateorder date_order() const { return this->do_date_order(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get_time(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { return do_get_time(__b, __e, __iob, __err, __tm); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get_date(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { return do_get_date(__b, __e, __iob, __err, __tm); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get_weekday(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { return do_get_weekday(__b, __e, __iob, __err, __tm); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get_monthname(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { return do_get_monthname(__b, __e, __iob, __err, __tm); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get_year(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm* __tm) const { return do_get_year(__b, __e, __iob, __err, __tm); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, ios_base& __iob, ios_base::iostate& __err, tm *__tm, char __fmt, char __mod = 0) const @@ -1829,7 +1830,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~time_get() {} virtual dateorder do_date_order() const; @@ -2398,7 +2399,7 @@ protected: explicit __time_get_storage(const char* __nm); explicit __time_get_storage(const string& __nm); - _LIBCPP_ALWAYS_INLINE ~__time_get_storage() {} + _LIBCPP_INLINE_VISIBILITY ~__time_get_storage() {} time_base::dateorder __do_date_order() const; @@ -2457,7 +2458,7 @@ class _LIBCPP_TYPE_VIS __time_put { locale_t __loc_; protected: - _LIBCPP_ALWAYS_INLINE __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {} + _LIBCPP_INLINE_VISIBILITY __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {} __time_put(const char* __nm); __time_put(const string& __nm); ~__time_put(); @@ -2476,14 +2477,14 @@ public: typedef _CharT char_type; typedef _OutputIterator iter_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_put(size_t __refs = 0) : locale::facet(__refs) {} iter_type put(iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm, const char_type* __pb, const char_type* __pe) const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, ios_base& __iob, char_type __fl, const tm* __tm, char __fmt, char __mod = 0) const { @@ -2493,16 +2494,16 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~time_put() {} virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm, char __fmt, char __mod) const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_put(const char* __nm, size_t __refs) : locale::facet(__refs), __time_put(__nm) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_put(const string& __nm, size_t __refs) : locale::facet(__refs), __time_put(__nm) {} @@ -2571,16 +2572,16 @@ class _LIBCPP_TEMPLATE_VIS time_put_byname : public time_put<_CharT, _OutputIterator> { public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_put_byname(const char* __nm, size_t __refs = 0) : time_put<_CharT, _OutputIterator>(__nm, __refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit time_put_byname(const string& __nm, size_t __refs = 0) : time_put<_CharT, _OutputIterator>(__nm, __refs) {} protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~time_put_byname() {} }; @@ -2595,7 +2596,7 @@ public: enum part {none, space, symbol, sign, value}; struct pattern {char field[4];}; - _LIBCPP_ALWAYS_INLINE money_base() {} + _LIBCPP_INLINE_VISIBILITY money_base() {} }; // moneypunct @@ -2609,25 +2610,25 @@ public: typedef _CharT char_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit moneypunct(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE char_type decimal_point() const {return do_decimal_point();} - _LIBCPP_ALWAYS_INLINE char_type thousands_sep() const {return do_thousands_sep();} - _LIBCPP_ALWAYS_INLINE string grouping() const {return do_grouping();} - _LIBCPP_ALWAYS_INLINE string_type curr_symbol() const {return do_curr_symbol();} - _LIBCPP_ALWAYS_INLINE string_type positive_sign() const {return do_positive_sign();} - _LIBCPP_ALWAYS_INLINE string_type negative_sign() const {return do_negative_sign();} - _LIBCPP_ALWAYS_INLINE int frac_digits() const {return do_frac_digits();} - _LIBCPP_ALWAYS_INLINE pattern pos_format() const {return do_pos_format();} - _LIBCPP_ALWAYS_INLINE pattern neg_format() const {return do_neg_format();} + _LIBCPP_INLINE_VISIBILITY char_type decimal_point() const {return do_decimal_point();} + _LIBCPP_INLINE_VISIBILITY char_type thousands_sep() const {return do_thousands_sep();} + _LIBCPP_INLINE_VISIBILITY string grouping() const {return do_grouping();} + _LIBCPP_INLINE_VISIBILITY string_type curr_symbol() const {return do_curr_symbol();} + _LIBCPP_INLINE_VISIBILITY string_type positive_sign() const {return do_positive_sign();} + _LIBCPP_INLINE_VISIBILITY string_type negative_sign() const {return do_negative_sign();} + _LIBCPP_INLINE_VISIBILITY int frac_digits() const {return do_frac_digits();} + _LIBCPP_INLINE_VISIBILITY pattern pos_format() const {return do_pos_format();} + _LIBCPP_INLINE_VISIBILITY pattern neg_format() const {return do_neg_format();} static locale::id id; static const bool intl = _International; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~moneypunct() {} virtual char_type do_decimal_point() const {return numeric_limits<char_type>::max();} @@ -2667,16 +2668,16 @@ public: typedef _CharT char_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit moneypunct_byname(const char* __nm, size_t __refs = 0) : moneypunct<_CharT, _International>(__refs) {init(__nm);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit moneypunct_byname(const string& __nm, size_t __refs = 0) : moneypunct<_CharT, _International>(__refs) {init(__nm.c_str());} protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~moneypunct_byname() {} virtual char_type do_decimal_point() const {return __decimal_point_;} @@ -2722,7 +2723,7 @@ protected: typedef _CharT char_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE __money_get() {} + _LIBCPP_INLINE_VISIBILITY __money_get() {} static void __gather_info(bool __intl, const locale& __loc, money_base::pattern& __pat, char_type& __dp, @@ -2780,18 +2781,18 @@ public: typedef _InputIterator iter_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit money_get(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, long double& __v) const { return do_get(__b, __e, __intl, __iob, __err, __v); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob, ios_base::iostate& __err, string_type& __v) const { @@ -2802,7 +2803,7 @@ public: protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~money_get() {} virtual iter_type do_get(iter_type __b, iter_type __e, bool __intl, @@ -3162,7 +3163,7 @@ protected: typedef _CharT char_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE __money_put() {} + _LIBCPP_INLINE_VISIBILITY __money_put() {} static void __gather_info(bool __intl, bool __neg, const locale& __loc, money_base::pattern& __pat, char_type& __dp, @@ -3338,18 +3339,18 @@ public: typedef _OutputIterator iter_type; typedef basic_string<char_type> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit money_put(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, long double __units) const { return do_put(__s, __intl, __iob, __fl, __units); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl, const string_type& __digits) const { @@ -3359,7 +3360,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~money_put() {} virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __iob, @@ -3488,7 +3489,7 @@ class _LIBCPP_TYPE_VIS messages_base public: typedef ptrdiff_t catalog; - _LIBCPP_ALWAYS_INLINE messages_base() {} + _LIBCPP_INLINE_VISIBILITY messages_base() {} }; template <class _CharT> @@ -3500,24 +3501,24 @@ public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit messages(size_t __refs = 0) : locale::facet(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY catalog open(const basic_string<char>& __nm, const locale& __loc) const { return do_open(__nm, __loc); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY string_type get(catalog __c, int __set, int __msgid, const string_type& __dflt) const { return do_get(__c, __set, __msgid, __dflt); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void close(catalog __c) const { do_close(__c); @@ -3526,7 +3527,7 @@ public: static locale::id id; protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~messages() {} virtual catalog do_open(const basic_string<char>&, const locale&) const; @@ -3599,16 +3600,16 @@ public: typedef messages_base::catalog catalog; typedef basic_string<_CharT> string_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit messages_byname(const char*, size_t __refs = 0) : messages<_CharT>(__refs) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit messages_byname(const string&, size_t __refs = 0) : messages<_CharT>(__refs) {} protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY ~messages_byname() {} }; @@ -3636,43 +3637,43 @@ private: wstring_convert(const wstring_convert& __wc); wstring_convert& operator=(const wstring_convert& __wc); public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(_Codecvt* __pcvt = new _Codecvt); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY wstring_convert(_Codecvt* __pcvt, state_type __state); _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY wstring_convert(wstring_convert&& __wc); #endif ~wstring_convert(); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY wide_string from_bytes(char __byte) {return from_bytes(&__byte, &__byte+1);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY wide_string from_bytes(const char* __ptr) {return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY wide_string from_bytes(const byte_string& __str) {return from_bytes(__str.data(), __str.data() + __str.size());} wide_string from_bytes(const char* __first, const char* __last); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY byte_string to_bytes(_Elem __wchar) {return to_bytes(&__wchar, &__wchar+1);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY byte_string to_bytes(const _Elem* __wptr) {return to_bytes(__wptr, __wptr + char_traits<_Elem>::length(__wptr));} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY byte_string to_bytes(const wide_string& __wstr) {return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());} byte_string to_bytes(const _Elem* __first, const _Elem* __last); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t converted() const _NOEXCEPT {return __cvtcount_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY state_type state() const {return __cvtstate_;} }; diff --git a/include/map b/include/map index 9521493898144..97ce4d0b18c7c 100644 --- a/include/map +++ b/include/map @@ -470,13 +470,13 @@ public: const _Compare& key_comp() const _NOEXCEPT {return *this;} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _CP& __y) const - {return static_cast<const _Compare&>(*this)(__x.__cc.first, __y.__cc.first);} + {return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y.__get_value().first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _Key& __y) const - {return static_cast<const _Compare&>(*this)(__x.__cc.first, __y);} + {return static_cast<const _Compare&>(*this)(__x.__get_value().first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const - {return static_cast<const _Compare&>(*this)(__x, __y.__cc.first);} + {return static_cast<const _Compare&>(*this)(__x, __y.__get_value().first);} void swap(__map_value_compare&__y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { @@ -489,13 +489,13 @@ public: _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type operator () ( const _K2& __x, const _CP& __y ) const - {return static_cast<const _Compare&>(*this) (__x, __y.__cc.first);} + {return static_cast<const _Compare&>(*this) (__x, __y.__get_value().first);} template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type operator () (const _CP& __x, const _K2& __y) const - {return static_cast<const _Compare&>(*this) (__x.__cc.first, __y);} + {return static_cast<const _Compare&>(*this) (__x.__get_value().first, __y);} #endif }; @@ -518,13 +518,13 @@ public: _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _CP& __y) const - {return comp(__x.__cc.first, __y.__cc.first);} + {return comp(__x.__get_value().first, __y.__get_value().first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _CP& __x, const _Key& __y) const - {return comp(__x.__cc.first, __y);} + {return comp(__x.__get_value().first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const - {return comp(__x, __y.__cc.first);} + {return comp(__x, __y.__get_value().first);} void swap(__map_value_compare&__y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { @@ -537,13 +537,13 @@ public: _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type operator () ( const _K2& __x, const _CP& __y ) const - {return comp (__x, __y.__cc.first);} + {return comp (__x, __y.__get_value().first);} template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type operator () (const _CP& __x, const _K2& __y) const - {return comp (__x.__cc.first, __y);} + {return comp (__x.__get_value().first, __y);} #endif }; @@ -597,9 +597,9 @@ public: void operator()(pointer __p) _NOEXCEPT { if (__second_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.second)); + __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().second)); if (__first_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.first)); + __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().first)); if (__p) __alloc_traits::deallocate(__na_, __p, 1); } @@ -614,23 +614,67 @@ template <class _TreeIterator> class __map_const_iterator; #ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp> -union __value_type +struct __value_type { typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; + typedef pair<key_type&, mapped_type&> __nc_ref_pair_type; + typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type; +private: value_type __cc; - __nc_value_type __nc; + +public: + _LIBCPP_INLINE_VISIBILITY + value_type& __get_value() + { +#if _LIBCPP_STD_VER > 14 + return *_VSTD::launder(_VSTD::addressof(__cc)); +#else + return __cc; +#endif + } + + _LIBCPP_INLINE_VISIBILITY + const value_type& __get_value() const + { +#if _LIBCPP_STD_VER > 14 + return *_VSTD::launder(_VSTD::addressof(__cc)); +#else + return __cc; +#endif + } + + _LIBCPP_INLINE_VISIBILITY + __nc_ref_pair_type __ref() + { + value_type& __v = __get_value(); + return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second); + } + + _LIBCPP_INLINE_VISIBILITY + __nc_rref_pair_type __move() + { + value_type& __v = __get_value(); + return __nc_rref_pair_type( + _VSTD::move(const_cast<key_type&>(__v.first)), + _VSTD::move(__v.second)); + } _LIBCPP_INLINE_VISIBILITY __value_type& operator=(const __value_type& __v) - {__nc = __v.__cc; return *this;} + { + __ref() = __v.__get_value(); + return *this; + } _LIBCPP_INLINE_VISIBILITY __value_type& operator=(__value_type&& __v) - {__nc = _VSTD::move(__v.__nc); return *this;} + { + __ref() = __v.__move(); + return *this; + } template <class _ValueTp, class = typename enable_if< @@ -638,8 +682,10 @@ union __value_type >::type > _LIBCPP_INLINE_VISIBILITY - __value_type& operator=(_ValueTp&& __v) { - __nc = _VSTD::forward<_ValueTp>(__v); return *this; + __value_type& operator=(_ValueTp&& __v) + { + __ref() = _VSTD::forward<_ValueTp>(__v); + return *this; } private: @@ -658,8 +704,15 @@ struct __value_type typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; +private: value_type __cc; +public: + _LIBCPP_INLINE_VISIBILITY + value_type& __get_value() { return __cc; } + _LIBCPP_INLINE_VISIBILITY + const value_type& __get_value() const { return __cc; } + private: __value_type(); __value_type(__value_type const&); @@ -701,9 +754,9 @@ public: __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {} _LIBCPP_INLINE_VISIBILITY - reference operator*() const {return __i_->__cc;} + reference operator*() const {return __i_->__get_value();} _LIBCPP_INLINE_VISIBILITY - pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);} + pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());} _LIBCPP_INLINE_VISIBILITY __map_iterator& operator++() {++__i_; return *this;} @@ -764,9 +817,9 @@ public: : __i_(__i.__i_) {} _LIBCPP_INLINE_VISIBILITY - reference operator*() const {return __i_->__cc;} + reference operator*() const {return __i_->__get_value();} _LIBCPP_INLINE_VISIBILITY - pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);} + pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());} _LIBCPP_INLINE_VISIBILITY __map_const_iterator& operator++() {++__i_; return *this;} @@ -809,7 +862,6 @@ public: typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; typedef _Compare key_compare; typedef _Allocator allocator_type; typedef value_type& reference; @@ -1228,7 +1280,7 @@ public: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type - count(const _K2& __k) const {return __tree_.__count_unique(__k);} + count(const _K2& __k) const {return __tree_.__count_multi(__k);} #endif _LIBCPP_INLINE_VISIBILITY iterator lower_bound(const key_type& __k) @@ -1275,11 +1327,11 @@ public: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type - equal_range(const _K2& __k) {return __tree_.__equal_range_unique(__k);} + equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);} template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type - equal_range(const _K2& __k) const {return __tree_.__equal_range_unique(__k);} + equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);} #endif private: @@ -1308,7 +1360,7 @@ map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a) const_iterator __e = cend(); while (!__m.empty()) __tree_.__insert_unique(__e.__i_, - _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__nc)); + __m.__tree_.remove(__m.begin().__i_)->__value_.__move()); } } @@ -1319,7 +1371,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) return __tree_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct, _VSTD::forward_as_tuple(__k), - _VSTD::forward_as_tuple()).first->__cc.second; + _VSTD::forward_as_tuple()).first->__get_value().second; } template <class _Key, class _Tp, class _Compare, class _Allocator> @@ -1329,7 +1381,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) return __tree_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)), - _VSTD::forward_as_tuple()).first->__cc.second; + _VSTD::forward_as_tuple()).first->__get_value().second; } #else // _LIBCPP_CXX03_LANG @@ -1340,9 +1392,9 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type& { __node_allocator& __na = __tree_.__node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k); + __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().first), __k); __h.get_deleter().__first_constructed = true; - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second)); + __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 } @@ -1360,7 +1412,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) __tree_.__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get())); __r = __h.release(); } - return __r->__value_.__cc.second; + return __r->__value_.__get_value().second; } #endif // _LIBCPP_CXX03_LANG @@ -1375,7 +1427,7 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) if (__child == nullptr) throw out_of_range("map::at: key not found"); #endif // _LIBCPP_NO_EXCEPTIONS - return static_cast<__node_pointer>(__child)->__value_.__cc.second; + return static_cast<__node_pointer>(__child)->__value_.__get_value().second; } template <class _Key, class _Tp, class _Compare, class _Allocator> @@ -1388,7 +1440,7 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const if (__child == nullptr) throw out_of_range("map::at: key not found"); #endif // _LIBCPP_NO_EXCEPTIONS - return static_cast<__node_pointer>(__child)->__value_.__cc.second; + return static_cast<__node_pointer>(__child)->__value_.__get_value().second; } @@ -1465,7 +1517,6 @@ public: typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; typedef _Compare key_compare; typedef _Allocator allocator_type; typedef value_type& reference; @@ -1852,7 +1903,7 @@ multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const alloca const_iterator __e = cend(); while (!__m.empty()) __tree_.__insert_multi(__e.__i_, - _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__nc)); + _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__move())); } } #endif diff --git a/include/math.h b/include/math.h index 8c30ba85d22c9..3cc72aa2791e3 100644 --- a/include/math.h +++ b/include/math.h @@ -314,7 +314,7 @@ extern "C++" { #ifdef signbit template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT { @@ -376,7 +376,7 @@ signbit(_A1) _NOEXCEPT #ifdef fpclassify template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY int __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT { @@ -422,7 +422,7 @@ fpclassify(_A1 __lcpp_x) _NOEXCEPT #ifdef isfinite template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT { @@ -456,7 +456,7 @@ isfinite(_A1) _NOEXCEPT #ifdef isinf template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT { @@ -483,6 +483,20 @@ typename std::enable_if< isinf(_A1) _NOEXCEPT { return false; } +#ifdef _LIBCPP_PREFERRED_OVERLOAD +inline _LIBCPP_INLINE_VISIBILITY +bool +isinf(float __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD +bool +isinf(double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } + +inline _LIBCPP_INLINE_VISIBILITY +bool +isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } +#endif + #endif // isinf // isnan @@ -490,7 +504,7 @@ isinf(_A1) _NOEXCEPT #ifdef isnan template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT { @@ -513,6 +527,20 @@ typename std::enable_if<std::is_integral<_A1>::value, bool>::type isnan(_A1) _NOEXCEPT { return false; } +#ifdef _LIBCPP_PREFERRED_OVERLOAD +inline _LIBCPP_INLINE_VISIBILITY +bool +isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD +bool +isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } + +inline _LIBCPP_INLINE_VISIBILITY +bool +isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } +#endif + #endif // isnan // isnormal @@ -520,7 +548,7 @@ isnan(_A1) _NOEXCEPT #ifdef isnormal template <class _A1> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT { @@ -550,7 +578,7 @@ isnormal(_A1 __lcpp_x) _NOEXCEPT #ifdef isgreater template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -580,7 +608,7 @@ isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT #ifdef isgreaterequal template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -610,7 +638,7 @@ isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT #ifdef isless template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -640,7 +668,7 @@ isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT #ifdef islessequal template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -670,7 +698,7 @@ islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT #ifdef islessgreater template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -700,7 +728,7 @@ islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT #ifdef isunordered template <class _A1, class _A2> -_LIBCPP_ALWAYS_INLINE +_LIBCPP_INLINE_VISIBILITY bool __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { @@ -1486,4 +1514,18 @@ trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);} #endif // __cplusplus +#else // _LIBCPP_MATH_H + +// This include lives outside the header guard in order to support an MSVC +// extension which allows users to do: +// +// #define _USE_MATH_DEFINES +// #include <math.h> +// +// and receive the definitions of mathematical constants, even if <math.h> +// has previously been included. +#if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES) +#include_next <math.h> +#endif + #endif // _LIBCPP_MATH_H diff --git a/include/memory b/include/memory index df221ffa75108..fd830d7ed2cc5 100644 --- a/include/memory +++ b/include/memory @@ -18,7 +18,7 @@ namespace std { struct allocator_arg_t { }; -constexpr allocator_arg_t allocator_arg = allocator_arg_t(); +inline constexpr allocator_arg_t allocator_arg = allocator_arg_t(); template <class T, class Alloc> struct uses_allocator; @@ -126,9 +126,10 @@ public: template <class U> struct rebind {typedef allocator<U> other;}; - allocator() noexcept; - allocator(const allocator&) noexcept; - template <class U> allocator(const allocator<U>&) noexcept; + constexpr allocator() noexcept; // constexpr in C++20 + constexpr allocator(const allocator&) noexcept; // constexpr in C++20 + template <class U> + constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20 ~allocator(); pointer address(reference x) const noexcept; const_pointer address(const_reference x) const noexcept; @@ -631,6 +632,9 @@ template <class T> struct hash; template <class T, class D> struct hash<unique_ptr<T, D> >; template <class T> struct hash<shared_ptr<T> >; +template <class T, class Alloc> + 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); @@ -675,7 +679,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD template <class _ValueType> -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _ValueType __libcpp_relaxed_load(_ValueType const* __value) { #if !defined(_LIBCPP_HAS_NO_THREADS) && \ defined(__ATOMIC_RELAXED) && \ @@ -687,7 +691,7 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) { } template <class _ValueType> -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _ValueType __libcpp_acquire_load(_ValueType const* __value) { #if !defined(_LIBCPP_HAS_NO_THREADS) && \ defined(__ATOMIC_ACQUIRE) && \ @@ -1775,8 +1779,13 @@ public: template <class _Up> struct rebind {typedef allocator<_Up> other;}; - _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {} - template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator() _NOEXCEPT {} + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator(const allocator<_Up>&) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const _NOEXCEPT {return _VSTD::addressof(__x);} _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT @@ -1787,10 +1796,10 @@ public: if (__n > max_size()) __throw_length_error("allocator<T>::allocate(size_t n)" " 'n' exceeds maximum supported size"); - return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp))); + return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), __alignof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT - {_VSTD::__libcpp_deallocate((void*)__p);} + {_VSTD::__libcpp_deallocate((void*)__p, __alignof(_Tp));} _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) @@ -1874,8 +1883,13 @@ public: template <class _Up> struct rebind {typedef allocator<_Up> other;}; - _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {} - template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator() _NOEXCEPT {} + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator(const allocator<_Up>&) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT {return _VSTD::addressof(__x);} _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0) @@ -1883,10 +1897,10 @@ public: if (__n > max_size()) __throw_length_error("allocator<const T>::allocate(size_t n)" " 'n' exceeds maximum supported size"); - return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp))); + return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), __alignof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT - {_VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p));} + {_VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __alignof(_Tp));} _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) @@ -1989,6 +2003,7 @@ public: }; template <class _Tp> +_LIBCPP_NO_CFI pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT { @@ -2000,7 +2015,28 @@ get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT __n = __m; while (__n > 0) { +#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) + if (__is_overaligned_for_new(__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(__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; @@ -2013,7 +2049,10 @@ get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT template <class _Tp> inline _LIBCPP_INLINE_VISIBILITY -void return_temporary_buffer(_Tp* __p) _NOEXCEPT {::operator delete(__p);} +void return_temporary_buffer(_Tp* __p) _NOEXCEPT +{ + _VSTD::__libcpp_deallocate((void*)__p, __alignof(_Tp)); +} #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template <class _Tp> @@ -3444,7 +3483,7 @@ public: virtual const char* what() const _NOEXCEPT; }; -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_bad_weak_ptr() { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -4754,8 +4793,13 @@ 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> @@ -5594,6 +5638,16 @@ struct __temp_value { }; #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 + > + : true_type {}; + _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS diff --git a/include/module.modulemap b/include/module.modulemap index 3194b5c9f2a25..127a42b0633d7 100644 --- a/include/module.modulemap +++ b/include/module.modulemap @@ -243,6 +243,10 @@ module std [system] { header "codecvt" export * } + module compare { + header "compare" + export * + } module complex { header "complex" export * @@ -260,6 +264,10 @@ module std [system] { header "exception" export * } + module filesystem { + header "filesystem" + export * + } module forward_list { header "forward_list" export initializer_list @@ -470,10 +478,15 @@ module std [system] { export initializer_list export * } + module version { + header "version" + export * + } // 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 * } @@ -493,14 +506,6 @@ module std [system] { header "experimental/algorithm" export * } - module any { - header "experimental/any" - export * - } - module chrono { - header "experimental/chrono" - export * - } module coroutine { requires coroutines header "experimental/coroutine" @@ -542,44 +547,28 @@ module std [system] { header "experimental/memory_resource" export * } - module numeric { - header "experimental/numeric" - export * - } - module optional { - header "experimental/optional" - export * - } module propagate_const { header "experimental/propagate_const" export * } - module ratio { - header "experimental/ratio" - export * - } module regex { header "experimental/regex" export * } - module set { - header "experimental/set" + module simd { + header "experimental/simd" export * } - module string { - header "experimental/string" - export * - } - module string_view { - header "experimental/string_view" + module set { + header "experimental/set" export * } - module system_error { - header "experimental/system_error" + module span { + header "span" export * } - module tuple { - header "experimental/tuple" + module string { + header "experimental/string" export * } module type_traits { diff --git a/include/mutex b/include/mutex index fbcc0989fa986..52e39b0fb1f84 100644 --- a/include/mutex +++ b/include/mutex @@ -91,9 +91,9 @@ struct defer_lock_t {}; struct try_to_lock_t {}; struct adopt_lock_t {}; -constexpr defer_lock_t defer_lock{}; -constexpr try_to_lock_t try_to_lock{}; -constexpr adopt_lock_t adopt_lock{}; +inline constexpr defer_lock_t defer_lock{}; +inline constexpr try_to_lock_t try_to_lock{}; +inline constexpr adopt_lock_t adopt_lock{}; template <class Mutex> class lock_guard diff --git a/include/new b/include/new index 4e527501b1e28..b5dc05542b59b 100644 --- a/include/new +++ b/include/new @@ -89,6 +89,7 @@ void operator delete[](void* ptr, void*) noexcept; #include <__config> #include <exception> +#include <type_traits> #include <cstddef> #ifdef _LIBCPP_NO_EXCEPTIONS #include <cstdlib> @@ -113,6 +114,14 @@ void operator delete[](void* ptr, void*) noexcept; # define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION #endif + +#if !__has_builtin(__builtin_operator_new) || \ + __has_builtin(__builtin_operator_new) < 201802L || \ + defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \ + !defined(__cpp_aligned_new) || __cpp_aligned_new < 201606 +#define _LIBCPP_HAS_NO_BUILTIN_ALIGNED_OPERATOR_NEW_DELETE +#endif + namespace std // purposefully not using versioning namespace { @@ -160,6 +169,7 @@ public: #endif // defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11) +#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME) #if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || _LIBCPP_STD_VER > 14 #ifndef _LIBCPP_CXX03_LANG enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; @@ -167,6 +177,7 @@ enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; enum align_val_t { __zero = 0, __max = (size_t)-1 }; #endif #endif +#endif } // std @@ -221,7 +232,27 @@ inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT _LIBCPP_BEGIN_NAMESPACE_STD -inline _LIBCPP_INLINE_VISIBILITY void *__allocate(size_t __size) { +_LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new(size_t __align) _NOEXCEPT { +#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__ + return __align > __STDCPP_DEFAULT_NEW_ALIGNMENT__; +#else + return __align > alignment_of<max_align_t>::value; +#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_ALIGNED_OPERATOR_NEW_DELETE + return ::operator new(__size, __align_val); +# else + return __builtin_operator_new(__size, __align_val); +# endif + } +#else + ((void)__align); +#endif #ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE return ::operator new(__size); #else @@ -229,16 +260,28 @@ inline _LIBCPP_INLINE_VISIBILITY void *__allocate(size_t __size) { #endif } -inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void *__ptr) { +inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void* __ptr, 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_ALIGNED_OPERATOR_NEW_DELETE + return ::operator delete(__ptr, __align_val); +# else + return __builtin_operator_delete(__ptr, __align_val); +# endif + } +#else + ((void)__align); +#endif #ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE - ::operator delete(__ptr); + return ::operator delete(__ptr); #else - __builtin_operator_delete(__ptr); + return __builtin_operator_delete(__ptr); #endif } #ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_NO_EXCEPTIONS _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH #endif diff --git a/include/numeric b/include/numeric index 1b7d97c5be077..b33b6a398eb09 100644 --- a/include/numeric +++ b/include/numeric @@ -51,7 +51,7 @@ template<class InputIterator1, class InputIterator2, class T> T transform_reduce(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init); // C++17 - + template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2> T transform_reduce(InputIterator1 first1, InputIterator1 last1, @@ -75,10 +75,10 @@ template<class InputIterator, class OutputIterator, class T> OutputIterator exclusive_scan(InputIterator first, InputIterator last, OutputIterator result, T init); // C++17 - + template<class InputIterator, class OutputIterator, class T, class BinaryOperation> OutputIterator - exclusive_scan(InputIterator first, InputIterator last, + exclusive_scan(InputIterator first, InputIterator last, OutputIterator result, T init, BinaryOperation binary_op); // C++17 template<class InputIterator, class OutputIterator> @@ -108,7 +108,7 @@ template<class InputIterator, class OutputIterator, 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 @@ -196,7 +196,7 @@ inline _LIBCPP_INLINE_VISIBILITY typename iterator_traits<_InputIterator>::value_type reduce(_InputIterator __first, _InputIterator __last) { - return _VSTD::reduce(__first, __last, + return _VSTD::reduce(__first, __last, typename iterator_traits<_InputIterator>::value_type{}); } #endif @@ -226,7 +226,7 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp> inline _LIBCPP_INLINE_VISIBILITY _Tp -transform_reduce(_InputIterator __first, _InputIterator __last, +transform_reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b, _UnaryOp __u) { for (; __first != __last; ++__first) @@ -234,7 +234,7 @@ transform_reduce(_InputIterator __first, _InputIterator __last, return __init; } -template <class _InputIterator1, class _InputIterator2, +template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOp1, class _BinaryOp2> inline _LIBCPP_INLINE_VISIBILITY _Tp @@ -249,10 +249,10 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, template <class _InputIterator1, class _InputIterator2, class _Tp> inline _LIBCPP_INLINE_VISIBILITY _Tp -transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, +transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) { - return _VSTD::transform_reduce(__first1, __last1, __first2, __init, + return _VSTD::transform_reduce(__first1, __last1, __first2, _VSTD::move(__init), _VSTD::plus<>(), _VSTD::multiplies<>()); } #endif @@ -298,7 +298,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp> inline _LIBCPP_INLINE_VISIBILITY _OutputIterator -exclusive_scan(_InputIterator __first, _InputIterator __last, +exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init, _BinaryOp __b) { if (__first != __last) @@ -318,14 +318,14 @@ exclusive_scan(_InputIterator __first, _InputIterator __last, template <class _InputIterator, class _OutputIterator, class _Tp> inline _LIBCPP_INLINE_VISIBILITY _OutputIterator -exclusive_scan(_InputIterator __first, _InputIterator __last, +exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init) { return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>()); } template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp> -_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, +_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b, _Tp __init) { for (; __first != __last; ++__first, (void) ++__result) { @@ -336,7 +336,7 @@ _OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, } template <class _InputIterator, class _OutputIterator, class _BinaryOp> -_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, +_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b) { if (__first != __last) { @@ -350,17 +350,17 @@ _OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, } template <class _InputIterator, class _OutputIterator> -_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, +_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { return _VSTD::inclusive_scan(__first, __last, __result, std::plus<>()); } -template <class _InputIterator, class _OutputIterator, class _Tp, +template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp> inline _LIBCPP_INLINE_VISIBILITY _OutputIterator -transform_exclusive_scan(_InputIterator __first, _InputIterator __last, +transform_exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Tp __init, _BinaryOp __b, _UnaryOp __u) { @@ -379,7 +379,7 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last, } template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp> -_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last, +_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init) { for (; __first != __last; ++__first, (void) ++__result) { @@ -391,7 +391,7 @@ _OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator } template <class _InputIterator, class _OutputIterator, class _BinaryOp, class _UnaryOp> -_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last, +_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOp __b, _UnaryOp __u) { if (__first != __last) { @@ -400,7 +400,7 @@ _OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator if (++__first != __last) return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init); } - + return __result; } #endif diff --git a/include/optional b/include/optional index 35a4d74c2e86a..a76f8d18976ee 100644 --- a/include/optional +++ b/include/optional @@ -22,7 +22,7 @@ namespace std { // 23.6.4, no-value state indicator struct nullopt_t{see below }; - constexpr nullopt_t nullopt(unspecified ); + inline constexpr nullopt_t nullopt(unspecified ); // 23.6.5, class bad_optional_access class bad_optional_access; @@ -139,6 +139,10 @@ namespace std { private: T *val; // exposition only }; + +template<class T> + optional(T) -> optional<T>; + } // namespace std */ @@ -195,7 +199,7 @@ struct nullopt_t _LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {} }; -/* inline */ constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}}; +_LIBCPP_INLINE_VAR constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}}; template <class _Tp, bool = is_trivially_destructible<_Tp>::value> struct __optional_destruct_base; @@ -612,8 +616,8 @@ private: }; template <class _Up> using _CheckOptionalArgsCtor = conditional_t< - !is_same_v<decay_t<_Up>, in_place_t> && - !is_same_v<decay_t<_Up>, optional>, + !is_same_v<__uncvref_t<_Up>, in_place_t> && + !is_same_v<__uncvref_t<_Up>, optional>, _CheckOptionalArgsConstructor, __check_tuple_constructor_fail >; @@ -761,7 +765,7 @@ public: class = enable_if_t <__lazy_and< integral_constant<bool, - !is_same_v<decay_t<_Up>, optional> && + !is_same_v<__uncvref_t<_Up>, optional> && !(is_same_v<_Up, value_type> && is_scalar_v<value_type>) >, is_constructible<value_type, _Up>, @@ -1003,6 +1007,11 @@ private: } }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class T> + optional(T) -> optional<T>; +#endif + // Comparisons between optionals template <class _Tp, class _Up> _LIBCPP_INLINE_VISIBILITY constexpr diff --git a/include/ostream b/include/ostream index f3250a7080dd9..5404e0dca6c88 100644 --- a/include/ostream +++ b/include/ostream @@ -232,7 +232,7 @@ public: basic_ostream& seekp(off_type __off, ios_base::seekdir __dir); protected: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY basic_ostream() {} // extension, intentially does not initialize }; @@ -249,7 +249,7 @@ public: explicit sentry(basic_ostream<_CharT, _Traits>& __os); ~sentry(); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const {return __ok_;} }; @@ -1071,19 +1071,17 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p) return __os << __p.get(); } -#ifndef _LIBCPP_HAS_NO_DECLTYPE template<class _CharT, class _Traits, class _Yp, class _Dp> inline _LIBCPP_INLINE_VISIBILITY typename enable_if < - is_same<void, typename __void_t<decltype(declval<basic_ostream<_CharT, _Traits>&>() << declval<_Yp>())>::type>::value, + is_same<void, typename __void_t<decltype((declval<basic_ostream<_CharT, _Traits>&>() << declval<typename unique_ptr<_Yp, _Dp>::pointer>()))>::type>::value, basic_ostream<_CharT, _Traits>& >::type operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) { return __os << __p.get(); } -#endif template <class _CharT, class _Traits, size_t _Size> basic_ostream<_CharT, _Traits>& diff --git a/include/queue b/include/queue index 670fbb722ee2e..4677e52ae3a7c 100644 --- a/include/queue +++ b/include/queue @@ -69,6 +69,12 @@ public: void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>) }; +template<class Container> + queue(Container) -> queue<typename Container::value_type, Container>; // C++17 + +template<class Container, class Allocator> + queue(Container, Allocator) -> queue<typename Container::value_type, Container>; // C++17 + template <class T, class Container> bool operator==(const queue<T, Container>& x,const queue<T, Container>& y); @@ -157,6 +163,20 @@ public: is_nothrow_swappable_v<Comp>) }; +template <class Compare, class Container> +priority_queue(Compare, Container) + -> priority_queue<typename Container::value_type, Container, Compare>; // C++17 + +template<class InputIterator, + class Compare = less<typename iterator_traits<InputIterator>::value_type>, + class Container = vector<typename iterator_traits<InputIterator>::value_type>> +priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) + -> priority_queue<typename iterator_traits<InputIterator>::value_type, Container, Compare>; // C++17 + +template<class Compare, class Container, class Allocator> +priority_queue(Compare, Container, Allocator) + -> priority_queue<typename Container::value_type, Container, Compare>; // C++17 + template <class T, class Container, class Compare> void swap(priority_queue<T, Container, Compare>& x, priority_queue<T, Container, Compare>& y) @@ -290,7 +310,7 @@ public: template <class... _Args> _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 - reference emplace(_Args&&... __args) + decltype(auto) emplace(_Args&&... __args) { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} #else void emplace(_Args&&... __args) @@ -321,6 +341,22 @@ public: operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _Container, + class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type +> +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 +> +queue(_Container, _Alloc) + -> queue<typename _Container::value_type, _Container>; +#endif + template <class _Tp, class _Container> inline _LIBCPP_INLINE_VISIBILITY bool @@ -515,6 +551,36 @@ public: __is_nothrow_swappable<value_compare>::value); }; +#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 +> +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_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 +> +priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container()) + -> priority_queue<typename iterator_traits<_InputIterator>::value_type, _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 +> +priority_queue(_Compare, _Container, _Alloc) + -> priority_queue<typename _Container::value_type, _Container, _Compare>; +#endif + template <class _Tp, class _Container, class _Compare> inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp, diff --git a/include/random b/include/random index 9073a5285b1a4..89664a6ca3314 100644 --- a/include/random +++ b/include/random @@ -4673,7 +4673,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr double __py; if (__x < 10) { - const result_type __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040, + const double __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; __px = -__pr.__mean_; __py = _VSTD::pow(__pr.__mean_, (double)__x) / __fac[__x]; diff --git a/include/ratio b/include/ratio index 27aa0ded32e67..7ee5ec245174a 100644 --- a/include/ratio +++ b/include/ratio @@ -63,17 +63,17 @@ typedef ratio< 1000000000000000000000, 1> zetta; // not supported typedef ratio<1000000000000000000000000, 1> yotta; // not supported // 20.11.5, ratio comparison - template <class R1, class R2> constexpr bool ratio_equal_v + template <class R1, class R2> inline constexpr bool ratio_equal_v = ratio_equal<R1, R2>::value; // C++17 - template <class R1, class R2> constexpr bool ratio_not_equal_v + template <class R1, class R2> inline constexpr bool ratio_not_equal_v = ratio_not_equal<R1, R2>::value; // C++17 - template <class R1, class R2> constexpr bool ratio_less_v + template <class R1, class R2> inline constexpr bool ratio_less_v = ratio_less<R1, R2>::value; // C++17 - template <class R1, class R2> constexpr bool ratio_less_equal_v + template <class R1, class R2> inline constexpr bool ratio_less_equal_v = ratio_less_equal<R1, R2>::value; // C++17 - template <class R1, class R2> constexpr bool ratio_greater_v + template <class R1, class R2> inline constexpr bool ratio_greater_v = ratio_greater<R1, R2>::value; // C++17 - template <class R1, class R2> constexpr bool ratio_greater_equal_v + template <class R1, class R2> inline constexpr bool ratio_greater_equal_v = ratio_greater_equal<R1, R2>::value; // C++17 } */ @@ -501,22 +501,28 @@ struct __ratio_gcd }; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_equal_v = ratio_equal<_R1, _R2>::value; -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_not_equal_v = ratio_not_equal<_R1, _R2>::value; -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_less_v = ratio_less<_R1, _R2>::value; -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_less_equal_v = ratio_less_equal<_R1, _R2>::value; -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_greater_v = ratio_greater<_R1, _R2>::value; -template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v +template <class _R1, class _R2> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_greater_equal_v = ratio_greater_equal<_R1, _R2>::value; #endif diff --git a/include/regex b/include/regex index ff84b2738b78c..84aacc029edcb 100644 --- a/include/regex +++ b/include/regex @@ -192,6 +192,11 @@ public: void swap(basic_regex&); }; +template<class ForwardIterator> +basic_regex(ForwardIterator, ForwardIterator, + regex_constants::syntax_option_type = regex_constants::ECMAScript) + -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>; // C++17 + typedef basic_regex<char> regex; typedef basic_regex<wchar_t> wregex; @@ -963,7 +968,7 @@ public: }; template <regex_constants::error_type _Ev> -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_regex_error() { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -2922,6 +2927,15 @@ private: template <class, class> friend class __lookahead; }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template <class _ForwardIterator, + class = typename enable_if<__is_forward_iterator<_ForwardIterator>::value, nullptr_t>::type +> +basic_regex(_ForwardIterator, _ForwardIterator, + regex_constants::syntax_option_type = regex_constants::ECMAScript) + -> basic_regex<typename iterator_traits<_ForwardIterator>::value_type>; +#endif + template <class _CharT, class _Traits> const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase; template <class _CharT, class _Traits> @@ -4013,7 +4027,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first, char_class_type __class_type = __traits_.lookup_classname(__first, __temp, __flags_ & icase); if (__class_type == 0) - __throw_regex_error<regex_constants::error_brack>(); + __throw_regex_error<regex_constants::error_ctype>(); __ml->__add_class(__class_type); __first = _VSTD::next(__temp, 2); return __first; diff --git a/include/set b/include/set index b4c6b2ef8c53c..94db8c79d1071 100644 --- a/include/set +++ b/include/set @@ -668,7 +668,7 @@ public: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type - count(const _K2& __k) const {return __tree_.__count_unique(__k);} + count(const _K2& __k) const {return __tree_.__count_multi(__k);} #endif _LIBCPP_INLINE_VISIBILITY iterator lower_bound(const key_type& __k) @@ -715,11 +715,11 @@ public: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type - equal_range(const _K2& __k) {return __tree_.__equal_range_unique(__k);} + equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);} template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type - equal_range(const _K2& __k) const {return __tree_.__equal_range_unique(__k);} + equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);} #endif }; @@ -1077,7 +1077,7 @@ public: template <typename _K2> _LIBCPP_INLINE_VISIBILITY typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type - count(const _K2& __k) {return __tree_.__count_multi(__k);} + count(const _K2& __k) const {return __tree_.__count_multi(__k);} #endif _LIBCPP_INLINE_VISIBILITY diff --git a/include/span b/include/span new file mode 100644 index 0000000000000..db8f836f91846 --- /dev/null +++ b/include/span @@ -0,0 +1,608 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// + +#ifndef _LIBCPP_SPAN +#define _LIBCPP_SPAN + +/* + span synopsis + +namespace std { + +// constants +inline constexpr ptrdiff_t dynamic_extent = -1; + +// [views.span], class template span +template <class ElementType, ptrdiff_t Extent = dynamic_extent> + class span; + +// [span.comparison], span comparison operators +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator==(span<T, X> l, span<U, Y> r); +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator!=(span<T, X> l, span<U, Y> r); +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator<(span<T, X> l, span<U, Y> r); +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator<=(span<T, X> l, span<U, Y> r); +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator>(span<T, X> l, span<U, Y> r); +template <class T, ptrdiff_t X, class U, ptrdiff_t Y> + constexpr bool operator>=(span<T, X> l, span<U, Y> r); + +// [span.objectrep], views of object representation +template <class ElementType, ptrdiff_t Extent> + span<const byte, ((Extent == dynamic_extent) ? dynamic_extent : + (static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent))> as_bytes(span<ElementType, Extent> s) noexcept; + +template <class ElementType, ptrdiff_t Extent> + span< byte, ((Extent == dynamic_extent) ? dynamic_extent : + (static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent))> as_writable_bytes(span<ElementType, Extent> s) noexcept; + + +namespace std { +template <class ElementType, ptrdiff_t Extent = dynamic_extent> +class span { +public: + // constants and types + using element_type = ElementType; + using value_type = remove_cv_t<ElementType>; + using index_type = ptrdiff_t; + using difference_type = ptrdiff_t; + using pointer = element_type*; + using reference = element_type&; + using iterator = implementation-defined; + using const_iterator = implementation-defined; + using reverse_iterator = std::reverse_iterator<iterator>; + using const_reverse_iterator = std::reverse_iterator<const_iterator>; + static constexpr index_type extent = Extent; + + // [span.cons], span constructors, copy, assignment, and destructor + constexpr span() noexcept; + constexpr span(pointer ptr, index_type count); + constexpr span(pointer firstElem, pointer lastElem); + template <size_t N> + constexpr span(element_type (&arr)[N]) noexcept; + template <size_t N> + constexpr span(array<value_type, N>& arr) noexcept; + template <size_t N> + constexpr span(const array<value_type, N>& arr) noexcept; + template <class Container> + constexpr span(Container& cont); + template <class Container> + constexpr span(const Container& cont); + constexpr span(const span& other) noexcept = default; + template <class OtherElementType, ptrdiff_t OtherExtent> + constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept; + ~span() noexcept = default; + constexpr span& operator=(const span& other) noexcept = default; + + // [span.sub], span subviews + template <ptrdiff_t Count> + constexpr span<element_type, Count> first() const; + template <ptrdiff_t Count> + constexpr span<element_type, Count> last() const; + template <ptrdiff_t Offset, ptrdiff_t Count = dynamic_extent> + constexpr span<element_type, see below> subspan() const; + + constexpr span<element_type, dynamic_extent> first(index_type count) const; + constexpr span<element_type, dynamic_extent> last(index_type count) const; + constexpr span<element_type, dynamic_extent> subspan(index_type offset, index_type count = dynamic_extent) const; + + // [span.obs], span observers + constexpr index_type size() const noexcept; + constexpr index_type size_bytes() const noexcept; + constexpr bool empty() const noexcept; + + // [span.elem], span element access + constexpr reference operator[](index_type idx) const; + constexpr reference operator()(index_type idx) const; + constexpr pointer data() const noexcept; + + // [span.iterators], span iterator support + constexpr iterator begin() const noexcept; + constexpr iterator end() const noexcept; + constexpr const_iterator cbegin() const noexcept; + constexpr const_iterator cend() const noexcept; + constexpr reverse_iterator rbegin() const noexcept; + constexpr reverse_iterator rend() const noexcept; + constexpr const_reverse_iterator crbegin() const noexcept; + constexpr const_reverse_iterator crend() const noexcept; + +private: + pointer data_; // exposition only + index_type size_; // exposition only +}; + +template<class T, size_t N> + span(T (&)[N]) -> span<T, N>; + +template<class T, size_t N> + span(array<T, N>&) -> span<T, N>; + +template<class T, size_t N> + span(const array<T, N>&) -> span<const T, N>; + +template<class Container> + span(Container&) -> span<typename Container::value_type>; + +template<class Container> + span(const Container&) -> span<const typename Container::value_type>; + +} // namespace std + +*/ + +#include <__config> +#include <cstddef> // for ptrdiff_t +#include <iterator> // for iterators +#include <array> // for array +#include <type_traits> // for remove_cv, etc +#include <cstddef> // for byte + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +inline constexpr ptrdiff_t dynamic_extent = -1; +template <typename _Tp, ptrdiff_t _Extent = dynamic_extent> class span; + + +template <class _Tp> +struct __is_span_impl : public false_type {}; + +template <class _Tp, ptrdiff_t _Extent> +struct __is_span_impl<span<_Tp, _Extent>> : public true_type {}; + +template <class _Tp> +struct __is_span : public __is_span_impl<remove_cv_t<_Tp>> {}; + +template <class _Tp> +struct __is_std_array_impl : public false_type {}; + +template <class _Tp, size_t _Sz> +struct __is_std_array_impl<array<_Tp, _Sz>> : public true_type {}; + +template <class _Tp> +struct __is_std_array : public __is_std_array_impl<remove_cv_t<_Tp>> {}; + +template <class _Tp, class _ElementType, class = void> +struct __is_span_compatible_container : public false_type {}; + +template <class _Tp, class _ElementType> +struct __is_span_compatible_container<_Tp, _ElementType, + void_t< + // is not a specialization of span + typename enable_if<!__is_span<_Tp>::value, nullptr_t>::type, + // is not a specialization of array + typename enable_if<!__is_std_array<_Tp>::value, nullptr_t>::type, + // is_array_v<Container> is false, + typename enable_if<!is_array_v<_Tp>, nullptr_t>::type, + // data(cont) and size(cont) are well formed + decltype(data(declval<_Tp>())), + decltype(size(declval<_Tp>())), + // remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[] + typename enable_if< + is_convertible_v<remove_pointer_t<decltype(data(declval<_Tp &>()))>(*)[], + _ElementType(*)[]>, + nullptr_t>::type + >> + : public true_type {}; + + +template <typename _Tp, ptrdiff_t _Extent> +class _LIBCPP_TEMPLATE_VIS span { +public: +// constants and types + using element_type = _Tp; + using value_type = remove_cv_t<_Tp>; + using index_type = ptrdiff_t; + using difference_type = ptrdiff_t; + using pointer = _Tp *; + using const_pointer = const _Tp *; // not in standard + using reference = _Tp &; + using const_reference = const _Tp &; // not in standard + using iterator = __wrap_iter<pointer>; + using const_iterator = __wrap_iter<const_pointer>; + using reverse_iterator = _VSTD::reverse_iterator<iterator>; + using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>; + + static constexpr index_type extent = _Extent; + static_assert (_Extent >= 0, "Can't have a span with an extent < 0"); + +// [span.cons], span constructors, copy, assignment, and destructor + _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} + { static_assert(_Extent == 0, "Can't default construct a statically sized span with size > 0"); } + + constexpr span (const span&) noexcept = default; + constexpr span& operator=(const span&) noexcept = default; + + _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __ptr, index_type __count) : __data{__ptr} + { (void)__count; _LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (ptr, len)"); } + _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __f, pointer __l) : __data{__f} + { (void)__l; _LIBCPP_ASSERT(_Extent == distance(__f, __l), "size mismatch in span's constructor (ptr, ptr)"); } + + _LIBCPP_INLINE_VISIBILITY constexpr span(element_type (&__arr)[_Extent]) noexcept : __data{__arr} {} + _LIBCPP_INLINE_VISIBILITY constexpr span( array<value_type, _Extent>& __arr) noexcept : __data{__arr.data()} {} + _LIBCPP_INLINE_VISIBILITY constexpr span(const array<value_type, _Extent>& __arr) noexcept : __data{__arr.data()} {} + + template <class _Container> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span( _Container& __c, + enable_if_t<__is_span_compatible_container<_Container, _Tp>::value, nullptr_t> = nullptr) + : __data{_VSTD::data(__c)} + { _LIBCPP_ASSERT(_Extent == _VSTD::size(__c), "size mismatch in span's constructor (container))"); } + + template <class _Container> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const _Container& __c, + enable_if_t<__is_span_compatible_container<const _Container, _Tp>::value, nullptr_t> = nullptr) + : __data{_VSTD::data(__c)} + { _LIBCPP_ASSERT(_Extent == _VSTD::size(__c), "size mismatch in span's constructor (const container)"); } + + template <class _OtherElementType> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const span<_OtherElementType, _Extent>& __other, + enable_if_t< + is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, + nullptr_t> = nullptr) + : __data{__other.data()} {} + + template <class _OtherElementType> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const span<_OtherElementType, dynamic_extent>& __other, + enable_if_t< + is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, + nullptr_t> = nullptr) noexcept + : __data{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); } + + +// ~span() noexcept = default; + + template <ptrdiff_t _Count> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, _Count> first() const noexcept + { + static_assert(_Count >= 0, "Count must be >= 0 in span::first()"); + static_assert(_Count <= _Extent, "Count out of range in span::first()"); + return {data(), _Count}; + } + + template <ptrdiff_t _Count> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, _Count> last() const noexcept + { + static_assert(_Count >= 0, "Count must be >= 0 in span::last()"); + static_assert(_Count <= _Extent, "Count out of range in span::last()"); + return {data() + size() - _Count, _Count}; + } + + _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, dynamic_extent> first(index_type __count) const noexcept + { + _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::first(count)"); + return {data(), __count}; + } + + _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, dynamic_extent> last(index_type __count) const noexcept + { + _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::last(count)"); + return {data() + size() - __count, __count}; + } + + template <ptrdiff_t _Offset, ptrdiff_t _Count = dynamic_extent> + inline _LIBCPP_INLINE_VISIBILITY + constexpr auto subspan() const noexcept + -> span<element_type, _Count != dynamic_extent ? _Count : _Extent - _Offset> + { + _LIBCPP_ASSERT(_Offset >= 0 && _Offset <= size(), "Offset out of range in span::subspan()"); + return {data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count}; + } + + + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, dynamic_extent> + subspan(index_type __offset, index_type __count = dynamic_extent) const noexcept + { + _LIBCPP_ASSERT( __offset >= 0 && __offset <= size(), "Offset out of range in span::subspan(offset, count)"); + _LIBCPP_ASSERT((__count >= 0 && __count <= size()) || __count == dynamic_extent, "Count out of range in span::subspan(offset, count)"); + if (__count == dynamic_extent) + return {data() + __offset, size() - __offset}; + _LIBCPP_ASSERT(__offset + __count <= size(), "count + offset out of range in span::subspan(offset, count)"); + return {data() + __offset, __count}; + } + + _LIBCPP_INLINE_VISIBILITY constexpr index_type size() const noexcept { return _Extent; } + _LIBCPP_INLINE_VISIBILITY constexpr index_type size_bytes() const noexcept { return _Extent * sizeof(element_type); } + _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return _Extent == 0; } + + _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](index_type __idx) const noexcept + { + _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T,N>[] index out of bounds"); + return __data[__idx]; + } + + _LIBCPP_INLINE_VISIBILITY constexpr reference operator()(index_type __idx) const noexcept + { + _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T,N>() index out of bounds"); + return __data[__idx]; + } + + _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } + +// [span.iter], span iterator support + _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept { return iterator(data()); } + _LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept { return iterator(data() + size()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_iterator cbegin() const noexcept { return const_iterator(data()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_iterator cend() const noexcept { return const_iterator(data() + size()); } + _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); } + _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rend() const noexcept { return reverse_iterator(begin()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); } + + _LIBCPP_INLINE_VISIBILITY constexpr void swap(span &__other) noexcept + { + pointer __p = __data; + __data = __other.__data; + __other.__data = __p; + } + + _LIBCPP_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept + { return {reinterpret_cast<const byte *>(data()), size_bytes()}; } + + _LIBCPP_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> __as_writeable_bytes() const noexcept + { return {reinterpret_cast<byte *>(data()), size_bytes()}; } + +private: + pointer __data; + +}; + + +template <typename _Tp> +class _LIBCPP_TEMPLATE_VIS span<_Tp, dynamic_extent> { +private: + +public: +// constants and types + using element_type = _Tp; + using value_type = remove_cv_t<_Tp>; + using index_type = ptrdiff_t; + using difference_type = ptrdiff_t; + using pointer = _Tp *; + using const_pointer = const _Tp *; // not in standard + using reference = _Tp &; + using const_reference = const _Tp &; // not in standard + using iterator = __wrap_iter<pointer>; + using const_iterator = __wrap_iter<const_pointer>; + using reverse_iterator = _VSTD::reverse_iterator<iterator>; + using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>; + + static constexpr index_type extent = dynamic_extent; + +// [span.cons], span constructors, copy, assignment, and destructor + _LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr}, __size{0} {} + + constexpr span (const span&) noexcept = default; + constexpr span& operator=(const span&) noexcept = default; + + _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __ptr, index_type __count) : __data{__ptr}, __size{__count} {} + _LIBCPP_INLINE_VISIBILITY constexpr span(pointer __f, pointer __l) : __data{__f}, __size{distance(__f, __l)} {} + + template <size_t _Sz> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(element_type (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {} + + template <size_t _Sz> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} + + template <size_t _Sz> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const array<value_type, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} + + template <class _Container> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span( _Container& __c, + enable_if_t<__is_span_compatible_container<_Container, _Tp>::value, nullptr_t> = nullptr) + : __data{_VSTD::data(__c)}, __size{(index_type) _VSTD::size(__c)} {} + + template <class _Container> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const _Container& __c, + enable_if_t<__is_span_compatible_container<const _Container, _Tp>::value, nullptr_t> = nullptr) + : __data{_VSTD::data(__c)}, __size{(index_type) _VSTD::size(__c)} {} + + + template <class _OtherElementType, ptrdiff_t _OtherExtent> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span(const span<_OtherElementType, _OtherExtent>& __other, + enable_if_t< + is_convertible_v<_OtherElementType(*)[], element_type (*)[]>, + nullptr_t> = nullptr) noexcept + : __data{__other.data()}, __size{__other.size()} {} + +// ~span() noexcept = default; + + template <ptrdiff_t _Count> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, _Count> first() const noexcept + { + static_assert(_Count >= 0); + _LIBCPP_ASSERT(_Count <= size(), "Count out of range in span::first()"); + return {data(), _Count}; + } + + template <ptrdiff_t _Count> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, _Count> last() const noexcept + { + static_assert(_Count >= 0); + _LIBCPP_ASSERT(_Count <= size(), "Count out of range in span::last()"); + return {data() + size() - _Count, _Count}; + } + + _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, dynamic_extent> first(index_type __count) const noexcept + { + _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::first(count)"); + return {data(), __count}; + } + + _LIBCPP_INLINE_VISIBILITY + constexpr span<element_type, dynamic_extent> last (index_type __count) const noexcept + { + _LIBCPP_ASSERT(__count >= 0 && __count <= size(), "Count out of range in span::last(count)"); + return {data() + size() - __count, __count}; + } + + template <ptrdiff_t _Offset, ptrdiff_t _Count = dynamic_extent> + inline _LIBCPP_INLINE_VISIBILITY + constexpr span<_Tp, dynamic_extent> subspan() const noexcept + { + _LIBCPP_ASSERT(_Offset >= 0 && _Offset <= size(), "Offset out of range in span::subspan()"); + _LIBCPP_ASSERT(_Count == dynamic_extent || _Offset + _Count <= size(), "Count out of range in span::subspan()"); + return {data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count}; + } + + constexpr span<element_type, dynamic_extent> + inline _LIBCPP_INLINE_VISIBILITY + subspan(index_type __offset, index_type __count = dynamic_extent) const noexcept + { + _LIBCPP_ASSERT( __offset >= 0 && __offset <= size(), "Offset out of range in span::subspan(offset, count)"); + _LIBCPP_ASSERT((__count >= 0 && __count <= size()) || __count == dynamic_extent, "count out of range in span::subspan(offset, count)"); + if (__count == dynamic_extent) + return {data() + __offset, size() - __offset}; + _LIBCPP_ASSERT(__offset + __count <= size(), "Offset + count out of range in span::subspan(offset, count)"); + return {data() + __offset, __count}; + } + + _LIBCPP_INLINE_VISIBILITY constexpr index_type size() const noexcept { return __size; } + _LIBCPP_INLINE_VISIBILITY constexpr index_type size_bytes() const noexcept { return __size * sizeof(element_type); } + _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size == 0; } + + _LIBCPP_INLINE_VISIBILITY constexpr reference operator[](index_type __idx) const noexcept + { + _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T>[] index out of bounds"); + return __data[__idx]; + } + + _LIBCPP_INLINE_VISIBILITY constexpr reference operator()(index_type __idx) const noexcept + { + _LIBCPP_ASSERT(__idx >= 0 && __idx < size(), "span<T>() index out of bounds"); + return __data[__idx]; + } + + _LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; } + +// [span.iter], span iterator support + _LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept { return iterator(data()); } + _LIBCPP_INLINE_VISIBILITY constexpr iterator end() const noexcept { return iterator(data() + size()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_iterator cbegin() const noexcept { return const_iterator(data()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_iterator cend() const noexcept { return const_iterator(data() + size()); } + _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); } + _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator rend() const noexcept { return reverse_iterator(begin()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); } + _LIBCPP_INLINE_VISIBILITY constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); } + + _LIBCPP_INLINE_VISIBILITY constexpr void swap(span &__other) noexcept + { + pointer __p = __data; + __data = __other.__data; + __other.__data = __p; + + index_type __sz = __size; + __size = __other.__size; + __other.__size = __sz; + } + + _LIBCPP_INLINE_VISIBILITY span<const byte, dynamic_extent> __as_bytes() const noexcept + { return {reinterpret_cast<const byte *>(data()), size_bytes()}; } + + _LIBCPP_INLINE_VISIBILITY span<byte, dynamic_extent> __as_writeable_bytes() const noexcept + { return {reinterpret_cast<byte *>(data()), size_bytes()}; } + +private: + pointer __data; + index_type __size; +}; + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator==(const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return equal(__lhs.begin(), __lhs.end(), __rhs.begin(), __rhs.end()); } + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator!=(const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return !(__rhs == __lhs); } + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator< (const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return lexicographical_compare (__lhs.begin(), __lhs.end(), __rhs.begin(), __rhs.end()); } + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator<=(const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return !(__rhs < __lhs); } + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator> (const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return __rhs < __lhs; } + +template <class _Tp1, ptrdiff_t _Extent1, class _Tp2, ptrdiff_t _Extent2> + constexpr bool + operator>=(const span<_Tp1, _Extent1>& __lhs, const span<_Tp2, _Extent2>& __rhs) + { return !(__lhs < __rhs); } + +// as_bytes & as_writeable_bytes +template <class _Tp, ptrdiff_t _Extent> + auto as_bytes(span<_Tp, _Extent> __s) noexcept + -> decltype(__s.__as_bytes()) + { return __s.__as_bytes(); } + +template <class _Tp, ptrdiff_t _Extent> + auto as_writeable_bytes(span<_Tp, _Extent> __s) noexcept + -> typename enable_if<!is_const_v<_Tp>, decltype(__s.__as_writeable_bytes())>::type + { return __s.__as_writeable_bytes(); } + +template <class _Tp, ptrdiff_t _Extent> + constexpr void swap(span<_Tp, _Extent> &__lhs, span<_Tp, _Extent> &__rhs) noexcept + { __lhs.swap(__rhs); } + + +// Deduction guides +template<class _Tp, size_t _Sz> + span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>; + +template<class _Tp, size_t _Sz> + span(array<_Tp, _Sz>&) -> span<_Tp, _Sz>; + +template<class _Tp, size_t _Sz> + span(const array<_Tp, _Sz>&) -> span<const _Tp, _Sz>; + +template<class _Container> + span(_Container&) -> span<typename _Container::value_type>; + +template<class _Container> + span(const _Container&) -> span<const typename _Container::value_type>; + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_SPAN diff --git a/include/stack b/include/stack index 0cb4c6ca925ee..2b3f8aea19e69 100644 --- a/include/stack +++ b/include/stack @@ -61,6 +61,12 @@ public: void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>) }; +template<class Container> + stack(Container) -> stack<typename Container::value_type, Container>; // C++17 + +template<class Container, class Allocator> + stack(Container, Allocator) -> stack<typename Container::value_type, Container>; // C++17 + template <class T, class Container> bool operator==(const stack<T, Container>& x, const stack<T, Container>& y); template <class T, class Container> @@ -199,7 +205,7 @@ public: template <class... _Args> _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 - reference emplace(_Args&&... __args) + decltype(auto) emplace(_Args&&... __args) { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} #else void emplace(_Args&&... __args) @@ -229,6 +235,22 @@ public: operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _Container, + class = typename enable_if<!__is_allocator<_Container>::value, nullptr_t>::type +> +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 + > +stack(_Container, _Alloc) + -> stack<typename _Container::value_type, _Container>; +#endif + template <class _Tp, class _Container> inline _LIBCPP_INLINE_VISIBILITY bool diff --git a/include/stdexcept b/include/stdexcept index 95a96cc07678b..6533497e4ea53 100644 --- a/include/stdexcept +++ b/include/stdexcept @@ -185,7 +185,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD // in the dylib _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*); -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_logic_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -196,7 +196,7 @@ void __throw_logic_error(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_domain_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -207,7 +207,7 @@ void __throw_domain_error(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_invalid_argument(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -218,7 +218,7 @@ void __throw_invalid_argument(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_length_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -229,7 +229,7 @@ void __throw_length_error(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_out_of_range(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -240,7 +240,7 @@ void __throw_out_of_range(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_range_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -251,7 +251,7 @@ void __throw_range_error(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_overflow_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -262,7 +262,7 @@ void __throw_overflow_error(const char*__msg) #endif } -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_underflow_error(const char*__msg) { #ifndef _LIBCPP_NO_EXCEPTIONS diff --git a/include/stdio.h b/include/stdio.h index f124176401648..77a314bf3836f 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -109,13 +109,6 @@ void perror(const char* s); #ifdef __cplusplus -// snprintf -#if defined(_LIBCPP_MSVCRT_LIKE) -extern "C" { -int vasprintf(char **sptr, const char *__restrict fmt, va_list ap); -} -#endif - #undef getc #undef putc #undef clearerr diff --git a/include/streambuf b/include/streambuf index ea64f57804596..37a653237161b 100644 --- a/include/streambuf +++ b/include/streambuf @@ -132,6 +132,9 @@ public: typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; + static_assert((is_same<_CharT, typename traits_type::char_type>::value), + "traits_type::char_type must be the same type as CharT"); + virtual ~basic_streambuf(); // 27.6.2.2.1 locales: @@ -233,9 +236,9 @@ protected: void swap(basic_streambuf& __rhs); // 27.6.2.3.2 Get area: - _LIBCPP_ALWAYS_INLINE char_type* eback() const {return __binp_;} - _LIBCPP_ALWAYS_INLINE char_type* gptr() const {return __ninp_;} - _LIBCPP_ALWAYS_INLINE char_type* egptr() const {return __einp_;} + _LIBCPP_INLINE_VISIBILITY char_type* eback() const {return __binp_;} + _LIBCPP_INLINE_VISIBILITY char_type* gptr() const {return __ninp_;} + _LIBCPP_INLINE_VISIBILITY char_type* egptr() const {return __einp_;} inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY void gbump(int __n) { __ninp_ += __n; } @@ -248,14 +251,14 @@ protected: } // 27.6.2.3.3 Put area: - _LIBCPP_ALWAYS_INLINE char_type* pbase() const {return __bout_;} - _LIBCPP_ALWAYS_INLINE char_type* pptr() const {return __nout_;} - _LIBCPP_ALWAYS_INLINE char_type* epptr() const {return __eout_;} + _LIBCPP_INLINE_VISIBILITY char_type* pbase() const {return __bout_;} + _LIBCPP_INLINE_VISIBILITY char_type* pptr() const {return __nout_;} + _LIBCPP_INLINE_VISIBILITY char_type* epptr() const {return __eout_;} inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY void pbump(int __n) { __nout_ += __n; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void __pbump(streamsize __n) { __nout_ += __n; } inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY diff --git a/include/string b/include/string index f5d548965aaef..162e54058c426 100644 --- a/include/string +++ b/include/string @@ -104,7 +104,8 @@ public: const Allocator& a = Allocator()); template<class T> basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17 - explicit basic_string(const basic_string_view<charT, traits> sv, const Allocator& a = Allocator()); + template <class T> + 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(size_type n, value_type c, const allocator_type& a = allocator_type()); @@ -120,7 +121,8 @@ public: operator basic_string_view<charT, traits>() const noexcept; basic_string& operator=(const basic_string& str); - basic_string& operator=(basic_string_view<charT, traits> sv); + template <class T> + basic_string& operator=(const T& t); // C++17 basic_string& operator=(basic_string&& str) noexcept( allocator_type::propagate_on_container_move_assignment::value || @@ -164,13 +166,15 @@ public: reference at(size_type n); basic_string& operator+=(const basic_string& str); - basic_string& operator+=(basic_string_view<charT, traits> sv); + template <class T> + basic_string& operator+=(const T& t); // C++17 basic_string& operator+=(const value_type* s); basic_string& operator+=(value_type c); basic_string& operator+=(initializer_list<value_type>); basic_string& append(const basic_string& str); - basic_string& append(basic_string_view<charT, traits> sv); + template <class T> + basic_string& append(const T& t); // C++17 basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14 template <class T> basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17 @@ -189,7 +193,8 @@ public: const_reference back() const; basic_string& assign(const basic_string& str); - basic_string& assign(basic_string_view<charT, traits> sv); + template <class T> + basic_string& assign(const T& t); // C++17 basic_string& assign(basic_string&& str); basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14 template <class T> @@ -202,7 +207,8 @@ public: basic_string& assign(initializer_list<value_type>); basic_string& insert(size_type pos1, const basic_string& str); - basic_string& insert(size_type pos1, basic_string_view<charT, traits> sv); + template <class T> + basic_string& insert(size_type pos1, const T& t); basic_string& insert(size_type pos1, const basic_string& str, size_type pos2, size_type n); template <class T> @@ -221,7 +227,8 @@ public: iterator erase(const_iterator first, const_iterator last); basic_string& replace(size_type pos1, size_type n1, const basic_string& str); - basic_string& replace(size_type pos1, size_type n1, basic_string_view<charT, traits> sv); + template <class T> + basic_string& replace(size_type pos1, size_type n1, const T& t); // C++17 basic_string& replace(size_type pos1, size_type n1, const basic_string& str, size_type pos2, size_type n2=npos); // C++14 template <class T> @@ -231,7 +238,8 @@ public: basic_string& replace(size_type pos, size_type n1, const value_type* s); basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c); basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str); - basic_string& replace(const_iterator i1, const_iterator i2, basic_string_view<charT, traits> sv); + template <class T> + basic_string& replace(const_iterator i1, const_iterator i2, const T& t); // C++17 basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n); basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s); basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c); @@ -253,45 +261,53 @@ public: allocator_type get_allocator() const noexcept; size_type find(const basic_string& str, size_type pos = 0) const noexcept; - size_type find(basic_string_view<charT, traits> sv, 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 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; - size_type rfind(basic_string_view<charT, traits> sv, 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 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; - size_type find_first_of(basic_string_view<charT, traits> sv, 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 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; - size_type find_last_of(basic_string_view<charT, traits> sv, 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 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; - size_type find_first_not_of(basic_string_view<charT, traits> sv, 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 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; - size_type find_last_not_of(basic_string_view<charT, traits> sv, 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 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; - int compare(basic_string_view<charT, traits> sv) const noexcept; + template <class T> + int compare(const T& t) const noexcept; // C++17 int compare(size_type pos1, size_type n1, const basic_string& str) const; - int compare(size_type pos1, size_type n1, basic_string_view<charT, traits> sv) 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 basic_string& str, size_type pos2, size_type n2=npos) const; // C++14 template <class T> @@ -311,6 +327,13 @@ public: bool __invariants() const; }; +template<class InputIterator, + class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +basic_string(InputIterator, InputIterator, Allocator = Allocator()) + -> basic_string<typename iterator_traits<InputIterator>::value_type, + char_traits<typename iterator_traits<InputIterator>::value_type>, + Allocator>; // C++17 + template<class charT, class traits, class Allocator> basic_string<charT, traits, Allocator> operator+(const basic_string<charT, traits, Allocator>& lhs, @@ -651,11 +674,14 @@ public: typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; - static_assert(is_pod<value_type>::value, "Character type of basic_string must be a POD"); - static_assert((is_same<_CharT, typename traits_type::char_type>::value), + static_assert((!is_array<value_type>::value), "Character type of basic_string must not be an array"); + static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string must be standard-layout"); + static_assert(( is_trivial<value_type>::value), "Character type of basic_string must be trivial"); + static_assert(( is_same<_CharT, typename traits_type::char_type>::value), "traits_type::char_type must be the same type as CharT"); - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(( is_same<typename allocator_type::value_type, value_type>::value), "Allocator::value_type must be same type as value_type"); + #if defined(_LIBCPP_RAW_ITERATORS) typedef pointer iterator; typedef const_pointer const_iterator; @@ -779,31 +805,51 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string(basic_string&& __str, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s); + + template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type> _LIBCPP_INLINE_VISIBILITY - basic_string(const _CharT* __s, const _Allocator& __a); + basic_string(const _CharT* __s) { + _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr"); + __init(__s, traits_type::length(__s)); +# if _LIBCPP_DEBUG_LEVEL >= 2 + __get_db()->__insert_c(this); +# endif + } + + template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type> + _LIBCPP_INLINE_VISIBILITY + basic_string(const _CharT* __s, const _Allocator& __a); + _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n); _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); _LIBCPP_INLINE_VISIBILITY basic_string(size_type __n, _CharT __c); - _LIBCPP_INLINE_VISIBILITY - basic_string(size_type __n, _CharT __c, const _Allocator& __a); + + template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type> + _LIBCPP_INLINE_VISIBILITY + basic_string(size_type __n, _CharT __c, const _Allocator& __a); + basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator()); _LIBCPP_INLINE_VISIBILITY basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator()); - template<class _Tp> + + template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS basic_string(const _Tp& __t, size_type __pos, size_type __n, - const allocator_type& __a = allocator_type(), - typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type* = 0); - _LIBCPP_INLINE_VISIBILITY explicit - basic_string(__self_view __sv); - _LIBCPP_INLINE_VISIBILITY - basic_string(__self_view __sv, const _Allocator& __a); + const allocator_type& __a = allocator_type()); + + template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + explicit basic_string(const _Tp& __t); + + template<class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + explicit basic_string(const _Tp& __t, const allocator_type& __a); + template<class _InputIterator> _LIBCPP_INLINE_VISIBILITY basic_string(_InputIterator __first, _InputIterator __last); @@ -824,11 +870,10 @@ public: basic_string& operator=(const basic_string& __str); -#ifndef _LIBCPP_CXX03_LANG - template <class = void> -#endif - _LIBCPP_INLINE_VISIBILITY - basic_string& operator=(__self_view __sv) {return assign(__sv);} + template <class _Tp, class = typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type> + basic_string& operator=(const _Tp& __t) + {__self_view __sv = __t; return assign(__sv);} + #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& operator=(basic_string&& __str) @@ -918,7 +963,15 @@ public: reference at(size_type __n); _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);} - _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv) {return append(__sv);} + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + operator+=(const _Tp& __t) {__self_view __sv = __t; return append(__sv);} _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);} _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;} #ifndef _LIBCPP_CXX03_LANG @@ -927,9 +980,17 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string& append(const basic_string& __str); - _LIBCPP_INLINE_VISIBILITY - basic_string& append(__self_view __sv) { return append(__sv.data(), __sv.size()); } + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + append(const _Tp& __t) { __self_view __sv = __t; return append(__sv.data(), __sv.size()); } basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos); + template <class _Tp> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS typename enable_if @@ -984,8 +1045,14 @@ public: _LIBCPP_INLINE_VISIBILITY reference back(); _LIBCPP_INLINE_VISIBILITY const_reference back() const; - _LIBCPP_INLINE_VISIBILITY - basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); } + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + assign(const _Tp & __t) { __self_view __sv = __t; return assign(__sv.data(), __sv.size()); } _LIBCPP_INLINE_VISIBILITY basic_string& assign(const basic_string& __str) { return *this = __str; } #ifndef _LIBCPP_CXX03_LANG @@ -1031,8 +1098,17 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string& insert(size_type __pos1, const basic_string& __str); - _LIBCPP_INLINE_VISIBILITY - basic_string& insert(size_type __pos1, __self_view __sv) { return insert(__pos1, __sv.data(), __sv.size()); } + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + insert(size_type __pos1, const _Tp& __t) + { __self_view __sv = __t; return insert(__pos1, __sv.data(), __sv.size()); } + template <class _Tp> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS typename enable_if @@ -1080,8 +1156,15 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str); - _LIBCPP_INLINE_VISIBILITY - basic_string& replace(size_type __pos1, size_type __n1, __self_view __sv) { return replace(__pos1, __n1, __sv.data(), __sv.size()); } + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + replace(size_type __pos1, size_type __n1, const _Tp& __t) { __self_view __sv = __t; return replace(__pos1, __n1, __sv.data(), __sv.size()); } basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos); template <class _Tp> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS @@ -1096,8 +1179,16 @@ public: basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c); _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str); - _LIBCPP_INLINE_VISIBILITY - basic_string& replace(const_iterator __i1, const_iterator __i2, __self_view __sv) { return replace(__i1 - begin(), __i2 - __i1, __sv); } + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + basic_string& + >::type + replace(const_iterator __i1, const_iterator __i2, const _Tp& __t) { __self_view __sv = __t; return replace(__i1 - begin(), __i2 - __i1, __sv); } + _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n); _LIBCPP_INLINE_VISIBILITY @@ -1145,8 +1236,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + find(const _Tp& __t, size_type __pos = 0) const; 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; @@ -1154,8 +1252,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + rfind(const _Tp& __t, size_type __pos = npos) const; 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; @@ -1163,8 +1268,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + find_first_of(const _Tp& __t, size_type __pos = 0) const; 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; @@ -1173,8 +1285,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + find_last_of(const _Tp& __t, size_type __pos = npos) const; 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; @@ -1183,8 +1302,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + find_first_not_of(const _Tp &__t, size_type __pos = 0) const; 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; @@ -1193,8 +1319,15 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + size_type + >::type + find_last_not_of(const _Tp& __t, size_type __pos = npos) const; 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; @@ -1203,13 +1336,29 @@ public: _LIBCPP_INLINE_VISIBILITY int compare(const basic_string& __str) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - int compare(__self_view __sv) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY - int compare(size_type __pos1, size_type __n1, __self_view __sv) const; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + int + >::type + compare(const _Tp &__t) const; + + template <class _Tp> + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + typename enable_if + < + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + int + >::type + compare(size_type __pos1, size_type __n1, const _Tp& __t) const; + _LIBCPP_INLINE_VISIBILITY int compare(size_type __pos1, size_type __n1, const basic_string& __str) const; int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos) const; + template <class _Tp> inline _LIBCPP_INLINE_VISIBILITY typename enable_if @@ -1250,6 +1399,8 @@ public: _LIBCPP_INLINE_VISIBILITY bool __invariants() const; + _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY bool __is_long() const _NOEXCEPT {return bool(__r_.first().__s.__size_ & __short_mask);} @@ -1363,9 +1514,13 @@ private: enum {__alignment = 16}; static _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __s) _NOEXCEPT - {return (__s < __min_cap ? static_cast<size_type>(__min_cap) : - __align_it<sizeof(value_type) < __alignment ? - __alignment/sizeof(value_type) : 1 > (__s+1)) - 1;} + { + if (__s < __min_cap) return static_cast<size_type>(__min_cap) - 1; + size_type __guess = __align_it<sizeof(value_type) < __alignment ? + __alignment/sizeof(value_type) : 1 > (__s+1) - 1; + if (__guess == __min_cap) ++__guess; + return __guess; + } inline void __init(const value_type* __s, size_type __sz, size_type __reserve); @@ -1415,16 +1570,14 @@ private: { if (!__str.__is_long()) { - clear(); - shrink_to_fit(); + __clear_and_shrink(); __alloc() = __str.__alloc(); } else { allocator_type __a = __str.__alloc(); pointer __p = __alloc_traits::allocate(__a, __str.__get_long_cap()); - clear(); - shrink_to_fit(); + __clear_and_shrink(); __alloc() = _VSTD::move(__a); __set_long_pointer(__p); __set_long_cap(__str.__get_long_cap()); @@ -1481,6 +1634,35 @@ private: friend basic_string operator+<>(const basic_string&, value_type); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _InputIterator, + class _CharT = typename iterator_traits<_InputIterator>::value_type, + class _Allocator = allocator<_CharT>, + class = typename enable_if<__is_input_iterator<_InputIterator>::value, void>::type, + class = typename enable_if<__is_allocator<_Allocator>::value, void>::type + > +basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator()) + -> basic_string<_CharT, char_traits<_CharT>, _Allocator>; + +template<class _CharT, + class _Traits, + class _Allocator = allocator<_CharT>, + class = typename enable_if<__is_allocator<_Allocator>::value, void>::type + > +explicit basic_string(basic_string_view<_CharT, _Traits>, const _Allocator& = _Allocator()) + -> basic_string<_CharT, _Traits, _Allocator>; + +template<class _CharT, + class _Traits, + class _Allocator = allocator<_CharT>, + class = typename enable_if<__is_allocator<_Allocator>::value, void>::type, + class _Sz = typename allocator_traits<_Allocator>::size_type + > +basic_string(basic_string_view<_CharT, _Traits>, _Sz, _Sz, const _Allocator& = _Allocator()) + -> basic_string<_CharT, _Traits, _Allocator>; +#endif + + template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY void @@ -1598,18 +1780,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty } template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s) -{ - _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr"); - __init(__s, traits_type::length(__s)); -#if _LIBCPP_DEBUG_LEVEL >= 2 - __get_db()->__insert_c(this); -#endif -} - -template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY +template <class> basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1746,7 +1917,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __ } template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY +template <class> basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1787,13 +1958,13 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st } template <class _CharT, class _Traits, class _Allocator> -template <class _Tp> +template <class _Tp, class> basic_string<_CharT, _Traits, _Allocator>::basic_string( - const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a, - typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *) + const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a) : __r_(__second_tag(), __a) { - __self_view __sv = __self_view(__t).substr(__pos, __n); + __self_view __sv0 = __t; + __self_view __sv = __sv0.substr(__pos, __n); __init(__sv.data(), __sv.size()); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); @@ -1801,9 +1972,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string( } template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv) +template <class _Tp, class> +basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t) { + __self_view __sv = __t; __init(__sv.data(), __sv.size()); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); @@ -1811,10 +1983,11 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv) } template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const _Allocator& __a) +template <class _Tp, class> +basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _Allocator& __a) : __r_(__second_tag(), __a) { + __self_view __sv = __t; __init(__sv.data(), __sv.size()); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); @@ -2102,8 +2275,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) #endif { - clear(); - shrink_to_fit(); + __clear_and_shrink(); __r_.first() = __str.__r_.first(); __move_assign_alloc(__str); __str.__zero(); @@ -3125,11 +3297,16 @@ basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str, } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::find(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::find(const _Tp &__t, + size_type __pos) const { + __self_view __sv = __t; return __str_find<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3178,11 +3355,16 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str, } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::rfind(const _Tp& __t, + size_type __pos) const { + __self_view __sv = __t; return __str_rfind<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3231,11 +3413,16 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __s } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::find_first_of(const _Tp& __t, + size_type __pos) const { + __self_view __sv = __t; return __str_find_first_of<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3284,11 +3471,16 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __st } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::find_last_of(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::find_last_of(const _Tp& __t, + size_type __pos) const { + __self_view __sv = __t; return __str_find_last_of<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3337,11 +3529,16 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const _Tp& __t, + size_type __pos) const { + __self_view __sv = __t; return __str_find_first_not_of<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3391,11 +3588,16 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& } template<class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -typename basic_string<_CharT, _Traits, _Allocator>::size_type -basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(__self_view __sv, - size_type __pos) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + typename basic_string<_CharT, _Traits, _Allocator>::size_type +>::type +basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const _Tp& __t, + size_type __pos) const { + __self_view __sv = __t; return __str_find_last_not_of<value_type, size_type, traits_type, npos> (data(), size(), __sv.data(), __pos, __sv.size()); } @@ -3424,10 +3626,15 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c, // compare template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -int -basic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + int +>::type +basic_string<_CharT, _Traits, _Allocator>::compare(const _Tp& __t) const { + __self_view __sv = __t; size_t __lhs_sz = size(); size_t __rhs_sz = __sv.size(); int __result = traits_type::compare(data(), __sv.data(), @@ -3473,12 +3680,17 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, } template <class _CharT, class _Traits, class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -int +template <class _Tp> +typename enable_if +< + __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, + int +>::type basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, - __self_view __sv) const + const _Tp& __t) const { + __self_view __sv = __t; return compare(__pos1, __n1, __sv.data(), __sv.size()); } @@ -3556,6 +3768,22 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const return true; } +// __clear_and_shrink + +template<class _CharT, class _Traits, class _Allocator> +inline _LIBCPP_INLINE_VISIBILITY +void +basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT +{ + clear(); + if(__is_long()) + { + __alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1); + __set_long_cap(0); + __set_short_size(0); + } +} + // operator== template<class _CharT, class _Traits, class _Allocator> diff --git a/include/string_view b/include/string_view index 72cf816e8d522..6377aeb6d648e 100644 --- a/include/string_view +++ b/include/string_view @@ -208,7 +208,9 @@ public: typedef ptrdiff_t difference_type; static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1); - static_assert(is_pod<value_type>::value, "Character type of basic_string_view must be a POD"); + static_assert((!is_array<value_type>::value), "Character type of basic_string_view must not be an array"); + static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string_view must be standard-layout"); + static_assert(( is_trivial<value_type>::value), "Character type of basic_string_view must be trivial"); static_assert((is_same<_CharT, typename traits_type::char_type>::value), "traits_type::char_type must be the same type as CharT"); diff --git a/include/support/android/locale_bionic.h b/include/support/android/locale_bionic.h index 482e234335852..50fcf5c36a774 100644 --- a/include/support/android/locale_bionic.h +++ b/include/support/android/locale_bionic.h @@ -24,8 +24,45 @@ extern "C" { } #endif +#if defined(__ANDROID__) + +#include <android/api-level.h> +#include <android/ndk-version.h> #include <support/xlocale/__posix_l_fallback.h> +// 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 diff --git a/include/support/win32/locale_win32.h b/include/support/win32/locale_win32.h index aebfff22ecf01..68682c9624b8d 100644 --- a/include/support/win32/locale_win32.h +++ b/include/support/win32/locale_win32.h @@ -46,6 +46,10 @@ public: 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; } @@ -66,6 +70,10 @@ public: 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); } diff --git a/include/support/xlocale/__posix_l_fallback.h b/include/support/xlocale/__posix_l_fallback.h index c893a67313cc8..b9a0939f8fa1c 100644 --- a/include/support/xlocale/__posix_l_fallback.h +++ b/include/support/xlocale/__posix_l_fallback.h @@ -20,141 +20,141 @@ extern "C" { #endif -inline _LIBCPP_ALWAYS_INLINE int isalnum_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isalnum_l(int c, locale_t) { return ::isalnum(c); } -inline _LIBCPP_ALWAYS_INLINE int isalpha_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isalpha_l(int c, locale_t) { return ::isalpha(c); } -inline _LIBCPP_ALWAYS_INLINE int isblank_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isblank_l(int c, locale_t) { return ::isblank(c); } -inline _LIBCPP_ALWAYS_INLINE int iscntrl_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iscntrl_l(int c, locale_t) { return ::iscntrl(c); } -inline _LIBCPP_ALWAYS_INLINE int isdigit_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isdigit_l(int c, locale_t) { return ::isdigit(c); } -inline _LIBCPP_ALWAYS_INLINE int isgraph_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isgraph_l(int c, locale_t) { return ::isgraph(c); } -inline _LIBCPP_ALWAYS_INLINE int islower_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int islower_l(int c, locale_t) { return ::islower(c); } -inline _LIBCPP_ALWAYS_INLINE int isprint_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isprint_l(int c, locale_t) { return ::isprint(c); } -inline _LIBCPP_ALWAYS_INLINE int ispunct_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int ispunct_l(int c, locale_t) { return ::ispunct(c); } -inline _LIBCPP_ALWAYS_INLINE int isspace_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isspace_l(int c, locale_t) { return ::isspace(c); } -inline _LIBCPP_ALWAYS_INLINE int isupper_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isupper_l(int c, locale_t) { return ::isupper(c); } -inline _LIBCPP_ALWAYS_INLINE int isxdigit_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int isxdigit_l(int c, locale_t) { return ::isxdigit(c); } -inline _LIBCPP_ALWAYS_INLINE int iswalnum_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswalnum_l(wint_t c, locale_t) { return ::iswalnum(c); } -inline _LIBCPP_ALWAYS_INLINE int iswalpha_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswalpha_l(wint_t c, locale_t) { return ::iswalpha(c); } -inline _LIBCPP_ALWAYS_INLINE int iswblank_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswblank_l(wint_t c, locale_t) { return ::iswblank(c); } -inline _LIBCPP_ALWAYS_INLINE int iswcntrl_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) { return ::iswcntrl(c); } -inline _LIBCPP_ALWAYS_INLINE int iswdigit_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswdigit_l(wint_t c, locale_t) { return ::iswdigit(c); } -inline _LIBCPP_ALWAYS_INLINE int iswgraph_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswgraph_l(wint_t c, locale_t) { return ::iswgraph(c); } -inline _LIBCPP_ALWAYS_INLINE int iswlower_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswlower_l(wint_t c, locale_t) { return ::iswlower(c); } -inline _LIBCPP_ALWAYS_INLINE int iswprint_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswprint_l(wint_t c, locale_t) { return ::iswprint(c); } -inline _LIBCPP_ALWAYS_INLINE int iswpunct_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswpunct_l(wint_t c, locale_t) { return ::iswpunct(c); } -inline _LIBCPP_ALWAYS_INLINE int iswspace_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswspace_l(wint_t c, locale_t) { return ::iswspace(c); } -inline _LIBCPP_ALWAYS_INLINE int iswupper_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswupper_l(wint_t c, locale_t) { return ::iswupper(c); } -inline _LIBCPP_ALWAYS_INLINE int iswxdigit_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int iswxdigit_l(wint_t c, locale_t) { return ::iswxdigit(c); } -inline _LIBCPP_ALWAYS_INLINE int toupper_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int toupper_l(int c, locale_t) { return ::toupper(c); } -inline _LIBCPP_ALWAYS_INLINE int tolower_l(int c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int tolower_l(int c, locale_t) { return ::tolower(c); } -inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY wint_t towupper_l(wint_t c, locale_t) { return ::towupper(c); } -inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY wint_t towlower_l(wint_t c, locale_t) { return ::towlower(c); } -inline _LIBCPP_ALWAYS_INLINE int strcoll_l(const char *s1, const char *s2, - locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int strcoll_l(const char *s1, const char *s2, + locale_t) { return ::strcoll(s1, s2); } -inline _LIBCPP_ALWAYS_INLINE size_t strxfrm_l(char *dest, const char *src, - size_t n, locale_t) { +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_ALWAYS_INLINE size_t strftime_l(char *s, size_t max, - const char *format, - const struct tm *tm, locale_t) { +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_ALWAYS_INLINE int wcscoll_l(const wchar_t *ws1, - const wchar_t *ws2, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY int wcscoll_l(const wchar_t *ws1, + const wchar_t *ws2, locale_t) { return ::wcscoll(ws1, ws2); } -inline _LIBCPP_ALWAYS_INLINE size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, - size_t n, locale_t) { +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); } diff --git a/include/support/xlocale/__strtonum_fallback.h b/include/support/xlocale/__strtonum_fallback.h index 4ae3918b3d307..50b4db354277c 100644 --- a/include/support/xlocale/__strtonum_fallback.h +++ b/include/support/xlocale/__strtonum_fallback.h @@ -20,43 +20,43 @@ extern "C" { #endif -inline _LIBCPP_ALWAYS_INLINE float strtof_l(const char *nptr, - char **endptr, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char *nptr, + char **endptr, locale_t) { return ::strtof(nptr, endptr); } -inline _LIBCPP_ALWAYS_INLINE double strtod_l(const char *nptr, - char **endptr, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char *nptr, + char **endptr, locale_t) { return ::strtod(nptr, endptr); } -inline _LIBCPP_ALWAYS_INLINE long double strtold_l(const char *nptr, - char **endptr, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY long double strtold_l(const char *nptr, + char **endptr, locale_t) { return ::strtold(nptr, endptr); } -inline _LIBCPP_ALWAYS_INLINE long long +inline _LIBCPP_INLINE_VISIBILITY long long strtoll_l(const char *nptr, char **endptr, int base, locale_t) { return ::strtoll(nptr, endptr, base); } -inline _LIBCPP_ALWAYS_INLINE unsigned long long +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_ALWAYS_INLINE long long +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_ALWAYS_INLINE unsigned long long +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_ALWAYS_INLINE long double wcstold_l(const wchar_t *nptr, - wchar_t **endptr, locale_t) { +inline _LIBCPP_INLINE_VISIBILITY long double wcstold_l(const wchar_t *nptr, + wchar_t **endptr, locale_t) { return ::wcstold(nptr, endptr); } diff --git a/include/system_error b/include/system_error index 12745525f57ff..917c710290ac0 100644 --- a/include/system_error +++ b/include/system_error @@ -47,10 +47,10 @@ template <class T> struct is_error_condition_enum : public false_type {}; template <class _Tp> -constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 +inline constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 template <class _Tp> -constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17 +inline constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17 class error_code { @@ -120,88 +120,6 @@ public: const char* what() const noexcept; }; -enum class errc -{ - address_family_not_supported, // EAFNOSUPPORT - address_in_use, // EADDRINUSE - address_not_available, // EADDRNOTAVAIL - already_connected, // EISCONN - argument_list_too_long, // E2BIG - argument_out_of_domain, // EDOM - bad_address, // EFAULT - bad_file_descriptor, // EBADF - bad_message, // EBADMSG - broken_pipe, // EPIPE - connection_aborted, // ECONNABORTED - connection_already_in_progress, // EALREADY - connection_refused, // ECONNREFUSED - connection_reset, // ECONNRESET - cross_device_link, // EXDEV - destination_address_required, // EDESTADDRREQ - device_or_resource_busy, // EBUSY - directory_not_empty, // ENOTEMPTY - executable_format_error, // ENOEXEC - file_exists, // EEXIST - file_too_large, // EFBIG - filename_too_long, // ENAMETOOLONG - function_not_supported, // ENOSYS - host_unreachable, // EHOSTUNREACH - identifier_removed, // EIDRM - illegal_byte_sequence, // EILSEQ - inappropriate_io_control_operation, // ENOTTY - interrupted, // EINTR - invalid_argument, // EINVAL - invalid_seek, // ESPIPE - io_error, // EIO - is_a_directory, // EISDIR - message_size, // EMSGSIZE - network_down, // ENETDOWN - network_reset, // ENETRESET - network_unreachable, // ENETUNREACH - no_buffer_space, // ENOBUFS - no_child_process, // ECHILD - no_link, // ENOLINK - no_lock_available, // ENOLCK - no_message_available, // ENODATA - no_message, // ENOMSG - no_protocol_option, // ENOPROTOOPT - no_space_on_device, // ENOSPC - no_stream_resources, // ENOSR - no_such_device_or_address, // ENXIO - no_such_device, // ENODEV - no_such_file_or_directory, // ENOENT - no_such_process, // ESRCH - not_a_directory, // ENOTDIR - not_a_socket, // ENOTSOCK - not_a_stream, // ENOSTR - not_connected, // ENOTCONN - not_enough_memory, // ENOMEM - not_supported, // ENOTSUP - operation_canceled, // ECANCELED - operation_in_progress, // EINPROGRESS - operation_not_permitted, // EPERM - operation_not_supported, // EOPNOTSUPP - operation_would_block, // EWOULDBLOCK - owner_dead, // EOWNERDEAD - permission_denied, // EACCES - protocol_error, // EPROTO - protocol_not_supported, // EPROTONOSUPPORT - read_only_file_system, // EROFS - resource_deadlock_would_occur, // EDEADLK - resource_unavailable_try_again, // EAGAIN - result_out_of_range, // ERANGE - state_not_recoverable, // ENOTRECOVERABLE - stream_timeout, // ETIME - text_file_busy, // ETXTBSY - timed_out, // ETIMEDOUT - too_many_files_open_in_system, // ENFILE - too_many_files_open, // EMFILE - too_many_links, // EMLINK - too_many_symbolic_link_levels, // ELOOP - value_too_large, // EOVERFLOW - wrong_protocol_type // EPROTOTYPE -}; - template <> struct is_error_condition_enum<errc> : true_type { } @@ -225,8 +143,7 @@ template <> struct hash<std::error_condition>; */ -#include <__config> -#include <cerrno> +#include <__errc> #include <type_traits> #include <stdexcept> #include <__functional_base> @@ -246,7 +163,7 @@ struct _LIBCPP_TEMPLATE_VIS is_error_code_enum #if _LIBCPP_STD_VER > 14 template <class _Tp> -constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; #endif // is_error_condition_enum @@ -257,111 +174,8 @@ struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum #if _LIBCPP_STD_VER > 14 template <class _Tp> -constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; -#endif - -// Some error codes are not present on all platforms, so we provide equivalents -// for them: - -//enum class errc -_LIBCPP_DECLARE_STRONG_ENUM(errc) -{ - address_family_not_supported = EAFNOSUPPORT, - address_in_use = EADDRINUSE, - address_not_available = EADDRNOTAVAIL, - already_connected = EISCONN, - argument_list_too_long = E2BIG, - argument_out_of_domain = EDOM, - bad_address = EFAULT, - bad_file_descriptor = EBADF, - bad_message = EBADMSG, - broken_pipe = EPIPE, - connection_aborted = ECONNABORTED, - connection_already_in_progress = EALREADY, - connection_refused = ECONNREFUSED, - connection_reset = ECONNRESET, - cross_device_link = EXDEV, - destination_address_required = EDESTADDRREQ, - device_or_resource_busy = EBUSY, - directory_not_empty = ENOTEMPTY, - executable_format_error = ENOEXEC, - file_exists = EEXIST, - file_too_large = EFBIG, - filename_too_long = ENAMETOOLONG, - function_not_supported = ENOSYS, - host_unreachable = EHOSTUNREACH, - identifier_removed = EIDRM, - illegal_byte_sequence = EILSEQ, - inappropriate_io_control_operation = ENOTTY, - interrupted = EINTR, - invalid_argument = EINVAL, - invalid_seek = ESPIPE, - io_error = EIO, - is_a_directory = EISDIR, - message_size = EMSGSIZE, - network_down = ENETDOWN, - network_reset = ENETRESET, - network_unreachable = ENETUNREACH, - no_buffer_space = ENOBUFS, - no_child_process = ECHILD, - no_link = ENOLINK, - no_lock_available = ENOLCK, -#ifdef ENODATA - no_message_available = ENODATA, -#else - no_message_available = ENOMSG, -#endif - no_message = ENOMSG, - no_protocol_option = ENOPROTOOPT, - no_space_on_device = ENOSPC, -#ifdef ENOSR - no_stream_resources = ENOSR, -#else - no_stream_resources = ENOMEM, -#endif - no_such_device_or_address = ENXIO, - no_such_device = ENODEV, - no_such_file_or_directory = ENOENT, - no_such_process = ESRCH, - not_a_directory = ENOTDIR, - not_a_socket = ENOTSOCK, -#ifdef ENOSTR - not_a_stream = ENOSTR, -#else - not_a_stream = EINVAL, -#endif - not_connected = ENOTCONN, - not_enough_memory = ENOMEM, - not_supported = ENOTSUP, - operation_canceled = ECANCELED, - operation_in_progress = EINPROGRESS, - operation_not_permitted = EPERM, - operation_not_supported = EOPNOTSUPP, - operation_would_block = EWOULDBLOCK, - owner_dead = EOWNERDEAD, - permission_denied = EACCES, - protocol_error = EPROTO, - protocol_not_supported = EPROTONOSUPPORT, - read_only_file_system = EROFS, - resource_deadlock_would_occur = EDEADLK, - resource_unavailable_try_again = EAGAIN, - result_out_of_range = ERANGE, - state_not_recoverable = ENOTRECOVERABLE, -#ifdef ETIME - stream_timeout = ETIME, -#else - stream_timeout = ETIMEDOUT, +_LIBCPP_INLINE_VAR constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; #endif - text_file_busy = ETXTBSY, - timed_out = ETIMEDOUT, - too_many_files_open_in_system = ENFILE, - too_many_files_open = EMFILE, - too_many_links = EMLINK, - too_many_symbolic_link_levels = ELOOP, - value_too_large = EOVERFLOW, - wrong_protocol_type = EPROTOTYPE -}; -_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc) template <> struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc> @@ -389,7 +203,7 @@ public: defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) error_category() _NOEXCEPT; #else - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT #endif private: @@ -403,13 +217,13 @@ public: virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT; virtual string message(int __ev) const = 0; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;} friend class _LIBCPP_HIDDEN __do_message; @@ -430,21 +244,21 @@ class _LIBCPP_TYPE_VIS error_condition int __val_; const error_category* __cat_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_condition(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {} template <class _Ep> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0 ) _NOEXCEPT {*this = make_error_condition(__e);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void assign(int __val, const error_category& __cat) _NOEXCEPT { __val_ = __val; @@ -452,7 +266,7 @@ public: } template <class _Ep> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY typename enable_if < is_error_condition_enum<_Ep>::value, @@ -461,21 +275,21 @@ public: operator=(_Ep __e) _NOEXCEPT {*this = make_error_condition(__e); return *this;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT { __val_ = 0; __cat_ = &generic_category(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int value() const _NOEXCEPT {return __val_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const error_category& category() const _NOEXCEPT {return *__cat_;} string message() const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return __val_ != 0;} }; @@ -502,21 +316,21 @@ class _LIBCPP_TYPE_VIS error_code int __val_; const error_category* __cat_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {} template <class _Ep> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0 ) _NOEXCEPT {*this = make_error_code(__e);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void assign(int __val, const error_category& __cat) _NOEXCEPT { __val_ = __val; @@ -524,7 +338,7 @@ public: } template <class _Ep> - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY typename enable_if < is_error_code_enum<_Ep>::value, @@ -533,26 +347,26 @@ public: operator=(_Ep __e) _NOEXCEPT {*this = make_error_code(__e); return *this;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT { __val_ = 0; __cat_ = &system_category(); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY int value() const _NOEXCEPT {return __val_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const error_category& category() const _NOEXCEPT {return *__cat_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY error_condition default_error_condition() const _NOEXCEPT {return __cat_->default_error_condition(__val_);} string message() const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return __val_ != 0;} }; @@ -658,7 +472,7 @@ public: system_error(int __ev, const error_category& __ecat); ~system_error() _NOEXCEPT; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const error_code& code() const _NOEXCEPT {return __ec_;} private: diff --git a/include/tgmath.h b/include/tgmath.h index fbe1e8248d7a6..aba87499c2940 100644 --- a/include/tgmath.h +++ b/include/tgmath.h @@ -14,16 +14,24 @@ /* tgmath.h synopsis -#include <complex.h> -#include <math.h> +#include <ctgmath> */ -#include <complex.h> -#include <math.h> +#include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +#ifdef __cplusplus + +#include <ctgmath> + +#else // __cplusplus + +#include_next <tgmath.h> + +#endif // __cplusplus + #endif // _LIBCPP_TGMATH_H diff --git a/include/thread b/include/thread index 1b8dca394aa49..0629d70efda40 100644 --- a/include/thread +++ b/include/thread @@ -298,7 +298,7 @@ public: template <class _Fp, class ..._Args, class = typename enable_if < - !is_same<typename decay<_Fp>::type, thread>::value + !is_same<typename __uncvref<_Fp>::type, thread>::value >::type > _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS diff --git a/include/tuple b/include/tuple index 5e32b6dfe2ac9..b3a17e7b73546 100644 --- a/include/tuple +++ b/include/tuple @@ -70,7 +70,7 @@ public: void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...)); }; -const unspecified ignore; +inline constexpr unspecified ignore; template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in C++14 template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14 @@ -87,7 +87,7 @@ template <class T, class Tuple> template <class T> class tuple_size; // undefined template <class... T> class tuple_size<tuple<T...>>; template <class T> - constexpr size_t tuple_size_v = tuple_size<T>::value; // C++17 + inline constexpr size_t tuple_size_v = tuple_size<T>::value; // C++17 template <size_t I, class T> class tuple_element; // undefined template <size_t I, class... T> class tuple_element<I, tuple<T...>>; template <size_t I, class T> @@ -173,16 +173,11 @@ class __tuple_leaf template <class _Tp> static constexpr bool __can_bind_reference() { - using _RawTp = typename remove_reference<_Tp>::type; - using _RawHp = typename remove_reference<_Hp>::type; - using _CheckLValueArg = integral_constant<bool, - is_lvalue_reference<_Tp>::value - || is_same<_RawTp, reference_wrapper<_RawHp>>::value - || is_same<_RawTp, reference_wrapper<typename remove_const<_RawHp>::type>>::value - >; - return !is_reference<_Hp>::value - || (is_lvalue_reference<_Hp>::value && _CheckLValueArg::value) - || (is_rvalue_reference<_Hp>::value && !is_lvalue_reference<_Tp>::value); +#if __has_keyword(__reference_binds_to_temporary) + return !__reference_binds_to_temporary(_Hp, _Tp); +#else + return true; +#endif } __tuple_leaf& operator=(const __tuple_leaf&); @@ -216,7 +211,7 @@ public: template <class _Tp, class = typename enable_if< __lazy_and< - __lazy_not<is_same<typename decay<_Tp>::type, __tuple_leaf>> + __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>> , is_constructible<_Hp, _Tp> >::value >::type @@ -224,15 +219,15 @@ public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value)) : __value_(_VSTD::forward<_Tp>(__t)) - {static_assert(__can_bind_reference<_Tp>(), - "Attempted to construct a reference element in a tuple with an rvalue");} + {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 explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t) : __value_(_VSTD::forward<_Tp>(__t)) - {static_assert(__can_bind_reference<_Tp>(), - "Attempted to construct a reference element in a tuple with an rvalue");} + {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 @@ -298,7 +293,7 @@ public: template <class _Tp, class = typename enable_if< __lazy_and< - __lazy_not<is_same<typename decay<_Tp>::type, __tuple_leaf>> + __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>> , is_constructible<_Hp, _Tp> >::value >::type @@ -1079,7 +1074,7 @@ struct __ignore_t }; namespace { - constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); + _LIBCPP_INLINE_VAR constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); } template <class _Tp> @@ -1368,7 +1363,7 @@ pair<_T1, _T2>::pair(piecewise_construct_t, #if _LIBCPP_STD_VER > 14 template <class _Tp> -constexpr size_t tuple_size_v = tuple_size<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr size_t tuple_size_v = tuple_size<_Tp>::value; #define _LIBCPP_NOEXCEPT_RETURN(...) noexcept(noexcept(__VA_ARGS__)) { return __VA_ARGS__; } @@ -1388,7 +1383,7 @@ constexpr decltype(auto) apply(_Fn && __f, _Tuple && __t) _LIBCPP_NOEXCEPT_RETURN( _VSTD::__apply_tuple_impl( _VSTD::forward<_Fn>(__f), _VSTD::forward<_Tuple>(__t), - typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{}) + typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{}) ) template <class _Tp, class _Tuple, size_t... _Idx> @@ -1403,7 +1398,7 @@ inline _LIBCPP_INLINE_VISIBILITY constexpr _Tp make_from_tuple(_Tuple&& __t) _LIBCPP_NOEXCEPT_RETURN( _VSTD::__make_from_tuple_impl<_Tp>(_VSTD::forward<_Tuple>(__t), - typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{}) + typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{}) ) #undef _LIBCPP_NOEXCEPT_RETURN diff --git a/include/type_traits b/include/type_traits index 60b5dec5b8398..30bfb161c0d40 100644 --- a/include/type_traits +++ b/include/type_traits @@ -21,7 +21,7 @@ namespace std template <class T, T v> struct integral_constant; typedef integral_constant<bool, true> true_type; // C++11 typedef integral_constant<bool, false> false_type; // C++11 - + template <bool B> // C++14 using bool_constant = integral_constant<bool, B>; // C++14 typedef bool_constant<true> true_type; // C++14 @@ -132,6 +132,8 @@ namespace std template <class T> struct has_virtual_destructor; + template<class T> struct has_unique_object_representations; // C++17 + // Relationships between types: template <class T, class U> struct is_same; template <class Base, class Derived> struct is_base_of; @@ -170,7 +172,7 @@ namespace std using add_volatile_t = typename add_volatile<T>::type; // C++14 template <class T> using add_cv_t = typename add_cv<T>::type; // C++14 - + // reference modifications: template <class T> using remove_reference_t = typename remove_reference<T>::type; // C++14 @@ -178,13 +180,13 @@ namespace std using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++14 template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++14 - + // sign modifications: template <class T> using make_signed_t = typename make_signed<T>::type; // C++14 template <class T> using make_unsigned_t = typename make_unsigned<T>::type; // C++14 - + // array modifications: template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++14 @@ -221,175 +223,177 @@ namespace std template <class...> using void_t = void; // C++17 - + // See C++14 20.10.4.1, primary type categories - template <class T> constexpr bool is_void_v + template <class T> inline constexpr bool is_void_v = is_void<T>::value; // C++17 - template <class T> constexpr bool is_null_pointer_v + template <class T> inline constexpr bool is_null_pointer_v = is_null_pointer<T>::value; // C++17 - template <class T> constexpr bool is_integral_v + template <class T> inline constexpr bool is_integral_v = is_integral<T>::value; // C++17 - template <class T> constexpr bool is_floating_point_v + template <class T> inline constexpr bool is_floating_point_v = is_floating_point<T>::value; // C++17 - template <class T> constexpr bool is_array_v + template <class T> inline constexpr bool is_array_v = is_array<T>::value; // C++17 - template <class T> constexpr bool is_pointer_v + template <class T> inline constexpr bool is_pointer_v = is_pointer<T>::value; // C++17 - template <class T> constexpr bool is_lvalue_reference_v + template <class T> inline constexpr bool is_lvalue_reference_v = is_lvalue_reference<T>::value; // C++17 - template <class T> constexpr bool is_rvalue_reference_v + template <class T> inline constexpr bool is_rvalue_reference_v = is_rvalue_reference<T>::value; // C++17 - template <class T> constexpr bool is_member_object_pointer_v + template <class T> inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<T>::value; // C++17 - template <class T> constexpr bool is_member_function_pointer_v + template <class T> inline constexpr bool is_member_function_pointer_v = is_member_function_pointer<T>::value; // C++17 - template <class T> constexpr bool is_enum_v + template <class T> inline constexpr bool is_enum_v = is_enum<T>::value; // C++17 - template <class T> constexpr bool is_union_v + template <class T> inline constexpr bool is_union_v = is_union<T>::value; // C++17 - template <class T> constexpr bool is_class_v + template <class T> inline constexpr bool is_class_v = is_class<T>::value; // C++17 - template <class T> constexpr bool is_function_v + template <class T> inline constexpr bool is_function_v = is_function<T>::value; // C++17 // See C++14 20.10.4.2, composite type categories - template <class T> constexpr bool is_reference_v + template <class T> inline constexpr bool is_reference_v = is_reference<T>::value; // C++17 - template <class T> constexpr bool is_arithmetic_v + template <class T> inline constexpr bool is_arithmetic_v = is_arithmetic<T>::value; // C++17 - template <class T> constexpr bool is_fundamental_v + template <class T> inline constexpr bool is_fundamental_v = is_fundamental<T>::value; // C++17 - template <class T> constexpr bool is_object_v + template <class T> inline constexpr bool is_object_v = is_object<T>::value; // C++17 - template <class T> constexpr bool is_scalar_v + template <class T> inline constexpr bool is_scalar_v = is_scalar<T>::value; // C++17 - template <class T> constexpr bool is_compound_v + template <class T> inline constexpr bool is_compound_v = is_compound<T>::value; // C++17 - template <class T> constexpr bool is_member_pointer_v + template <class T> inline constexpr bool is_member_pointer_v = is_member_pointer<T>::value; // C++17 // See C++14 20.10.4.3, type properties - template <class T> constexpr bool is_const_v + template <class T> inline constexpr bool is_const_v = is_const<T>::value; // C++17 - template <class T> constexpr bool is_volatile_v + template <class T> inline constexpr bool is_volatile_v = is_volatile<T>::value; // C++17 - template <class T> constexpr bool is_trivial_v + template <class T> inline constexpr bool is_trivial_v = is_trivial<T>::value; // C++17 - template <class T> constexpr bool is_trivially_copyable_v + template <class T> inline constexpr bool is_trivially_copyable_v = is_trivially_copyable<T>::value; // C++17 - template <class T> constexpr bool is_standard_layout_v + template <class T> inline constexpr bool is_standard_layout_v = is_standard_layout<T>::value; // C++17 - template <class T> constexpr bool is_pod_v + template <class T> inline constexpr bool is_pod_v = is_pod<T>::value; // C++17 - template <class T> constexpr bool is_literal_type_v + template <class T> inline constexpr bool is_literal_type_v = is_literal_type<T>::value; // C++17 - template <class T> constexpr bool is_empty_v + template <class T> inline constexpr bool is_empty_v = is_empty<T>::value; // C++17 - template <class T> constexpr bool is_polymorphic_v + template <class T> inline constexpr bool is_polymorphic_v = is_polymorphic<T>::value; // C++17 - template <class T> constexpr bool is_abstract_v + template <class T> inline constexpr bool is_abstract_v = is_abstract<T>::value; // C++17 - template <class T> constexpr bool is_final_v + template <class T> inline constexpr bool is_final_v = is_final<T>::value; // C++17 - template <class T> constexpr bool is_aggregate_v + template <class T> inline constexpr bool is_aggregate_v = is_aggregate<T>::value; // C++17 - template <class T> constexpr bool is_signed_v + template <class T> inline constexpr bool is_signed_v = is_signed<T>::value; // C++17 - template <class T> constexpr bool is_unsigned_v + template <class T> inline constexpr bool is_unsigned_v = is_unsigned<T>::value; // C++17 - template <class T, class... Args> constexpr bool is_constructible_v + template <class T, class... Args> inline constexpr bool is_constructible_v = is_constructible<T, Args...>::value; // C++17 - template <class T> constexpr bool is_default_constructible_v + template <class T> inline constexpr bool is_default_constructible_v = is_default_constructible<T>::value; // C++17 - template <class T> constexpr bool is_copy_constructible_v + template <class T> inline constexpr bool is_copy_constructible_v = is_copy_constructible<T>::value; // C++17 - template <class T> constexpr bool is_move_constructible_v + template <class T> inline constexpr bool is_move_constructible_v = is_move_constructible<T>::value; // C++17 - template <class T, class U> constexpr bool is_assignable_v + template <class T, class U> inline constexpr bool is_assignable_v = is_assignable<T, U>::value; // C++17 - template <class T> constexpr bool is_copy_assignable_v + template <class T> inline constexpr bool is_copy_assignable_v = is_copy_assignable<T>::value; // C++17 - template <class T> constexpr bool is_move_assignable_v + template <class T> inline constexpr bool is_move_assignable_v = is_move_assignable<T>::value; // C++17 - template <class T, class U> constexpr bool is_swappable_with_v + template <class T, class U> inline constexpr bool is_swappable_with_v = is_swappable_with<T, U>::value; // C++17 - template <class T> constexpr bool is_swappable_v + template <class T> inline constexpr bool is_swappable_v = is_swappable<T>::value; // C++17 - template <class T> constexpr bool is_destructible_v + template <class T> inline constexpr bool is_destructible_v = is_destructible<T>::value; // C++17 - template <class T, class... Args> constexpr bool is_trivially_constructible_v + template <class T, class... Args> inline constexpr bool is_trivially_constructible_v = is_trivially_constructible<T, Args...>::value; // C++17 - template <class T> constexpr bool is_trivially_default_constructible_v + template <class T> inline constexpr bool is_trivially_default_constructible_v = is_trivially_default_constructible<T>::value; // C++17 - template <class T> constexpr bool is_trivially_copy_constructible_v + template <class T> inline constexpr bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<T>::value; // C++17 - template <class T> constexpr bool is_trivially_move_constructible_v + template <class T> inline constexpr bool is_trivially_move_constructible_v = is_trivially_move_constructible<T>::value; // C++17 - template <class T, class U> constexpr bool is_trivially_assignable_v + template <class T, class U> inline constexpr bool is_trivially_assignable_v = is_trivially_assignable<T, U>::value; // C++17 - template <class T> constexpr bool is_trivially_copy_assignable_v + template <class T> inline constexpr bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<T>::value; // C++17 - template <class T> constexpr bool is_trivially_move_assignable_v + template <class T> inline constexpr bool is_trivially_move_assignable_v = is_trivially_move_assignable<T>::value; // C++17 - template <class T> constexpr bool is_trivially_destructible_v + template <class T> inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<T>::value; // C++17 - template <class T, class... Args> constexpr bool is_nothrow_constructible_v + template <class T, class... Args> inline constexpr bool is_nothrow_constructible_v = is_nothrow_constructible<T, Args...>::value; // C++17 - template <class T> constexpr bool is_nothrow_default_constructible_v + template <class T> inline constexpr bool is_nothrow_default_constructible_v = is_nothrow_default_constructible<T>::value; // C++17 - template <class T> constexpr bool is_nothrow_copy_constructible_v + template <class T> inline constexpr bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<T>::value; // C++17 - template <class T> constexpr bool is_nothrow_move_constructible_v + template <class T> inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<T>::value; // C++17 - template <class T, class U> constexpr bool is_nothrow_assignable_v + template <class T, class U> inline constexpr bool is_nothrow_assignable_v = is_nothrow_assignable<T, U>::value; // C++17 - template <class T> constexpr bool is_nothrow_copy_assignable_v + template <class T> inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<T>::value; // C++17 - template <class T> constexpr bool is_nothrow_move_assignable_v + template <class T> inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<T>::value; // C++17 - template <class T, class U> constexpr bool is_nothrow_swappable_with_v + template <class T, class U> inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<T, U>::value; // C++17 - template <class T> constexpr bool is_nothrow_swappable_v + template <class T> inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<T>::value; // C++17 - template <class T> constexpr bool is_nothrow_destructible_v + template <class T> inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<T>::value; // C++17 - template <class T> constexpr bool has_virtual_destructor_v + template <class T> inline constexpr bool has_virtual_destructor_v = has_virtual_destructor<T>::value; // C++17 + template<class T> inline constexpr bool has_unique_object_representations_v // C++17 + = has_unique_object_representations<T>::value; // See C++14 20.10.5, type property queries - template <class T> constexpr size_t alignment_of_v + template <class T> inline constexpr size_t alignment_of_v = alignment_of<T>::value; // C++17 - template <class T> constexpr size_t rank_v + template <class T> inline constexpr size_t rank_v = rank<T>::value; // C++17 - template <class T, unsigned I = 0> constexpr size_t extent_v + template <class T, unsigned I = 0> inline constexpr size_t extent_v = extent<T, I>::value; // C++17 // See C++14 20.10.6, type relations - template <class T, class U> constexpr bool is_same_v + template <class T, class U> inline constexpr bool is_same_v = is_same<T, U>::value; // C++17 - template <class Base, class Derived> constexpr bool is_base_of_v + template <class Base, class Derived> inline constexpr bool is_base_of_v = is_base_of<Base, Derived>::value; // C++17 - template <class From, class To> constexpr bool is_convertible_v + template <class From, class To> inline constexpr bool is_convertible_v = is_convertible<From, To>::value; // C++17 - template <class Fn, class... ArgTypes> constexpr bool is_invocable_v + template <class Fn, class... ArgTypes> inline constexpr bool is_invocable_v = is_invocable<Fn, ArgTypes...>::value; // C++17 - template <class R, class Fn, class... ArgTypes> constexpr bool is_invocable_r_v + template <class R, class Fn, class... ArgTypes> inline constexpr bool is_invocable_r_v = is_invocable_r<R, Fn, ArgTypes...>::value; // C++17 - template <class Fn, class... ArgTypes> constexpr bool is_nothrow_invocable_v + template <class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<Fn, ArgTypes...>::value; // C++17 - template <class R, class Fn, class... ArgTypes> constexpr bool is_nothrow_invocable_r_v + template <class R, class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<R, Fn, ArgTypes...>::value; // C++17 // [meta.logical], logical operator traits: template<class... B> struct conjunction; // C++17 - template<class... B> - constexpr bool conjunction_v = conjunction<B...>::value; // C++17 + template<class... B> + inline constexpr bool conjunction_v = conjunction<B...>::value; // C++17 template<class... B> struct disjunction; // C++17 template<class... B> - constexpr bool disjunction_v = disjunction<B...>::value; // C++17 + inline constexpr bool disjunction_v = disjunction<B...>::value; // C++17 template<class B> struct negation; // C++17 - template<class B> - constexpr bool negation_v = negation<B>::value; // C++17 + template<class B> + inline constexpr bool negation_v = negation<B>::value; // C++17 } @@ -591,7 +595,7 @@ template<class _B0, class _B1> struct __and_<_B0, _B1> : conditional<_B0::value, _B1, _B0>::type {}; template<class _B0, class _B1, class _B2, class... _Bn> -struct __and_<_B0, _B1, _B2, _Bn...> +struct __and_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, __and_<_B1, _B2, _Bn...>, _B0>::type {}; // __or_ @@ -604,11 +608,11 @@ template<class _B0, class _B1> struct __or_<_B0, _B1> : conditional<_B0::value, _B0, _B1>::type {}; template<class _B0, class _B1, class _B2, class... _Bn> -struct __or_<_B0, _B1, _B2, _Bn...> +struct __or_<_B0, _B1, _B2, _Bn...> : conditional<_B0::value, _B0, __or_<_B1, _B2, _Bn...> >::type {}; // __not_ -template<class _Tp> +template<class _Tp> struct __not_ : conditional<_Tp::value, false_type, true_type>::type {}; #endif // !defined(_LIBCPP_CXX03_LANG) @@ -619,7 +623,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const : public fa template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_const_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_const_v = is_const<_Tp>::value; #endif @@ -629,7 +634,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile : pub template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_volatile_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_volatile_v = is_volatile<_Tp>::value; #endif @@ -666,7 +672,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void : public __libcpp_is_void<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_void_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_void_v = is_void<_Tp>::value; #endif @@ -683,7 +690,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_null_pointer_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_null_pointer_v = is_null_pointer<_Tp>::value; #endif #endif @@ -717,13 +725,20 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral : public __libcpp_is_integral<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_integral_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v = is_integral<_Tp>::value; #endif // is_floating_point template <class _Tp> struct __libcpp_is_floating_point : public false_type {}; +#ifdef __clang__ +template <> struct __libcpp_is_floating_point<__fp16> : public true_type {}; +#endif +#ifdef __FLT16_MANT_DIG__ +template <> struct __libcpp_is_floating_point<_Float16> : public true_type {}; +#endif template <> struct __libcpp_is_floating_point<float> : public true_type {}; template <> struct __libcpp_is_floating_point<double> : public true_type {}; template <> struct __libcpp_is_floating_point<long double> : public true_type {}; @@ -732,7 +747,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_floating_point_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_floating_point_v = is_floating_point<_Tp>::value; #endif @@ -746,7 +762,8 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]> : public true_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_array_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_array_v = is_array<_Tp>::value; #endif @@ -759,7 +776,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer : public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_pointer_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pointer_v = is_pointer<_Tp>::value; #endif @@ -780,13 +798,16 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public tr #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_reference_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_reference_v = is_reference<_Tp>::value; -template <class _Tp> _LIBCPP_CONSTEXPR bool is_lvalue_reference_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_lvalue_reference_v = is_lvalue_reference<_Tp>::value; -template <class _Tp> _LIBCPP_CONSTEXPR bool is_rvalue_reference_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value; #endif // is_union @@ -805,7 +826,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_union_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_union_v = is_union<_Tp>::value; #endif @@ -830,7 +852,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_class_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_class_v = is_class<_Tp>::value; #endif @@ -840,7 +863,8 @@ template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_same_v +template <class _Tp, class _Up> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_same_v = is_same<_Tp, _Up>::value; #endif @@ -870,7 +894,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_function : public __libcpp_is_function<_Tp> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_function_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_function_v = is_function<_Tp>::value; #endif @@ -878,7 +903,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_function_v // template <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {}; // template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; -// +// template <class _MP, bool _IsMemberFunctionPtr, bool _IsMemberObjectPtr> struct __member_pointer_traits_imp @@ -897,7 +922,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type>::type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_function_pointer_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_function_pointer_v = is_member_function_pointer<_Tp>::value; #endif @@ -910,7 +936,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer : public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_pointer_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_pointer_v = is_member_pointer<_Tp>::value; #endif @@ -921,7 +948,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer !is_member_function_pointer<_Tp>::value> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_object_pointer_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_object_pointer_v = is_member_object_pointer<_Tp>::value; #endif @@ -949,7 +977,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_enum_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_enum_v = is_enum<_Tp>::value; #endif @@ -960,7 +989,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic is_floating_point<_Tp>::value> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_arithmetic_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_arithmetic_v = is_arithmetic<_Tp>::value; #endif @@ -972,7 +1002,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental is_arithmetic<_Tp>::value> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_fundamental_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_fundamental_v = is_fundamental<_Tp>::value; #endif @@ -988,7 +1019,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_scalar_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scalar_v = is_scalar<_Tp>::value; #endif @@ -1001,7 +1033,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_object is_class<_Tp>::value > {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_object_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_object_v = is_object<_Tp>::value; #endif @@ -1011,7 +1044,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_compound_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_compound_v = is_compound<_Tp>::value; #endif @@ -1150,11 +1184,9 @@ struct __is_same_uncvref : is_same<typename __uncvref<_Tp>::type, typename __uncvref<_Up>::type> {}; #if _LIBCPP_STD_VER > 17 -// aligned_union - same as __uncvref +// remove_cvref - same as __uncvref template <class _Tp> -struct remove_cvref { - using type = remove_cv_t<remove_reference_t<_Tp>>; -}; +struct remove_cvref : public __uncvref<_Tp> {}; template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type; #endif @@ -1179,12 +1211,12 @@ template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type // add_pointer -template <class _Tp, - bool = __is_referenceable<_Tp>::value || +template <class _Tp, + bool = __is_referenceable<_Tp>::value || is_same<typename remove_cv<_Tp>::type, void>::value> struct __add_pointer_impl {typedef typename remove_reference<_Tp>::type* type;}; -template <class _Tp> struct __add_pointer_impl<_Tp, false> +template <class _Tp> struct __add_pointer_impl<_Tp, false> {typedef _Tp type;}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer @@ -1210,7 +1242,8 @@ template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type { template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_signed_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_signed_v = is_signed<_Tp>::value; #endif @@ -1230,7 +1263,8 @@ template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_unsigned_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_unsigned_v = is_unsigned<_Tp>::value; #endif @@ -1244,7 +1278,8 @@ template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]> : public integral_constant<size_t, rank<_Tp>::value + 1> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR size_t rank_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t rank_v = rank<_Tp>::value; #endif @@ -1262,7 +1297,8 @@ template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS exten : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp, unsigned _Ip = 0> _LIBCPP_CONSTEXPR size_t extent_v +template <class _Tp, unsigned _Ip = 0> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t extent_v = extent<_Tp, _Ip>::value; #endif @@ -1334,7 +1370,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract : public integral_constant<bool, __is_abstract(_Tp)> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_abstract_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_abstract_v = is_abstract<_Tp>::value; #endif @@ -1354,7 +1391,8 @@ is_final : public integral_constant<bool, __is_final(_Tp)> {}; #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_final_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_final_v = is_final<_Tp>::value; #endif @@ -1366,7 +1404,8 @@ is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {}; #if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template <class _Tp> -constexpr bool is_aggregate_v = is_aggregate<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr bool is_aggregate_v + = is_aggregate<_Tp>::value; #endif #endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE) @@ -1407,7 +1446,8 @@ struct _LIBCPP_TEMPLATE_VIS is_base_of #endif // _LIBCPP_HAS_IS_BASE_OF #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Bp, class _Dp> _LIBCPP_CONSTEXPR bool is_base_of_v +template <class _Bp, class _Dp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v = is_base_of<_Bp, _Dp>::value; #endif @@ -1497,7 +1537,8 @@ template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible #endif // __has_feature(is_convertible_to) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _From, class _To> _LIBCPP_CONSTEXPR bool is_convertible_v +template <class _From, class _To> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_convertible_v = is_convertible<_From, _To>::value; #endif @@ -1533,7 +1574,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_empty : public __libcpp_empt #endif // __has_feature(is_empty) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_empty_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_empty_v = is_empty<_Tp>::value; #endif @@ -1558,7 +1600,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_polymorphic #endif // __has_feature(is_polymorphic) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_polymorphic_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_polymorphic_v = is_polymorphic<_Tp>::value; #endif @@ -1577,17 +1620,35 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool has_virtual_destructor_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_virtual_destructor_v = has_virtual_destructor<_Tp>::value; #endif +// has_unique_object_representations + +#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS) + +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations + : public integral_constant<bool, + __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {}; + +#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool has_unique_object_representations_v + = has_unique_object_representations<_Tp>::value; +#endif + +#endif + // alignment_of template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of : public integral_constant<size_t, __alignof__(_Tp)> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR size_t alignment_of_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t alignment_of_v = alignment_of<_Tp>::value; #endif @@ -2126,7 +2187,8 @@ struct is_assignable : public __is_assignable_imp<_Tp, _Arg> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_assignable_v +template <class _Tp, class _Arg> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_assignable_v = is_assignable<_Tp, _Arg>::value; #endif @@ -2137,7 +2199,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_copy_assignable typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_assignable_v = is_copy_assignable<_Tp>::value; #endif @@ -2152,7 +2215,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_assignable_v = is_move_assignable<_Tp>::value; #endif @@ -2177,7 +2241,7 @@ struct __is_destructor_wellformed { template <typename _Tp1> static __two __test (...); - + static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char); }; @@ -2185,8 +2249,8 @@ template <class _Tp, bool> struct __destructible_imp; template <class _Tp> -struct __destructible_imp<_Tp, false> - : public _VSTD::integral_constant<bool, +struct __destructible_imp<_Tp, false> + : public _VSTD::integral_constant<bool, __is_destructor_wellformed<typename _VSTD::remove_all_extents<_Tp>::type>::value> {}; template <class _Tp> @@ -2215,7 +2279,8 @@ struct is_destructible<void> : public _VSTD::false_type {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v = is_destructible<_Tp>::value; #endif @@ -3111,6 +3176,14 @@ template <class _A0, class _A1> false_type __is_constructible2_test(__any, _A0&, _A1&); +template <class _Tp, class _A0, class _A1, class _A2> +decltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>(), _VSTD::declval<_A2>()), true_type())) +__is_constructible3_test(_Tp&, _A0&, _A1&, _A2&); + +template <class _A0, class _A1, class _A2> +false_type +__is_constructible3_test(__any, _A0&, _A1&, _A2&); + template <bool, class _Tp> struct __is_constructible0_imp // false, _Tp is not a scalar : public common_type @@ -3135,6 +3208,14 @@ struct __is_constructible2_imp // false, _Tp is not a scalar >::type {}; +template <bool, class _Tp, class _A0, class _A1, class _A2> +struct __is_constructible3_imp // false, _Tp is not a scalar + : public common_type + < + decltype(__is_constructible3_test(declval<_Tp&>(), declval<_A0>(), declval<_A1>(), declval<_A2>())) + >::type + {}; + // handle scalars and reference types // Scalars are default constructible, references are not @@ -3154,6 +3235,11 @@ struct __is_constructible2_imp<true, _Tp, _A0, _A1> : public false_type {}; +template <class _Tp, class _A0, class _A1, class _A2> +struct __is_constructible3_imp<true, _Tp, _A0, _A1, _A2> + : public false_type + {}; + // Treat scalars and reference types separately template <bool, class _Tp> @@ -3174,6 +3260,12 @@ struct __is_constructible2_void_check _Tp, _A0, _A1> {}; +template <bool, class _Tp, class _A0, class _A1, class _A2> +struct __is_constructible3_void_check + : public __is_constructible3_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, + _Tp, _A0, _A1, _A2> + {}; + // If any of T or Args is void, is_constructible should be false template <class _Tp> @@ -3191,17 +3283,24 @@ struct __is_constructible2_void_check<true, _Tp, _A0, _A1> : public false_type {}; +template <class _Tp, class _A0, class _A1, class _A2> +struct __is_constructible3_void_check<true, _Tp, _A0, _A1, _A2> + : public false_type + {}; + // is_constructible entry point template <class _Tp, class _A0 = __is_construct::__nat, - class _A1 = __is_construct::__nat> + class _A1 = __is_construct::__nat, + class _A2 = __is_construct::__nat> struct _LIBCPP_TEMPLATE_VIS is_constructible - : public __is_constructible2_void_check<is_void<_Tp>::value + : public __is_constructible3_void_check<is_void<_Tp>::value || is_abstract<_Tp>::value || is_function<_Tp>::value || is_void<_A0>::value - || is_void<_A1>::value, - _Tp, _A0, _A1> + || is_void<_A1>::value + || is_void<_A2>::value, + _Tp, _A0, _A1, _A2> {}; template <class _Tp> @@ -3221,6 +3320,16 @@ struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, __is_construct::__nat> _Tp, _A0> {}; +template <class _Tp, class _A0, class _A1> +struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, _A1, __is_construct::__nat> + : public __is_constructible2_void_check<is_void<_Tp>::value + || is_abstract<_Tp>::value + || is_function<_Tp>::value + || is_void<_A0>::value + || is_void<_A1>::value, + _Tp, _A0, _A1> + {}; + // Array types are default constructible if their element type // is default constructible @@ -3239,6 +3348,11 @@ struct __is_constructible2_imp<false, _Ap[_Np], _A0, _A1> : public false_type {}; +template <class _Ap, size_t _Np, class _A0, class _A1, class _A2> +struct __is_constructible3_imp<false, _Ap[_Np], _A0, _A1, _A2> + : public false_type + {}; + // Incomplete array types are not constructible template <class _Ap> @@ -3256,11 +3370,17 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1> : public false_type {}; +template <class _Ap, class _A0, class _A1, class _A2> +struct __is_constructible3_imp<false, _Ap[], _A0, _A1, _A2> + : public false_type + {}; + #endif // __has_feature(is_constructible) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) -template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_constructible_v +template <class _Tp, class ..._Args> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_constructible_v = is_constructible<_Tp, _Args...>::value; #endif @@ -3272,7 +3392,8 @@ struct _LIBCPP_TEMPLATE_VIS is_default_constructible {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_default_constructible_v = is_default_constructible<_Tp>::value; #endif @@ -3280,11 +3401,12 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_copy_constructible - : public is_constructible<_Tp, + : public is_constructible<_Tp, typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_constructible_v = is_copy_constructible<_Tp>::value; #endif @@ -3300,7 +3422,8 @@ struct _LIBCPP_TEMPLATE_VIS is_move_constructible {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_move_constructible_v = is_move_constructible<_Tp>::value; #endif @@ -3432,7 +3555,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&, #endif // _LIBCPP_HAS_NO_VARIADICS #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) -template <class _Tp, class... _Args> _LIBCPP_CONSTEXPR bool is_trivially_constructible_v +template <class _Tp, class... _Args> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_constructible_v = is_trivially_constructible<_Tp, _Args...>::value; #endif @@ -3443,7 +3567,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructi {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v = is_trivially_default_constructible<_Tp>::value; #endif @@ -3454,7 +3579,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v = is_trivially_copy_constructible<_Tp>::value; #endif @@ -3469,7 +3595,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v = is_trivially_move_constructible<_Tp>::value; #endif @@ -3512,7 +3639,8 @@ struct is_trivially_assignable<_Tp&, _Tp&&> #endif // !__has_feature(is_trivially_assignable) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_trivially_assignable_v +template <class _Tp, class _Arg> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_assignable_v = is_trivially_assignable<_Tp, _Arg>::value; #endif @@ -3523,7 +3651,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v = is_trivially_copy_assignable<_Tp>::value; #endif @@ -3539,7 +3668,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v = is_trivially_move_assignable<_Tp>::value; #endif @@ -3565,7 +3695,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible<_Tp[] #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_destructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_destructible_v = is_trivially_destructible<_Tp>::value; #endif @@ -3730,7 +3861,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&, #endif // __has_feature(is_nothrow_constructible) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) -template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v +template <class _Tp, class ..._Args> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v = is_nothrow_constructible<_Tp, _Args...>::value; #endif @@ -3741,7 +3873,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructibl {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v = is_nothrow_default_constructible<_Tp>::value; #endif @@ -3752,7 +3885,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v = is_nothrow_copy_constructible<_Tp>::value; #endif @@ -3767,7 +3901,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v = is_nothrow_move_constructible<_Tp>::value; #endif @@ -3840,7 +3975,8 @@ struct is_nothrow_assignable<_Tp&, _Tp&&> #endif // __has_feature(cxx_noexcept) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v +template <class _Tp, class _Arg> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v = is_nothrow_assignable<_Tp, _Arg>::value; #endif @@ -3851,7 +3987,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<_Tp>::value; #endif @@ -3867,7 +4004,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<_Tp>::value; #endif @@ -3933,7 +4071,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value; #endif @@ -3955,7 +4094,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod #endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_pod_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pod_v = is_pod<_Tp>::value; #endif @@ -3969,9 +4109,10 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type is_reference<typename remove_all_extents<_Tp>::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_literal_type_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_literal_type_v = is_literal_type<_Tp>::value; #endif @@ -3984,9 +4125,10 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_standard_layout_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_standard_layout_v = is_standard_layout<_Tp>::value; #endif @@ -4001,9 +4143,10 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value> #endif {}; - + #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copyable_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value; #endif @@ -4019,7 +4162,8 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) -template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivial_v +template <class _Tp> +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivial_v = is_trivial<_Tp>::value; #endif @@ -4030,147 +4174,6 @@ template <class _Tp> struct __is_reference_wrapper #ifndef _LIBCPP_CXX03_LANG -// Check for complete types - -template <class ..._Tp> struct __check_complete; - -template <> -struct __check_complete<> -{ -}; - -template <class _Hp, class _T0, class ..._Tp> -struct __check_complete<_Hp, _T0, _Tp...> - : private __check_complete<_Hp>, - private __check_complete<_T0, _Tp...> -{ -}; - -template <class _Hp> -struct __check_complete<_Hp, _Hp> - : private __check_complete<_Hp> -{ -}; - -template <class _Tp> -struct __check_complete<_Tp> -{ - static_assert(sizeof(_Tp) > 0, "Type must be complete."); -}; - -template <class _Tp> -struct __check_complete<_Tp&> - : private __check_complete<_Tp> -{ -}; - -template <class _Tp> -struct __check_complete<_Tp&&> - : private __check_complete<_Tp> -{ -}; - -template <class _Rp, class ..._Param> -struct __check_complete<_Rp (*)(_Param...)> - : private __check_complete<_Rp> -{ -}; - -template <class ..._Param> -struct __check_complete<void (*)(_Param...)> -{ -}; - -template <class _Rp, class ..._Param> -struct __check_complete<_Rp (_Param...)> - : private __check_complete<_Rp> -{ -}; - -template <class ..._Param> -struct __check_complete<void (_Param...)> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...)> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) volatile> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const volatile> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) &> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) volatile&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) &&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const&&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class, class ..._Param> -struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&> - : private __check_complete<_Class> -{ -}; - -template <class _Rp, class _Class> -struct __check_complete<_Rp _Class::*> - : private __check_complete<_Class> -{ -}; - - template <class _Fp, class _A0, class _DecayFp = typename decay<_Fp>::type, class _DecayA0 = typename decay<_A0>::type, @@ -4353,8 +4356,9 @@ _LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...) template <class _Ret, class _Fp, class ..._Args> struct __invokable_r - : private __check_complete<_Fp> { + // FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void, + // or incomplete array types as required by the standard. using _Result = decltype( _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)); @@ -4457,12 +4461,14 @@ struct _LIBCPP_TEMPLATE_VIS is_invocable_r : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {}; template <class _Fn, class ..._Args> -constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value; +_LIBCPP_INLINE_VAR constexpr bool is_invocable_v + = is_invocable<_Fn, _Args...>::value; template <class _Ret, class _Fn, class ..._Args> -constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value; +_LIBCPP_INLINE_VAR constexpr bool is_invocable_r_v + = is_invocable_r<_Ret, _Fn, _Args...>::value; -// is_nothrow_callable +// is_nothrow_invocable template <class _Fn, class ..._Args> struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable @@ -4473,10 +4479,12 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {}; template <class _Fn, class ..._Args> -constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value; +_LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_v + = is_nothrow_invocable<_Fn, _Args...>::value; template <class _Ret, class _Fn, class ..._Args> -constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value; +_LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_r_v + = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value; #endif // _LIBCPP_STD_VER > 14 @@ -4616,16 +4624,20 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable }; template <class _Tp, class _Up> -constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value; +_LIBCPP_INLINE_VAR constexpr bool is_swappable_with_v + = is_swappable_with<_Tp, _Up>::value; template <class _Tp> -constexpr bool is_swappable_v = is_swappable<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr bool is_swappable_v + = is_swappable<_Tp>::value; template <class _Tp, class _Up> -constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; +_LIBCPP_INLINE_VAR constexpr bool is_nothrow_swappable_with_v + = is_nothrow_swappable_with<_Tp, _Up>::value; template <class _Tp> -constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr bool is_nothrow_swappable_v + = is_nothrow_swappable<_Tp>::value; #endif // _LIBCPP_STD_VER > 14 @@ -4664,39 +4676,39 @@ struct __sfinae_underlying_type template <class _Tp> struct __sfinae_underlying_type<_Tp, false> {}; -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR int __convert_to_integral(int __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned __convert_to_integral(unsigned __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long __convert_to_integral(long __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned long __convert_to_integral(unsigned long __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long long __convert_to_integral(long long __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unsigned long long __convert_to_integral(unsigned long long __val) {return __val; } template<typename _Fp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_Fp>::value, long long>::type __convert_to_integral(_Fp __val) { return __val; } #ifndef _LIBCPP_HAS_NO_INT128 -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __int128_t __convert_to_integral(__int128_t __val) { return __val; } -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __uint128_t __convert_to_integral(__uint128_t __val) { return __val; } #endif template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename __sfinae_underlying_type<_Tp>::__promoted_type __convert_to_integral(_Tp __val) { return __val; } @@ -4742,15 +4754,21 @@ template <class...> using void_t = void; # ifndef _LIBCPP_HAS_NO_VARIADICS template <class... _Args> struct conjunction : __and_<_Args...> {}; -template<class... _Args> constexpr bool conjunction_v = conjunction<_Args...>::value; +template<class... _Args> +_LIBCPP_INLINE_VAR constexpr bool conjunction_v + = conjunction<_Args...>::value; template <class... _Args> struct disjunction : __or_<_Args...> {}; -template<class... _Args> constexpr bool disjunction_v = disjunction<_Args...>::value; +template<class... _Args> +_LIBCPP_INLINE_VAR constexpr bool disjunction_v + = disjunction<_Args...>::value; template <class _Tp> struct negation : __not_<_Tp> {}; -template<class _Tp> constexpr bool negation_v = negation<_Tp>::value; +template<class _Tp> +_LIBCPP_INLINE_VAR constexpr bool negation_v + = negation<_Tp>::value; # endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_STD_VER > 14 @@ -4787,6 +4805,21 @@ struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy> #endif +#if _LIBCPP_STD_VER > 17 +enum class endian +{ + little = 0xDEAD, + big = 0xFACE, +#if defined(_LIBCPP_LITTLE_ENDIAN) + native = little +#elif defined(_LIBCPP_BIG_ENDIAN) + native = big +#else + native = 0xCAFE +#endif +}; +#endif + _LIBCPP_END_NAMESPACE_STD #if _LIBCPP_STD_VER > 14 @@ -4797,7 +4830,7 @@ template <class _Integer> constexpr typename enable_if<is_integral_v<_Integer>, byte>::type & operator<<=(byte& __lhs, _Integer __shift) noexcept { return __lhs = __lhs << __shift; } - + template <class _Integer> constexpr typename enable_if<is_integral_v<_Integer>, byte>::type operator<< (byte __lhs, _Integer __shift) noexcept @@ -4812,7 +4845,7 @@ template <class _Integer> constexpr typename enable_if<is_integral_v<_Integer>, byte>::type operator>> (byte __lhs, _Integer __shift) noexcept { return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift)); } - + template <class _Integer> constexpr typename enable_if<is_integral_v<_Integer>, _Integer>::type to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); } diff --git a/include/typeinfo b/include/typeinfo index 7e8d3990ed987..f32ea6e76f176 100644 --- a/include/typeinfo +++ b/include/typeinfo @@ -69,6 +69,10 @@ public: #pragma GCC system_header #endif +#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) +#include <vcruntime_typeinfo.h> +#else + #if !defined(_LIBCPP_ABI_MICROSOFT) #if defined(_LIBCPP_NONUNIQUE_RTTI_BIT) #define _LIBCPP_HAS_NONUNIQUE_TYPEINFO @@ -219,8 +223,10 @@ public: } // std +#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) + _LIBCPP_BEGIN_NAMESPACE_STD -_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY void __throw_bad_cast() { #ifndef _LIBCPP_NO_EXCEPTIONS diff --git a/include/unordered_map b/include/unordered_map index 725cb6af27599..f34d82efdc338 100644 --- a/include/unordered_map +++ b/include/unordered_map @@ -396,7 +396,7 @@ public: const _Hash& hash_function() const _NOEXCEPT {return *this;} _LIBCPP_INLINE_VISIBILITY size_t operator()(const _Cp& __x) const - {return static_cast<const _Hash&>(*this)(__x.__cc.first);} + {return static_cast<const _Hash&>(*this)(__x.__get_value().first);} _LIBCPP_INLINE_VISIBILITY size_t operator()(const _Key& __x) const {return static_cast<const _Hash&>(*this)(__x);} @@ -425,7 +425,7 @@ public: const _Hash& hash_function() const _NOEXCEPT {return __hash_;} _LIBCPP_INLINE_VISIBILITY size_t operator()(const _Cp& __x) const - {return __hash_(__x.__cc.first);} + {return __hash_(__x.__get_value().first);} _LIBCPP_INLINE_VISIBILITY size_t operator()(const _Key& __x) const {return __hash_(__x);} @@ -464,13 +464,13 @@ public: const _Pred& key_eq() const _NOEXCEPT {return *this;} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _Cp& __y) const - {return static_cast<const _Pred&>(*this)(__x.__cc.first, __y.__cc.first);} + {return static_cast<const _Pred&>(*this)(__x.__get_value().first, __y.__get_value().first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _Key& __y) const - {return static_cast<const _Pred&>(*this)(__x.__cc.first, __y);} + {return static_cast<const _Pred&>(*this)(__x.__get_value().first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _Cp& __y) const - {return static_cast<const _Pred&>(*this)(__x, __y.__cc.first);} + {return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);} void swap(__unordered_map_equal&__y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { @@ -496,13 +496,13 @@ public: const _Pred& key_eq() const _NOEXCEPT {return __pred_;} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _Cp& __y) const - {return __pred_(__x.__cc.first, __y.__cc.first);} + {return __pred_(__x.__get_value().first, __y.__get_value().first);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Cp& __x, const _Key& __y) const - {return __pred_(__x.__cc.first, __y);} + {return __pred_(__x.__get_value().first, __y);} _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _Cp& __y) const - {return __pred_(__x, __y.__cc.first);} + {return __pred_(__x, __y.__get_value().first);} void swap(__unordered_map_equal&__y) _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value) { @@ -572,9 +572,9 @@ public: void operator()(pointer __p) _NOEXCEPT { if (__second_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.second)); + __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().second)); if (__first_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.first)); + __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__get_value().first)); if (__p) __alloc_traits::deallocate(__na_, __p, 1); } @@ -582,23 +582,67 @@ public: #ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp> -union __hash_value_type +struct __hash_value_type { typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; + typedef pair<key_type&, mapped_type&> __nc_ref_pair_type; + typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type; +private: value_type __cc; - __nc_value_type __nc; + +public: + _LIBCPP_INLINE_VISIBILITY + value_type& __get_value() + { +#if _LIBCPP_STD_VER > 14 + return *_VSTD::launder(_VSTD::addressof(__cc)); +#else + return __cc; +#endif + } + + _LIBCPP_INLINE_VISIBILITY + const value_type& __get_value() const + { +#if _LIBCPP_STD_VER > 14 + return *_VSTD::launder(_VSTD::addressof(__cc)); +#else + return __cc; +#endif + } + + _LIBCPP_INLINE_VISIBILITY + __nc_ref_pair_type __ref() + { + value_type& __v = __get_value(); + return __nc_ref_pair_type(const_cast<key_type&>(__v.first), __v.second); + } + + _LIBCPP_INLINE_VISIBILITY + __nc_rref_pair_type __move() + { + value_type& __v = __get_value(); + return __nc_rref_pair_type( + _VSTD::move(const_cast<key_type&>(__v.first)), + _VSTD::move(__v.second)); + } _LIBCPP_INLINE_VISIBILITY __hash_value_type& operator=(const __hash_value_type& __v) - {__nc = __v.__cc; return *this;} + { + __ref() = __v.__get_value(); + return *this; + } _LIBCPP_INLINE_VISIBILITY __hash_value_type& operator=(__hash_value_type&& __v) - {__nc = _VSTD::move(__v.__nc); return *this;} + { + __ref() = __v.__move(); + return *this; + } template <class _ValueTp, class = typename enable_if< @@ -606,8 +650,10 @@ union __hash_value_type >::type > _LIBCPP_INLINE_VISIBILITY - __hash_value_type& operator=(_ValueTp&& __v) { - __nc = _VSTD::forward<_ValueTp>(__v); return *this; + __hash_value_type& operator=(_ValueTp&& __v) + { + __ref() = _VSTD::forward<_ValueTp>(__v); + return *this; } private: @@ -628,8 +674,15 @@ struct __hash_value_type typedef _Tp mapped_type; typedef pair<const key_type, mapped_type> value_type; +private: value_type __cc; +public: + _LIBCPP_INLINE_VISIBILITY + value_type& __get_value() { return __cc; } + _LIBCPP_INLINE_VISIBILITY + const value_type& __get_value() const { return __cc; } + private: ~__hash_value_type(); }; @@ -657,9 +710,9 @@ public: __hash_map_iterator(_HashIterator __i) _NOEXCEPT : __i_(__i) {} _LIBCPP_INLINE_VISIBILITY - reference operator*() const {return __i_->__cc;} + reference operator*() const {return __i_->__get_value();} _LIBCPP_INLINE_VISIBILITY - pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);} + pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());} _LIBCPP_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;} @@ -711,9 +764,9 @@ public: : __i_(__i.__i_) {} _LIBCPP_INLINE_VISIBILITY - reference operator*() const {return __i_->__cc;} + reference operator*() const {return __i_->__get_value();} _LIBCPP_INLINE_VISIBILITY - pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);} + pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__get_value());} _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator& operator++() {++__i_; return *this;} @@ -750,7 +803,6 @@ public: typedef _Pred key_equal; typedef _Alloc allocator_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same<value_type, typename allocator_type::value_type>::value), @@ -1298,8 +1350,8 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( { iterator __i = __u.begin(); while (__u.size() != 0) { - __table_.__emplace_unique(_VSTD::move( - __u.__table_.remove((__i++).__i_)->__value_.__nc)); + __table_.__emplace_unique( + __u.__table_.remove((__i++).__i_)->__value_.__move()); } } #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1385,7 +1437,7 @@ 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->__cc.second; + std::forward_as_tuple()).first->__get_value().second; } template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> @@ -1394,7 +1446,7 @@ 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->__cc.second; + std::forward_as_tuple()).first->__get_value().second; } #else // _LIBCPP_CXX03_LANG @@ -1404,9 +1456,9 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const { __node_allocator& __na = __table_.__node_alloc(); __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k); + __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().first), __k); __h.get_deleter().__first_constructed = true; - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second)); + __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 } @@ -1500,7 +1552,6 @@ public: typedef _Pred key_equal; typedef _Alloc allocator_type; typedef pair<const key_type, mapped_type> value_type; - typedef pair<key_type, mapped_type> __nc_value_type; typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same<value_type, typename allocator_type::value_type>::value), @@ -1915,8 +1966,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( while (__u.size() != 0) { __table_.__insert_multi( - _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_.__nc) - ); + __u.__table_.remove((__i++).__i_)->__value_.__move()); } } #if _LIBCPP_DEBUG_LEVEL >= 2 diff --git a/include/utility b/include/utility index 288c6e823c3b7..8fdaf65db6a66 100644 --- a/include/utility +++ b/include/utility @@ -14,6 +14,8 @@ /* utility synopsis +#include <initializer_list> + namespace std { @@ -52,7 +54,7 @@ template <class T> >::type move_if_noexcept(T& x) noexcept; // constexpr in C++14 -template <class T> constexpr add_const<T>_t& as_const(T& t) noexcept; // C++17 +template <class T> constexpr add_const_t<T>& as_const(T& t) noexcept; // C++17 template <class T> void as_const(const T&&) = delete; // C++17 template <class T> typename add_rvalue_reference<T>::type declval() noexcept; @@ -99,7 +101,7 @@ void swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); struct piecewise_construct_t { }; -constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); +inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template <class T> class tuple_size; template <size_t I, class T> class tuple_element; @@ -296,7 +298,7 @@ struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { }; #if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY) extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t(); #else -constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); +/* _LIBCPP_INLINE_VAR */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); #endif #if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) @@ -890,7 +892,7 @@ template<class... _Tp> #if _LIBCPP_STD_VER > 11 template<class _T1, class _T2 = _T1> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _T1 exchange(_T1& __obj, _T2 && __new_value) { _T1 __old_value = _VSTD::move(__obj); @@ -904,30 +906,21 @@ _T1 exchange(_T1& __obj, _T2 && __new_value) struct _LIBCPP_TYPE_VIS in_place_t { explicit in_place_t() = default; }; -#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES -inline -#endif -constexpr in_place_t in_place{}; +_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> -#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES -inline -#endif -constexpr in_place_type_t<_Tp> in_place_type{}; +_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> -#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES -inline -#endif -constexpr in_place_index_t<_Idx> in_place_index{}; +_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 {}; diff --git a/include/valarray b/include/valarray index ee61238a932f3..8d3892ad35d91 100644 --- a/include/valarray +++ b/include/valarray @@ -1053,6 +1053,9 @@ private: friend const _Up* end(const valarray<_Up>& __v); + + void __clear(); + valarray& __assign_range(const value_type* __f, const value_type* __l); }; _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t)) @@ -2735,7 +2738,8 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const { __r.__begin_ = __r.__end_ = - static_cast<result_type*>(_VSTD::__allocate(__n * sizeof(result_type))); + static_cast<result_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(result_type), __alignof(result_type))); for (size_t __i = 0; __i != __n; ++__r.__end_, ++__i) ::new (__r.__end_) result_type(__expr_[__i]); } @@ -2750,7 +2754,25 @@ valarray<_Tp>::valarray(size_t __n) : __begin_(0), __end_(0) { - resize(__n); + if (__n) + { + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + for (; __n; --__n, ++__end_) + ::new (__end_) value_type(); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + __clear(); + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + } } template <class _Tp> @@ -2769,7 +2791,8 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n) { if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2780,7 +2803,7 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2794,7 +2817,8 @@ valarray<_Tp>::valarray(const valarray& __v) { if (__v.size()) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__v.size() * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__v.size() * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2805,7 +2829,7 @@ valarray<_Tp>::valarray(const valarray& __v) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2831,7 +2855,8 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il) size_t __n = __il.size(); if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( +_VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2842,7 +2867,7 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2859,7 +2884,8 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa) size_t __n = __sa.__size_; if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2870,7 +2896,7 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2885,7 +2911,8 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga) size_t __n = __ga.__1d_.size(); if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2899,7 +2926,7 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2914,7 +2941,8 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma) size_t __n = __ma.__1d_.size(); if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2928,7 +2956,7 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2943,7 +2971,8 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia) size_t __n = __ia.__1d_.size(); if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -2957,7 +2986,7 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS @@ -2968,22 +2997,36 @@ template <class _Tp> inline valarray<_Tp>::~valarray() { - resize(0); + __clear(); } template <class _Tp> valarray<_Tp>& -valarray<_Tp>::operator=(const valarray& __v) +valarray<_Tp>::__assign_range(const value_type* __f, const value_type* __l) { - if (this != &__v) + size_t __n = __l - __f; + if (size() != __n) { - if (size() != __v.size()) - resize(__v.size()); - _VSTD::copy(__v.__begin_, __v.__end_, __begin_); + __clear(); + __begin_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); + __end_ = __begin_ + __n; + _VSTD::uninitialized_copy(__f, __l, __begin_); + } else { + _VSTD::copy(__f, __l, __begin_); } return *this; } +template <class _Tp> +valarray<_Tp>& +valarray<_Tp>::operator=(const valarray& __v) +{ + if (this != &__v) + return __assign_range(__v.__begin_, __v.__end_); + return *this; +} + #ifndef _LIBCPP_CXX03_LANG template <class _Tp> @@ -2991,7 +3034,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT { - resize(0); + __clear(); __begin_ = __v.__begin_; __end_ = __v.__end_; __v.__begin_ = nullptr; @@ -3004,10 +3047,7 @@ inline valarray<_Tp>& valarray<_Tp>::operator=(initializer_list<value_type> __il) { - if (size() != __il.size()) - resize(__il.size()); - _VSTD::copy(__il.begin(), __il.end(), __begin_); - return *this; + return __assign_range(__il.begin(), __il.end()); } #endif // _LIBCPP_CXX03_LANG @@ -3224,7 +3264,8 @@ valarray<_Tp>::operator+() const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) value_type(+*__p); } @@ -3241,7 +3282,8 @@ valarray<_Tp>::operator-() const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) value_type(-*__p); } @@ -3258,7 +3300,8 @@ valarray<_Tp>::operator~() const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) value_type(~*__p); } @@ -3275,7 +3318,7 @@ valarray<_Tp>::operator!() const { __r.__begin_ = __r.__end_ = - static_cast<bool*>(_VSTD::__allocate(__n * sizeof(bool))); + static_cast<bool*>(_VSTD::__libcpp_allocate(__n * sizeof(bool), __alignof(bool))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) bool(!*__p); } @@ -3595,7 +3638,8 @@ valarray<_Tp>::shift(int __i) const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); const value_type* __sb; value_type* __tb; value_type* __te; @@ -3633,7 +3677,8 @@ valarray<_Tp>::cshift(int __i) const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); __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) @@ -3654,7 +3699,8 @@ valarray<_Tp>::apply(value_type __f(value_type)) const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) value_type(__f(*__p)); } @@ -3671,7 +3717,8 @@ valarray<_Tp>::apply(value_type __f(const value_type&)) const { __r.__begin_ = __r.__end_ = - static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n) ::new (__r.__end_) value_type(__f(*__p)); } @@ -3680,18 +3727,26 @@ valarray<_Tp>::apply(value_type __f(const value_type&)) const template <class _Tp> void -valarray<_Tp>::resize(size_t __n, value_type __x) +valarray<_Tp>::__clear() { if (__begin_ != nullptr) { while (__end_ != __begin_) (--__end_)->~value_type(); - _VSTD::__libcpp_deallocate(__begin_); + _VSTD::__libcpp_deallocate(__begin_, __alignof(value_type)); __begin_ = __end_ = nullptr; } +} + +template <class _Tp> +void +valarray<_Tp>::resize(size_t __n, value_type __x) +{ + __clear(); if (__n) { - __begin_ = __end_ = static_cast<value_type*>(_VSTD::__allocate(__n * sizeof(value_type))); + __begin_ = __end_ = static_cast<value_type*>( + _VSTD::__libcpp_allocate(__n * sizeof(value_type), __alignof(value_type))); #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -3702,7 +3757,7 @@ valarray<_Tp>::resize(size_t __n, value_type __x) } catch (...) { - resize(0); + __clear(); throw; } #endif // _LIBCPP_NO_EXCEPTIONS diff --git a/include/variant b/include/variant index 8a66add865ae4..f9098f42249a7 100644 --- a/include/variant +++ b/include/variant @@ -76,7 +76,7 @@ namespace std { template <class T> struct variant_size; // undefined template <class T> - constexpr size_t variant_size_v = variant_size<T>::value; + inline constexpr size_t variant_size_v = variant_size<T>::value; template <class T> struct variant_size<const T>; template <class T> struct variant_size<volatile T>; @@ -97,7 +97,7 @@ namespace std { template <size_t I, class... Types> struct variant_alternative<I, variant<Types...>>; - constexpr size_t variant_npos = -1; + inline constexpr size_t variant_npos = -1; // 20.7.4, value access template <class T, class... Types> @@ -246,7 +246,7 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS variant_size; template <class _Tp> -constexpr size_t variant_size_v = variant_size<_Tp>::value; +_LIBCPP_INLINE_VAR constexpr size_t variant_size_v = variant_size<_Tp>::value; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS variant_size<const _Tp> : variant_size<_Tp> {}; @@ -286,7 +286,7 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> { using type = __type_pack_element<_Ip, _Types...>; }; -constexpr size_t variant_npos = static_cast<size_t>(-1); +_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()) @@ -476,8 +476,8 @@ private: template <class... _Fs> inline _LIBCPP_INLINE_VISIBILITY static constexpr auto __make_farray(_Fs&&... __fs) { - __std_visit_visitor_return_type_check<decay_t<_Fs>...>(); - using __result = array<common_type_t<decay_t<_Fs>...>, sizeof...(_Fs)>; + __std_visit_visitor_return_type_check<__uncvref_t<_Fs>...>(); + using __result = array<common_type_t<__uncvref_t<_Fs>...>, sizeof...(_Fs)>; return __result{{_VSTD::forward<_Fs>(__fs)...}}; } @@ -514,8 +514,8 @@ private: template <class _Fp, class _Vp, class... _Vs> inline _LIBCPP_INLINE_VISIBILITY static constexpr auto __make_fdiagonal() { - constexpr size_t _Np = decay_t<_Vp>::__size(); - static_assert(__all<(_Np == decay_t<_Vs>::__size())...>::value); + constexpr size_t _Np = __uncvref_t<_Vp>::__size(); + static_assert(__all<(_Np == __uncvref_t<_Vs>::__size())...>::value); return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{}); } @@ -538,7 +538,7 @@ private: inline _LIBCPP_INLINE_VISIBILITY static constexpr auto __make_fmatrix() { return __make_fmatrix_impl<_Fp, _Vs...>( - index_sequence<>{}, make_index_sequence<decay_t<_Vs>::__size()>{}...); + index_sequence<>{}, make_index_sequence<__uncvref_t<_Vs>::__size()>{}...); } }; @@ -756,7 +756,7 @@ _LIBCPP_VARIANT_DESTRUCTOR( if (!this->valueless_by_exception()) { __visitation::__base::__visit_alt( [](auto& __alt) noexcept { - using __alt_type = decay_t<decltype(__alt)>; + using __alt_type = __uncvref_t<decltype(__alt)>; __alt.~__alt_type(); }, *this); @@ -1143,9 +1143,9 @@ public: template < class _Arg, - enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0, - enable_if_t<!__is_inplace_type<decay_t<_Arg>>::value, int> = 0, - enable_if_t<!__is_inplace_index<decay_t<_Arg>>::value, int> = 0, + enable_if_t<!is_same_v<__uncvref_t<_Arg>, variant>, int> = 0, + enable_if_t<!__is_inplace_type<__uncvref_t<_Arg>>::value, int> = 0, + enable_if_t<!__is_inplace_index<__uncvref_t<_Arg>>::value, int> = 0, class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>, size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value, @@ -1215,7 +1215,7 @@ public: template < class _Arg, - enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0, + enable_if_t<!is_same_v<__uncvref_t<_Arg>, variant>, int> = 0, class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>, size_t _Ip = __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value, @@ -1564,7 +1564,7 @@ struct _LIBCPP_TEMPLATE_VIS hash< ? 299792458 // Random value chosen by the universe upon creation : __variant::__visit_alt( [](const auto& __alt) { - using __alt_type = decay_t<decltype(__alt)>; + using __alt_type = __uncvref_t<decltype(__alt)>; using __value_type = remove_const_t< typename __alt_type::__value_type>; return hash<__value_type>{}(__alt.__value); diff --git a/include/vector b/include/vector index 54b1e8831d5bc..0f5006f375671 100644 --- a/include/vector +++ b/include/vector @@ -244,6 +244,10 @@ public: bool __invariants() const; }; +template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> + vector(InputIterator, InputIterator, Allocator = Allocator()) + -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>; + template <class Allocator> struct hash<std::vector<bool, Allocator>>; template <class T, class Allocator> bool operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y); @@ -291,7 +295,7 @@ template <bool> class __vector_base_common { protected: - _LIBCPP_ALWAYS_INLINE __vector_base_common() {} + _LIBCPP_INLINE_VISIBILITY __vector_base_common() {} _LIBCPP_NORETURN void __throw_length_error() const; _LIBCPP_NORETURN void __throw_out_of_range() const; }; @@ -316,13 +320,14 @@ template <class _Tp, class _Allocator> class __vector_base : protected __vector_base_common<true> { -protected: - typedef _Tp value_type; +public: typedef _Allocator allocator_type; typedef allocator_traits<allocator_type> __alloc_traits; + typedef typename __alloc_traits::size_type size_type; +protected: + typedef _Tp value_type; typedef value_type& reference; typedef const value_type& const_reference; - typedef typename __alloc_traits::size_type size_type; typedef typename __alloc_traits::difference_type difference_type; typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; @@ -350,6 +355,9 @@ protected: __vector_base() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value); _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a); +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY __vector_base(allocator_type&& __a) _NOEXCEPT; +#endif ~__vector_base(); _LIBCPP_INLINE_VISIBILITY @@ -433,6 +441,15 @@ __vector_base<_Tp, _Allocator>::__vector_base(const allocator_type& __a) { } +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp, class _Allocator> +inline _LIBCPP_INLINE_VISIBILITY +__vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT + : __begin_(nullptr), + __end_(nullptr), + __end_cap_(nullptr, std::move(__a)) {} +#endif + template <class _Tp, class _Allocator> __vector_base<_Tp, _Allocator>::~__vector_base() { @@ -492,8 +509,8 @@ public: #if _LIBCPP_STD_VER > 11 explicit vector(size_type __n, const allocator_type& __a); #endif - vector(size_type __n, const_reference __x); - vector(size_type __n, const_reference __x, const allocator_type& __a); + vector(size_type __n, const value_type& __x); + vector(size_type __n, const value_type& __x, const allocator_type& __a); template <class _InputIterator> vector(_InputIterator __first, typename enable_if<__is_input_iterator <_InputIterator>::value && @@ -776,8 +793,8 @@ public: private: _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators(); _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last); - void allocate(size_type __n); - void deallocate() _NOEXCEPT; + void __vallocate(size_type __n); + void __vdeallocate() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; void __construct_at_end(size_type __n); _LIBCPP_INLINE_VISIBILITY @@ -890,6 +907,22 @@ private: }; +#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 + > +vector(_InputIterator, _InputIterator) + -> vector<typename iterator_traits<_InputIterator>::value_type, _Alloc>; + +template<class _InputIterator, + class _Alloc, + class = typename enable_if<__is_allocator<_Alloc>::value, void>::type + > +vector(_InputIterator, _InputIterator, _Alloc) + -> vector<typename iterator_traits<_InputIterator>::value_type, _Alloc>; +#endif + template <class _Tp, class _Allocator> void vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v) @@ -930,7 +963,7 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a // Postcondition: size() == 0 template <class _Tp, class _Allocator> void -vector<_Tp, _Allocator>::allocate(size_type __n) +vector<_Tp, _Allocator>::__vallocate(size_type __n) { if (__n > max_size()) this->__throw_length_error(); @@ -941,7 +974,7 @@ vector<_Tp, _Allocator>::allocate(size_type __n) template <class _Tp, class _Allocator> void -vector<_Tp, _Allocator>::deallocate() _NOEXCEPT +vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT { if (this->__begin_ != nullptr) { @@ -1077,7 +1110,7 @@ vector<_Tp, _Allocator>::vector(size_type __n) #endif if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n); } } @@ -1092,27 +1125,27 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a) #endif if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n); } } #endif template <class _Tp, class _Allocator> -vector<_Tp, _Allocator>::vector(size_type __n, const_reference __x) +vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); #endif if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, __x); } } template <class _Tp, class _Allocator> -vector<_Tp, _Allocator>::vector(size_type __n, const_reference __x, const allocator_type& __a) +vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a) : __base(__a) { #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1120,7 +1153,7 @@ vector<_Tp, _Allocator>::vector(size_type __n, const_reference __x, const alloca #endif if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, __x); } } @@ -1174,7 +1207,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__first, __last, __n); } } @@ -1194,7 +1227,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__first, __last, __n); } } @@ -1209,7 +1242,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x) size_type __n = __x.size(); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__x.__begin_, __x.__end_, __n); } } @@ -1224,7 +1257,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a) size_type __n = __x.size(); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__x.__begin_, __x.__end_, __n); } } @@ -1285,7 +1318,7 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il) #endif if (__il.size() > 0) { - allocate(__il.size()); + __vallocate(__il.size()); __construct_at_end(__il.begin(), __il.end(), __il.size()); } } @@ -1300,7 +1333,7 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocat #endif if (__il.size() > 0) { - allocate(__il.size()); + __vallocate(__il.size()); __construct_at_end(__il.begin(), __il.end(), __il.size()); } } @@ -1335,7 +1368,7 @@ void vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) { - deallocate(); + __vdeallocate(); __base::__move_assign_alloc(__c); // this can throw this->__begin_ = __c.__begin_; this->__end_ = __c.__end_; @@ -1410,8 +1443,8 @@ vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __las } else { - deallocate(); - allocate(__recommend(__new_size)); + __vdeallocate(); + __vallocate(__recommend(__new_size)); __construct_at_end(__first, __last, __new_size); } __invalidate_all_iterators(); @@ -1432,8 +1465,8 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) } else { - deallocate(); - allocate(__recommend(static_cast<size_type>(__n))); + __vdeallocate(); + __vallocate(__recommend(static_cast<size_type>(__n))); __construct_at_end(__n, __u); } __invalidate_all_iterators(); @@ -2416,8 +2449,8 @@ public: private: _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators(); - void allocate(size_type __n); - void deallocate() _NOEXCEPT; + void __vallocate(size_type __n); + void __vdeallocate() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static size_type __align_it(size_type __new_size) _NOEXCEPT {return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);}; @@ -2455,7 +2488,7 @@ private: void __copy_assign_alloc(const vector& __c, true_type) { if (__alloc() != __c.__alloc()) - deallocate(); + __vdeallocate(); __alloc() = __c.__alloc(); } @@ -2511,7 +2544,7 @@ vector<bool, _Allocator>::__invalidate_all_iterators() // Postcondition: size() == 0 template <class _Allocator> void -vector<bool, _Allocator>::allocate(size_type __n) +vector<bool, _Allocator>::__vallocate(size_type __n) { if (__n > max_size()) this->__throw_length_error(); @@ -2523,7 +2556,7 @@ vector<bool, _Allocator>::allocate(size_type __n) template <class _Allocator> void -vector<bool, _Allocator>::deallocate() _NOEXCEPT +vector<bool, _Allocator>::__vdeallocate() _NOEXCEPT { if (this->__begin_ != nullptr) { @@ -2620,7 +2653,7 @@ vector<bool, _Allocator>::vector(size_type __n) { if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, false); } } @@ -2634,7 +2667,7 @@ vector<bool, _Allocator>::vector(size_type __n, const allocator_type& __a) { if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, false); } } @@ -2648,7 +2681,7 @@ vector<bool, _Allocator>::vector(size_type __n, const value_type& __x) { if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, __x); } } @@ -2661,7 +2694,7 @@ vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const all { if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__n, __x); } } @@ -2731,7 +2764,7 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__first, __last); } } @@ -2747,7 +2780,7 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__first, __last); } } @@ -2763,7 +2796,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il) size_type __n = static_cast<size_type>(__il.size()); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__il.begin(), __il.end()); } } @@ -2777,7 +2810,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il, const alloca size_type __n = static_cast<size_type>(__il.size()); if (__n > 0) { - allocate(__n); + __vallocate(__n); __construct_at_end(__il.begin(), __il.end()); } } @@ -2800,7 +2833,7 @@ vector<bool, _Allocator>::vector(const vector& __v) { if (__v.size() > 0) { - allocate(__v.size()); + __vallocate(__v.size()); __construct_at_end(__v.begin(), __v.end()); } } @@ -2813,7 +2846,7 @@ vector<bool, _Allocator>::vector(const vector& __v, const allocator_type& __a) { if (__v.size() > 0) { - allocate(__v.size()); + __vallocate(__v.size()); __construct_at_end(__v.begin(), __v.end()); } } @@ -2829,8 +2862,8 @@ vector<bool, _Allocator>::operator=(const vector& __v) { if (__v.__size_ > capacity()) { - deallocate(); - allocate(__v.__size_); + __vdeallocate(); + __vallocate(__v.__size_); } _VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_); } @@ -2842,17 +2875,15 @@ vector<bool, _Allocator>::operator=(const vector& __v) #ifndef _LIBCPP_CXX03_LANG template <class _Allocator> -inline _LIBCPP_INLINE_VISIBILITY -vector<bool, _Allocator>::vector(vector&& __v) +inline _LIBCPP_INLINE_VISIBILITY vector<bool, _Allocator>::vector(vector&& __v) #if _LIBCPP_STD_VER > 14 - _NOEXCEPT + _NOEXCEPT #else - _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value) + _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value) #endif : __begin_(__v.__begin_), __size_(__v.__size_), - __cap_alloc_(__v.__cap_alloc_) -{ + __cap_alloc_(std::move(__v.__cap_alloc_)) { __v.__begin_ = nullptr; __v.__size_ = 0; __v.__cap() = 0; @@ -2874,7 +2905,7 @@ vector<bool, _Allocator>::vector(vector&& __v, const allocator_type& __a) } else if (__v.size() > 0) { - allocate(__v.size()); + __vallocate(__v.size()); __construct_at_end(__v.begin(), __v.end()); } } @@ -2905,7 +2936,7 @@ void vector<bool, _Allocator>::__move_assign(vector& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) { - deallocate(); + __vdeallocate(); __move_assign_alloc(__c); this->__begin_ = __c.__begin_; this->__size_ = __c.__size_; @@ -2970,8 +3001,8 @@ vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __la { if (__n > capacity()) { - deallocate(); - allocate(__n); + __vdeallocate(); + __vallocate(__n); } __construct_at_end(__first, __last); } @@ -2984,7 +3015,7 @@ vector<bool, _Allocator>::reserve(size_type __n) if (__n > capacity()) { vector __v(this->__alloc()); - __v.allocate(__n); + __v.__vallocate(__n); __v.__construct_at_end(this->begin(), this->end()); swap(__v); __invalidate_all_iterators(); diff --git a/test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp b/include/version index ddc82cb5482f0..23a872ea85ac5 100644 --- a/test/std/experimental/utilities/meta/meta.type.synop/includes.pass.cpp +++ b/include/version @@ -1,4 +1,5 @@ -//===----------------------------------------------------------------------===// +// -*- C++ -*- +//===--------------------------- version ----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,15 +8,18 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> +#ifndef _LIBCPP_VERSIONH +#define _LIBCPP_VERSIONH + +/* + version synopsis + +*/ -#include <experimental/type_traits> +#include <__config> -#ifndef _LIBCPP_TYPE_TRAITS -# error "<experimental/type_traits> must include <type_traits>" +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header #endif -int main() -{ -} +#endif // _LIBCPP_VERSIONH diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index aa5ebf1568ece..e068edc8a7aff 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -44,7 +44,7 @@ if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON) endif() -if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) +if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY) add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic") add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}") add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive") @@ -189,6 +189,9 @@ split_list(LIBCXX_LINK_FLAGS) # Add an object library that contains the compiled source files. add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) +if(LIBCXX_CXX_ABI_HEADER_TARGET) + add_dependencies(cxx_objects ${LIBCXX_CXX_ABI_HEADER_TARGET}) +endif() if(WIN32 AND NOT MINGW) target_compile_definitions(cxx_objects PRIVATE @@ -217,11 +220,12 @@ set_target_properties(cxx_objects COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" ) -set(LIBCXX_TARGETS) - # Build the shared library. if (LIBCXX_ENABLE_SHARED) add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>) + if(COMMAND llvm_setup_rpath) + llvm_setup_rpath(cxx_shared) + endif() target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES}) set_target_properties(cxx_shared PROPERTIES @@ -230,7 +234,10 @@ if (LIBCXX_ENABLE_SHARED) VERSION "${LIBCXX_ABI_VERSION}.0" SOVERSION "${LIBCXX_ABI_VERSION}" ) - list(APPEND LIBCXX_TARGETS "cxx_shared") + list(APPEND LIBCXX_BUILD_TARGETS "cxx_shared") + if (LIBCXX_INSTALL_SHARED_LIBRARY) + list(APPEND LIBCXX_INSTALL_TARGETS "cxx_shared") + endif() if(WIN32 AND NOT MINGW AND NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") # Since we most likely do not have a mt.exe replacement, disable the # manifest bundling. This allows a normal cmake invocation to pass which @@ -250,17 +257,19 @@ if (LIBCXX_ENABLE_STATIC) LINK_FLAGS "${LIBCXX_LINK_FLAGS}" OUTPUT_NAME "c++" ) - - list(APPEND LIBCXX_TARGETS "cxx_static") + list(APPEND LIBCXX_BUILD_TARGETS "cxx_static") + if (LIBCXX_INSTALL_STATIC_LIBRARY) + list(APPEND LIBCXX_INSTALL_TARGETS "cxx_static") + endif() # Attempt to merge the libc++.a archive and the ABI library archive into one. - if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) + if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY) set(MERGE_ARCHIVES_SEARCH_PATHS "") if (LIBCXX_CXX_ABI_LIBRARY_PATH) set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}") endif() if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI)) - set(MERGE_ARCHIVES_ABI_TARGET "$<TARGET_LINKER_FILE:${LIBCXX_CXX_ABI_LIBRARY}>") + set(MERGE_ARCHIVES_ABI_TARGET "$<TARGET_LINKER_FILE:cxxabi_static>") else() set(MERGE_ARCHIVES_ABI_TARGET "${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}") @@ -280,14 +289,44 @@ if (LIBCXX_ENABLE_STATIC) endif() # Add a meta-target for both libraries. -add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS}) +add_custom_target(cxx DEPENDS cxx-headers ${LIBCXX_BUILD_TARGETS}) + +if (LIBCXX_ENABLE_FILESYSTEM) + set(LIBCXX_FILESYSTEM_SOURCES + ../src/filesystem/operations.cpp + ../src/filesystem/directory_iterator.cpp) + + # Filesystem uses __int128_t, which requires a definition of __muloi4 when + # compiled with UBSAN. This definition is not provided by libgcc_s, but is + # provided by compiler-rt. So we need to disable it to avoid having multiple + # definitions. See filesystem/int128_builtins.cpp. + if (NOT LIBCXX_USE_COMPILER_RT) + list(APPEND LIBCXX_FILESYSTEM_SOURCES ../src/filesystem/int128_builtins.cpp) + endif() + + add_library(cxx_filesystem STATIC ${LIBCXX_FILESYSTEM_SOURCES}) + if (LIBCXX_ENABLE_SHARED) + target_link_libraries(cxx_filesystem cxx_shared) + else() + target_link_libraries(cxx_filesystem cxx_static) + endif() + + set(filesystem_flags "${LIBCXX_COMPILE_FLAGS}") + check_flag_supported(-std=c++14) + if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG) + string(REPLACE "-std=c++11" "-std=c++14" filesystem_flags "${LIBCXX_COMPILE_FLAGS}") + endif() + set_target_properties(cxx_filesystem + PROPERTIES + COMPILE_FLAGS "${filesystem_flags}" + OUTPUT_NAME "c++fs" + ) +endif() + if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY) file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp) - if (LIBCXX_ENABLE_FILESYSTEM) - file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp) - endif() - add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES}) + add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES}) if (LIBCXX_ENABLE_SHARED) target_link_libraries(cxx_experimental cxx_shared) else() @@ -353,10 +392,13 @@ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) endif() if (LIBCXX_INSTALL_LIBRARY) + if (LIBCXX_INSTALL_FILESYSTEM_LIBRARY) + set(filesystem_lib cxx_filesystem) + endif() if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) set(experimental_lib cxx_experimental) endif() - install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib} + install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${filesystem_lib} ${experimental_lib} LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx ) @@ -376,6 +418,9 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR if(LIBCXX_INSTALL_LIBRARY) set(lib_install_target cxx) endif() + if (LIBCXX_INSTALL_FILESYSTEM_LIBRARY) + set(filesystem_lib_install_target cxx_filesystem) + endif() if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) set(experimental_lib_install_target cxx_experimental) endif() @@ -385,6 +430,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR add_custom_target(install-cxx DEPENDS ${lib_install_target} ${experimental_lib_install_target} + ${filesystem_lib_install_target} ${header_install_target} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=cxx @@ -392,6 +438,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR add_custom_target(install-cxx-stripped DEPENDS ${lib_install_target} ${experimental_lib_install_target} + ${filesystem_lib_install_target} ${header_install_target} COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=cxx diff --git a/lib/abi/x86_64-apple-darwin16.abilist b/lib/abi/5.0/x86_64-apple-darwin16.abilist index 4e212b18c1200..4e212b18c1200 100644 --- a/lib/abi/x86_64-apple-darwin16.abilist +++ b/lib/abi/5.0/x86_64-apple-darwin16.abilist diff --git a/lib/abi/x86_64-unknown-linux-gnu.abilist b/lib/abi/5.0/x86_64-unknown-linux-gnu.abilist index d6fd52488a6f9..d6fd52488a6f9 100644 --- a/lib/abi/x86_64-unknown-linux-gnu.abilist +++ b/lib/abi/5.0/x86_64-unknown-linux-gnu.abilist diff --git a/lib/abi/6.0/x86_64-apple-darwin16.abilist b/lib/abi/6.0/x86_64-apple-darwin16.abilist new file mode 100644 index 0000000000000..4e212b18c1200 --- /dev/null +++ b/lib/abi/6.0/x86_64-apple-darwin16.abilist @@ -0,0 +1,2378 @@ +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'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': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'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_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__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__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__124__libcpp_debug_exception4whatEv'} +{'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__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__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': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'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': 'OBJECT', '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': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev'} +{'type': 'OBJECT', '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': 'FUNC', '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_cEPv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0} +{'type': 'FUNC', '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__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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0} +{'type': 'FUNC', '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_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__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_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__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__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__118get_pointer_safetyEv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD2Ev'} +{'type': 'FUNC', '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__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0} +{'type': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev'} +{'type': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'} +{'type': 'OBJECT', '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': 'FUNC', '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': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'} +{'type': 'OBJECT', '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_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__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': 'U', 'is_defined': False, 'name': '__ZTIDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__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__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__119__shared_weak_countE', '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__124__libcpp_debug_exceptionE', '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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTIPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTId'} +{'type': 'I', 'is_defined': True, 'name': '__ZTId'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_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__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__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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTSPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSy'} +{'type': 'OBJECT', '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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__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__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__119__shared_weak_countE', '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__124__libcpp_debug_exceptionE', '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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'} +{'type': 'FUNC', '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': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'} +{'type': 'I', 'is_defined': True, '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': 'I', 'is_defined': True, 'name': '___cxa_deleted_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'} +{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'} +{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'} +{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'} +{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'} diff --git a/lib/abi/6.0/x86_64-unknown-linux-gnu.abilist b/lib/abi/6.0/x86_64-unknown-linux-gnu.abilist new file mode 100644 index 0000000000000..d6fd52488a6f9 --- /dev/null +++ b/lib/abi/6.0/x86_64-unknown-linux-gnu.abilist @@ -0,0 +1,1883 @@ +{'is_defined': False, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'type': 'FUNC'} +{'is_defined': False, 'name': '_ZNKSt13runtime_error4whatEv', '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__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__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__124__libcpp_debug_exception4whatEv', '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__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__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': False, 'name': '_ZNSt11logic_errorD2Ev', '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': False, 'name': '_ZNSt12length_errorD1Ev', 'type': 'FUNC'} +{'is_defined': False, 'name': '_ZNSt12out_of_rangeD1Ev', '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': False, 'name': '_ZNSt13runtime_errorD1Ev', 'type': 'FUNC'} +{'is_defined': False, 'name': '_ZNSt13runtime_errorD2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt13runtime_erroraSERKS_', 'type': 'FUNC'} +{'is_defined': False, 'name': '_ZNSt14overflow_errorD1Ev', 'type': 'FUNC'} +{'is_defined': False, 'name': '_ZNSt16invalid_argumentD1Ev', '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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110adopt_lockE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5alnumE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5alphaE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5blankE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5cntrlE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5digitE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5graphE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5lowerE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5printE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5punctE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5spaceE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5upperE', 'type': 'OBJECT'} +{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base6xdigitE', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110defer_lockE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', '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_cEPv', '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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__111try_to_lockE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__112__rs_default4__c_E', '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'} +{'size': 8, 'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', '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'} +{'size': 8, 'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', '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__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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_1E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_2E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_3E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_4E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_5E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_6E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_7E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_8E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_9E', 'type': 'OBJECT'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders3_10E', '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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__113allocator_argE', 'type': 'OBJECT'} +{'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'} +{'size': 33, 'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', '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_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__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_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__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__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__118get_pointer_safetyEv', '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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__119__start_std_streamsE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__119declare_no_pointersEPcm', 'type': 'FUNC'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__119piecewise_constructE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__120__get_collation_nameEPKc', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv', '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'} +{'size': 8, 'is_defined': True, 'name': '_ZNSt3__123__libcpp_debug_functionE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKS0_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKS0_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD0Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD1Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji', 'type': 'FUNC'} +{'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__127__num_get_unsigned_integralIjEET_PKcS3_Rji', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'} +{'size': 168, 'is_defined': True, 'name': '_ZNSt3__13cinE', 'type': 'OBJECT'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14cerrE', 'type': 'OBJECT'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14clogE', 'type': 'OBJECT'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14coutE', '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'} +{'size': 168, 'is_defined': True, 'name': '_ZNSt3__14wcinE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__15ctypeIcE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__15ctypeIwE2idE', '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'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wcerrE', 'type': 'OBJECT'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wclogE', 'type': 'OBJECT'} +{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wcoutE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__16__clocEv', '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'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock3nowEv', 'type': 'FUNC'} +{'size': 1, 'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale2id9__next_idE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale3allE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale4noneE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale4timeE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale5ctypeE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale7collateE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale7numericE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__16locale8__globalEv', 'type': 'FUNC'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale8messagesE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale8monetaryE', '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__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17collateIcE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17collateIwE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base10floatfieldE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base10scientificE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base11adjustfieldE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base2inE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3appE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3ateE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3decE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3hexE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3octE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3outE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base4leftE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5fixedE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5rightE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5truncE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6badbitE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6binaryE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6eofbitE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6skipwsE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__18ios_base6xallocEv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__18ios_base7copyfmtERKS0_', 'type': 'FUNC'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7failbitE', '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'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7goodbitE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7showposE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'type': 'OBJECT'} +{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9uppercaseE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18messagesIcE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18messagesIwE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18numpunctIcE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18numpunctIwE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', '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'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'type': 'FUNC'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'} +{'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'type': 'FUNC'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', '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': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_', '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': '_ZSt15get_new_handlerv', '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': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZSt18uncaught_exceptionv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZSt19uncaught_exceptionsv', 'type': 'FUNC'} +{'size': 1, 'is_defined': True, 'name': '_ZSt7nothrow', 'type': 'OBJECT'} +{'is_defined': False, 'name': '_ZSt9terminatev', 'type': 'FUNC'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 120, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt12experimental19bad_optional_accessE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110__time_getE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110__time_putE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110ctype_baseE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__110istrstreamE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110money_baseE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__110ostrstreamE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_getIcEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_getIwEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_putIcEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_putIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__111regex_errorE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112bad_weak_ptrE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__112codecvt_baseE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112future_errorE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112strstreambufE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112system_errorE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__113messages_baseE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__num_get_baseE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__num_put_baseE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__shared_countE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIwEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114error_categoryE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__assoc_sub_stateE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__119__shared_weak_countE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__15ctypeIcEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__15ctypeIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__16locale5facetE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__17collateIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__17collateIwEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__18__c_nodeE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18ios_base7failureE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__18ios_baseE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18messagesIcEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18messagesIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18numpunctIcEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18numpunctIwEE', 'type': 'OBJECT'} +{'size': 72, 'is_defined': True, 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 72, 'is_defined': True, 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_getIcEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_getIwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_putIcEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_putIwEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19strstreamE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__19time_baseE', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt11logic_error', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTISt12bad_any_cast', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt12length_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt12out_of_range', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt13runtime_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt14overflow_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt16invalid_argument', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTISt16nested_exception', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTISt18bad_variant_access', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTISt19bad_optional_access', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt8bad_cast', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt9bad_alloc', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTISt9exception', 'type': 'OBJECT'} +{'size': 50, 'is_defined': True, 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110__time_getE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110__time_putE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110ctype_baseE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110istrstreamE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110money_baseE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110ostrstreamE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_getIcEE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_getIwEE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_putIcEE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_putIwEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__111regex_errorE', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112bad_weak_ptrE', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112codecvt_baseE', 'type': 'OBJECT'} +{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'type': 'OBJECT'} +{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112future_errorE', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112strstreambufE', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112system_errorE', 'type': 'OBJECT'} +{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTSNSt3__113messages_baseE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__num_get_baseE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__num_put_baseE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__shared_countE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 43, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 43, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIcEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIwEE', 'type': 'OBJECT'} +{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114error_categoryE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'} +{'size': 33, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'} +{'size': 33, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'} +{'size': 49, 'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 49, 'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIcEE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIwEE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'} +{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'} +{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'type': 'OBJECT'} +{'size': 30, 'is_defined': True, 'name': '_ZTSNSt3__119__shared_weak_countE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'} +{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__15ctypeIcEE', 'type': 'OBJECT'} +{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__15ctypeIwEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__16locale5facetE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 20, 'is_defined': True, 'name': '_ZTSNSt3__17collateIcEE', 'type': 'OBJECT'} +{'size': 20, 'is_defined': True, 'name': '_ZTSNSt3__17collateIwEE', 'type': 'OBJECT'} +{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__18__c_nodeE', 'type': 'OBJECT'} +{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__18ios_base7failureE', 'type': 'OBJECT'} +{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__18ios_baseE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18messagesIcEE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18messagesIwEE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18numpunctIcEE', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18numpunctIwEE', 'type': 'OBJECT'} +{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_getIcEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_getIwEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_putIcEE', 'type': 'OBJECT'} +{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_putIwEE', 'type': 'OBJECT'} +{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 19, 'is_defined': True, 'name': '_ZTSNSt3__19strstreamE', 'type': 'OBJECT'} +{'size': 19, 'is_defined': True, 'name': '_ZTSNSt3__19time_baseE', 'type': 'OBJECT'} +{'size': 17, 'is_defined': True, 'name': '_ZTSSt12bad_any_cast', 'type': 'OBJECT'} +{'size': 21, 'is_defined': True, 'name': '_ZTSSt16nested_exception', 'type': 'OBJECT'} +{'size': 23, 'is_defined': True, 'name': '_ZTSSt18bad_variant_access', 'type': 'OBJECT'} +{'size': 24, 'is_defined': True, 'name': '_ZTSSt19bad_optional_access', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTTNSt3__110istrstreamE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTTNSt3__110ostrstreamE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTTNSt3__19strstreamE', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__110istrstreamE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__110ostrstreamE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__111regex_errorE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112bad_weak_ptrE', 'type': 'OBJECT'} +{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'type': 'OBJECT'} +{'size': 136, 'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112future_errorE', 'type': 'OBJECT'} +{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__112strstreambufE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112system_errorE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__114__shared_countE', 'type': 'OBJECT'} +{'size': 120, 'is_defined': True, 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIcEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIwEE', 'type': 'OBJECT'} +{'size': 72, 'is_defined': True, 'name': '_ZTVNSt3__114error_categoryE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'} +{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIcEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIwEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'} +{'size': 224, 'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 224, 'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'} +{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__119__shared_weak_countE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'} +{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__15ctypeIcEE', 'type': 'OBJECT'} +{'size': 136, 'is_defined': True, 'name': '_ZTVNSt3__15ctypeIwEE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__16locale5facetE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__17collateIcEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__17collateIwEE', 'type': 'OBJECT'} +{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18__c_nodeE', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__18ios_base7failureE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__18ios_baseE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18messagesIcEE', 'type': 'OBJECT'} +{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18messagesIwEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__18numpunctIcEE', 'type': 'OBJECT'} +{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__18numpunctIwEE', 'type': 'OBJECT'} +{'size': 168, 'is_defined': True, 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 168, 'is_defined': True, 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'} +{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'} +{'size': 120, 'is_defined': True, 'name': '_ZTVNSt3__19strstreamE', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt11logic_error', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVSt12bad_any_cast', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt12length_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt12out_of_range', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt13runtime_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt14overflow_error', 'type': 'OBJECT'} +{'size': 0, 'is_defined': False, 'name': '_ZTVSt16invalid_argument', 'type': 'OBJECT'} +{'size': 32, 'is_defined': True, 'name': '_ZTVSt16nested_exception', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVSt18bad_variant_access', 'type': 'OBJECT'} +{'size': 40, 'is_defined': True, 'name': '_ZTVSt19bad_optional_access', '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'} +{'is_defined': True, 'name': '_ZdaPv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdaPvRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdaPvSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdaPvm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdaPvmSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPv', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPvRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPvSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPvm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZdlPvmSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_Znam', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnamRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnamSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_Znwm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnwmRKSt9nothrow_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnwmSt11align_val_t', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZnwmSt11align_val_tRKSt9nothrow_t', '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_exception', 'type': 'FUNC'} diff --git a/lib/abi/CHANGELOG.TXT b/lib/abi/CHANGELOG.TXT index b8a0cbebefd8a..c1237338fbb8a 100644 --- a/lib/abi/CHANGELOG.TXT +++ b/lib/abi/CHANGELOG.TXT @@ -13,6 +13,24 @@ Afterwards the ABI list should be updated to include the new changes. New entries should be added directly below the "Version" header. ----------- +Version 7.0 +----------- + +* r333467 - Fix embarrasing typo in uncaught_exceptions. + + This bug caused __uncaught_exception to be ODR used instead of + __uncaught_exceptions. This change is non-ABI breaking because the symbols + for std::uncaught_exception and std::uncaught_exceptions haven't changed, + and because users shouldn't be depending directly on libc++ exporting + __uncaught_exception/__uncaught_exceptions. + + All Platforms + ---------------- + SYMBOL REMOVED: __cxa_uncaught_exception + Symbol added: __cxa_uncaught_exceptions + + +----------- Version 5.0 ----------- diff --git a/lib/abi/CMakeLists.txt b/lib/abi/CMakeLists.txt index c207674258a1a..e42e96173f536 100644 --- a/lib/abi/CMakeLists.txt +++ b/lib/abi/CMakeLists.txt @@ -1,36 +1,26 @@ if (DEFINED TARGET_TRIPLE) - # Ignore the minor and patchlevel versions of the darwin + # Ignore the major, minor, and patchlevel versions of the darwin # target. - string(REGEX REPLACE "darwin16\\.[0-9]\\.[0-9]" "darwin16" + string(REGEX REPLACE "darwin([0-9]+)\\.([0-9]+)\\.([0-9]+)" "darwin" GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}") endif() # Detect if we are building in the same configuration used to generate # the abilist files. -if (DEFINED GENERIC_TARGET_TRIPLE - AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist" +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_ABI_VERSION EQUAL "1") - set(LIBCXX_HAS_ABILIST_CONFIGURATION 1 CACHE INTERNAL "") -else() - if (NOT DEFINED LIBCXX_HAS_ABILIST_CONFIGURATION) - message(STATUS "libc++ configuration differs from the abilist configuration. " - "check-cxx-abilist target is not supported") - endif() - set(LIBCXX_HAS_ABILIST_CONFIGURATION 0 CACHE INTERNAL "") -endif() - - -if (LIBCXX_HAS_ABILIST_CONFIGURATION) - set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist") - set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py") + AND NOT LIBCXX_ABI_UNSTABLE) 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...") +else() + message(STATUS "there is no pre-generated ABI list for the requested libc++ configuration. " + "check-cxx-abilist target is not supported") endif() diff --git a/lib/abi/x86_64-apple-darwin.v1.abilist b/lib/abi/x86_64-apple-darwin.v1.abilist new file mode 100644 index 0000000000000..1be950f2e5402 --- /dev/null +++ b/lib/abi/x86_64-apple-darwin.v1.abilist @@ -0,0 +1,2378 @@ +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'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': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'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_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__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__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__124__libcpp_debug_exception4whatEv'} +{'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__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__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': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'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': 'OBJECT', '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': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev'} +{'type': 'OBJECT', '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': 'FUNC', '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_cEPv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0} +{'type': 'FUNC', '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__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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0} +{'type': 'FUNC', '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_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__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_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__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__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__118get_pointer_safetyEv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD2Ev'} +{'type': 'FUNC', '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__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0} +{'type': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev'} +{'type': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0} +{'type': 'FUNC', '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': 'OBJECT', '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': 'FUNC', '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': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'} +{'type': 'OBJECT', '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': 'FUNC', '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': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'} +{'type': 'OBJECT', '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_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__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': 'U', 'is_defined': False, 'name': '__ZTIDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__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__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__119__shared_weak_countE', '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__124__libcpp_debug_exceptionE', '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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTIPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTId'} +{'type': 'I', 'is_defined': True, 'name': '__ZTId'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_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__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__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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTSPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSy'} +{'type': 'OBJECT', '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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__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_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_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__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__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__119__shared_weak_countE', '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__124__libcpp_debug_exceptionE', '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__17codecvtIDic11__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': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'} +{'type': 'FUNC', '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': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'} +{'type': 'I', 'is_defined': True, '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': 'I', 'is_defined': True, 'name': '___cxa_deleted_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exceptions'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'} +{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'} +{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'} +{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'} +{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'} diff --git a/lib/abi/x86_64-apple-darwin.v2.abilist b/lib/abi/x86_64-apple-darwin.v2.abilist new file mode 100644 index 0000000000000..05255a657056f --- /dev/null +++ b/lib/abi/x86_64-apple-darwin.v2.abilist @@ -0,0 +1,2418 @@ +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'} +{'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': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210__time_put8__do_putEPcRS1_PK2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210__time_put8__do_putEPwRS1_PK2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210error_code7messageEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb0EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIcLb1EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb0EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__210moneypunctIwLb1EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db15__decrementableEPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db15__find_c_from_iEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db15__subscriptableEPKvl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db17__dereferenceableEPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db17__find_c_and_lockEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db22__less_than_comparableEPKvS2_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db8__find_cEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__211__libcpp_db9__addableEPKvl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212bad_weak_ptr4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIcE10do_tolowerEPcPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIcE10do_tolowerEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIcE10do_toupperEPcPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIcE10do_toupperEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE10do_scan_isEjPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE10do_tolowerEPwPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE10do_tolowerEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE10do_toupperEPwPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE10do_toupperEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE11do_scan_notEjPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE5do_isEPKwS3_Pj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE5do_isEjw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE8do_widenEPKcS3_Pw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE8do_widenEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE9do_narrowEPKwS3_cPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212ctype_bynameIwE9do_narrowEwc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__212strstreambuf6pcountEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__213random_device7entropyEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214collate_bynameIcE10do_compareEPKcS3_S3_S3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214collate_bynameIcE12do_transformEPKcS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214collate_bynameIwE10do_compareEPKwS3_S3_S3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214collate_bynameIwE12do_transformEPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214error_category10equivalentERKNS_10error_codeEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214error_category10equivalentEiRKNS_15error_conditionE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__214error_category23default_error_conditionEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215basic_streambufIcNS_11char_traitsIcEEE6getlocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215basic_streambufIwNS_11char_traitsIwEEE6getlocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__215error_condition7messageEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217bad_function_call4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb0EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIcLb1EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb0EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE13do_neg_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE13do_pos_formatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE14do_curr_symbolEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE14do_frac_digitsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE16do_negative_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE16do_positive_signEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__217moneypunct_bynameIwLb1EE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__218__time_get_storageIcE15__do_date_orderEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__218__time_get_storageIwE15__do_date_orderEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__219__shared_weak_count13__get_deleterERKSt9type_info'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE3__XEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE3__cEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE3__rEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE3__xEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE7__am_pmEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE7__weeksEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIcE8__monthsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE3__XEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE3__cEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE3__rEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE3__xEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE7__am_pmEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE7__weeksEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__time_get_c_storageIwE8__monthsEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__220__vector_base_commonILb1EE20__throw_out_of_rangeEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__221__basic_string_commonILb1EE20__throw_out_of_rangeEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__223__match_any_but_newlineIcE6__execERNS_7__stateIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__223__match_any_but_newlineIwE6__execERNS_7__stateIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__224__libcpp_debug_exception4whatEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE10do_tolowerEPcPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE10do_tolowerEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE10do_toupperEPcPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE10do_toupperEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE8do_widenEPKcS3_Pc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE8do_widenEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE9do_narrowEPKcS3_cPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIcE9do_narrowEcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE10do_scan_isEjPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE10do_tolowerEPwPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE10do_tolowerEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE10do_toupperEPwPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE10do_toupperEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE11do_scan_notEjPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE5do_isEPKwS3_Pj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE5do_isEjw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE8do_widenEPKcS3_Pw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE8do_widenEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE9do_narrowEPKwS3_cPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__25ctypeIwE9do_narrowEwc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__26locale4nameEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__26locale9has_facetERNS0_2idE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__26locale9use_facetERNS0_2idE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__26localeeqERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE11do_encodingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE13do_max_lengthEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE16do_always_noconvEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIcE10do_compareEPKcS3_S3_S3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIcE12do_transformEPKcS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIcE7do_hashEPKcS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIwE10do_compareEPKwS3_S3_S3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIwE12do_transformEPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27collateIwE7do_hashEPKwS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28ios_base6getlocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIcE8do_closeEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28messagesIwE8do_closeEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIcE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIcE11do_truenameEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIcE12do_falsenameEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIcE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIcE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIwE11do_groupingEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIwE11do_truenameEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIwE12do_falsenameEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIwE16do_decimal_pointEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28numpunctIwE16do_thousands_sepEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29__num_getIcE10__do_widenERNS_8ios_baseEPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29__num_getIcE12__do_widen_pERNS_8ios_baseEPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29__num_getIwE10__do_widenERNS_8ios_baseEPw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29__num_getIwE12__do_widen_pERNS_8ios_baseEPc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__212basic_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__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'} +{'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__212basic_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__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'} +{'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': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getC2EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_getD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putC2EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210__time_putD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210adopt_lockE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5alnumE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5alphaE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5blankE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5cntrlE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5digitE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5graphE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5lowerE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5printE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5punctE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5spaceE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base5upperE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210ctype_base6xdigitE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210defer_lockE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210istrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210istrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210istrstreamD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIcLb0EE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIcLb0EE4intlE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIcLb1EE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIcLb1EE4intlE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIwLb0EE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIwLb0EE4intlE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIwLb1EE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__210moneypunctIwLb1EE4intlE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210ostrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210ostrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210ostrstreamD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__210to_wstringEy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__call_onceERVmPvPFvS2_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db10__insert_cEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db10__insert_iEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db11__insert_icEPvPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db15__iterator_copyEPvPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db16__invalidate_allEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db4swapEPvS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db9__erase_cEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_db9__erase_iEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_dbC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_dbC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_dbD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__libcpp_dbD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__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__211__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211__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__211regex_errorC1ENS_15regex_constants10error_typeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211regex_errorC2ENS_15regex_constants10error_typeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211regex_errorD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211regex_errorD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211regex_errorD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutex4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutex6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutex8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutexC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutexC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutexD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__211timed_mutexD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__211try_to_lockE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__do_nothingEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__get_sp_mutEPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__next_primeEm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212__rs_default4__c_E', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultC1ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultC2ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212__rs_defaultclEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212bad_weak_ptrD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212bad_weak_ptrD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212bad_weak_ptrD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIcED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212ctype_bynameIwED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212future_errorC1ENS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212future_errorC2ENS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212future_errorD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212future_errorD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212future_errorD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_1E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_2E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_3E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_4E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_5E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_6E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_7E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_8E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders2_9E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__212placeholders3_10E', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf3strEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf4swapERS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf6__initEPclS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf6freezeEb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf7seekoffExNS_8ios_base7seekdirEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf7seekposENS_4fposI11__mbstate_tEEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf8overflowEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf9pbackfailEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambuf9underflowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPFPvmEPFvS1_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPKal'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPKcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPKhl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPalS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPclS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1EPhlS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC1El'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPFPvmEPFvS1_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPKal'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPKcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPKhl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPalS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPclS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2EPhlS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufC2El'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212strstreambufD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1ENS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1ENS_10error_codeEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1EiRKNS_14error_categoryE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1EiRKNS_14error_categoryEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2ENS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2ENS_10error_codeEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2EiRKNS_14error_categoryE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2EiRKNS_14error_categoryEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__212system_errorD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__213allocator_argE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getEPclc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getERc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE3getEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE4peekEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE4readEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE4syncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE5tellgEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE5ungetEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE7putbackEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERs'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIcNS_11char_traitsIcEEErsERy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getERw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE3getEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE4peekEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE4readEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE4syncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE5tellgEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE5ungetEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE7putbackEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERs'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_istreamIwNS_11char_traitsIwEEErsERy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEs'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE3putEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE5flushEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEPKv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEs'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEt'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213basic_ostreamIwNS_11char_traitsIwEEElsEy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213random_deviceD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213random_deviceD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213random_deviceclEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213shared_futureIvED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213shared_futureIvED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__213shared_futureIvEaSERKS1_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__get_const_dbEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__num_get_base10__get_baseERNS_8ios_baseE'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__214__num_get_base5__srcE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__num_put_base12__format_intEPcPKcbj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__num_put_base14__format_floatEPcPKcj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__shared_countD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__shared_countD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214__shared_countD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214basic_iostreamIcNS_11char_traitsIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDic11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDic11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDic11__mbstate_tED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDsc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDsc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIDsc11__mbstate_tED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIcc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIcc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIcc11__mbstate_tED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIwc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIwc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214codecvt_bynameIwc11__mbstate_tED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIcED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214collate_bynameIwED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214error_categoryD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214error_categoryD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__214error_categoryD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__get_classnameEPKcb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_structC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_structC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_structD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215__thread_structD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE4syncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5sputcEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE5uflowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6snextcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE8in_availEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE8overflowEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEE9underflowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE4syncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5sputcEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE5uflowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6snextcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE8in_availEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE8overflowEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEE9underflowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215future_categoryEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcE6__initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIcED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwE6__initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215numpunct_bynameIwED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutex4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutex6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutex8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutexC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutexC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutexD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215recursive_mutexD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__215system_categoryEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm16EED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm16EED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm16EED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm32EED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm32EED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216__narrow_to_utf8ILm32EED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__216generic_categoryEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state12__make_readyEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state13set_exceptionESt13exception_ptr'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state16__on_zero_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state24set_value_at_thread_exitEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state4copyEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state4waitEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state9__executeEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__assoc_sub_state9set_valueEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm16EED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm16EED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm16EED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm32EED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm32EED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217__widen_from_utf8ILm32EED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217bad_function_callD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217bad_function_callD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217bad_function_callD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217declare_reachableEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217iostream_categoryEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217moneypunct_bynameIcLb0EE4initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217moneypunct_bynameIcLb1EE4initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217moneypunct_bynameIwLb0EE4initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__217moneypunct_bynameIwLb1EE4initEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcE4initERKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcEC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcEC2EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwE4initERKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwEC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwEC2EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variable10notify_allEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variable10notify_oneEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variable4waitERNS_11unique_lockINS_5mutexEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variableD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218condition_variableD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex11lock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex13unlock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex15try_lock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutex8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutexC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__218shared_timed_mutexC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base11lock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base13unlock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base15try_lock_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_base8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_baseC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_mutex_baseC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_weak_count14__release_weakEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_weak_count4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_weak_countD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_weak_countD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__shared_weak_countD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__219__start_std_streamsE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219__thread_local_dataEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__219declare_no_pointersEPcm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__219piecewise_constructE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__220__get_collation_nameEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__220__throw_system_errorEiPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221__throw_runtime_errorEPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221__undeclare_reachableEPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutex4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutex6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutex8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutexC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutexC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutexD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221recursive_timed_mutexD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__221undeclare_no_pointersEPcm'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__223__libcpp_debug_functionE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC1ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC2ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__224__libcpp_debug_exceptionD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__225notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__227__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__229__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__229__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__23cinE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__24cerrE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__24clogE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__24coutE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__24stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__24wcinE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25alignEmmRPvRm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcE13classic_tableEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcEC1EPKjbm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcEC2EPKjbm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIcED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__25ctypeIwE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25ctypeIwED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25mutex4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25mutex6unlockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25mutex8try_lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25mutexD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25mutexD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__25stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__25wcerrE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__25wclogE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__25wcoutE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26chrono12steady_clock3nowEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26chrono12steady_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26chrono12system_clock11from_time_tEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26chrono12system_clock3nowEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26chrono12system_clock9is_steadyE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26futureIvE3getEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26futureIvEC1EPNS_17__assoc_sub_stateE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26futureIvEC2EPNS_17__assoc_sub_stateE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26futureIvED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26futureIvED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26gslice6__initEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale14__install_ctorERKS0_PNS0_5facetEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale2id5__getEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale2id6__initEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale2id9__next_idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale3allE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale4noneE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale4timeE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale5ctypeE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale5facet16__on_zero_sharedEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale5facetD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale5facetD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale5facetD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale6globalERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale7classicEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale7collateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale7numericE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26locale8__globalEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale8messagesE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__26locale8monetaryE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1ERKS0_PKci'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1ERKS0_S2_i'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2EPKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2ERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2ERKS0_PKci'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2ERKS0_S2_i'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26localeaSERKS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26thread20hardware_concurrencyEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26thread4joinEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26thread6detachEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26threadD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__26threadD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDic11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDic11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDic11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDic11__mbstate_tED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDsc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDsc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDsc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIDsc11__mbstate_tED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27codecvtIcc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIcc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIcc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIcc11__mbstate_tED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tEC1EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tEC1Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tEC2EPKcm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tEC2Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27codecvtIwc11__mbstate_tED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27collateIcE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIcED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27collateIwE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27collateIwED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvE10get_futureEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvE13set_exceptionESt13exception_ptr'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvE24set_value_at_thread_exitEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvE28set_exception_at_thread_exitESt13exception_ptr'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvE9set_valueEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvEC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvEC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__27promiseIvED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__c_node5__addEPNS_8__i_nodeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__c_nodeD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__c_nodeD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__c_nodeD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__get_dbEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__i_nodeD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__i_nodeD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__rs_getEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__sp_mut4lockEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28__sp_mut6unlockEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base10floatfieldE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base10scientificE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base11adjustfieldE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base15sync_with_stdioEb'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base16__call_callbacksENS0_5eventE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base17register_callbackEPFvNS0_5eventERS0_iEi'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base2inE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base34__set_failbit_and_consider_rethrowEv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3appE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3ateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3decE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3hexE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3octE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base3outE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4InitC1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4InitC2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4InitD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4InitD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4initEPv'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base4leftE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4moveERS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base4swapERS0_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base5clearEj'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base5fixedE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base5imbueERKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base5iwordEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base5pwordEi'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base5rightE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base5truncE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base6badbitE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base6binaryE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base6eofbitE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base6skipwsE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base6xallocEv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7copyfmtERKS0_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failbitE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureC1EPKcRKNS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureC2EPKcRKNS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_base7failureD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base7goodbitE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base7showposE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base7unitbufE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base8internalE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base8showbaseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base9__xindex_E', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base9basefieldE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base9boolalphaE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base9showpointE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28ios_base9uppercaseE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_baseD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_baseD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28ios_baseD2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28messagesIcE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28messagesIwE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcEC1Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcEC2Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIcED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwEC1Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwEC2Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28numpunctIwED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28valarrayImE6resizeEmm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28valarrayImEC1Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28valarrayImEC2Em'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28valarrayImED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__28valarrayImED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIcE17__stage2_int_prepERNS_8ios_baseERc'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_PKw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIwE17__stage2_int_prepERNS_8ios_baseERw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIcNS_11char_traitsIcEEED2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29basic_iosIwNS_11char_traitsIwEEED2Ev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29strstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29strstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29strstreamD2Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEd'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEe'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEf'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEi'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEj'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEl'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEx'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__29to_stringEy'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__2plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'} +{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'} +{'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': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'} +{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__210istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__210ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__214basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__214basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__29strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__29strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__29strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'} +{'type': 'OBJECT', '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__210__time_getE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210__time_putE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210ctype_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210istrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210money_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210moneypunctIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210moneypunctIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210moneypunctIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210moneypunctIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__210ostrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__211__money_getIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__211__money_getIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__211__money_putIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__211__money_putIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__211regex_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212bad_weak_ptrE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212codecvt_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212ctype_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212ctype_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212future_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212strstreambufE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__212system_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__213basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__213basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__213basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__213basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__213messages_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__codecvt_utf8IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__codecvt_utf8IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__codecvt_utf8IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__num_get_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__num_put_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214__shared_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214codecvt_bynameIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214codecvt_bynameIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214codecvt_bynameIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214codecvt_bynameIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214collate_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214collate_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__214error_categoryE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IDiLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IDiLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IDsLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IDsLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215__codecvt_utf16IwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215messages_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215messages_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215numpunct_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215numpunct_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__215time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__216__narrow_to_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__216__narrow_to_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217__assoc_sub_stateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217__widen_from_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217__widen_from_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217bad_function_callE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217moneypunct_bynameIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217moneypunct_bynameIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217moneypunct_bynameIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__217moneypunct_bynameIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__218__time_get_storageIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__218__time_get_storageIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__219__shared_weak_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__220__codecvt_utf8_utf16IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__220__codecvt_utf8_utf16IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__220__codecvt_utf8_utf16IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__220__time_get_c_storageIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__220__time_get_c_storageIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__224__libcpp_debug_exceptionE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__25ctypeIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__25ctypeIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__26locale5facetE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27codecvtIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27codecvtIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27codecvtIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27codecvtIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27collateIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27collateIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28__c_nodeE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28ios_base7failureE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28ios_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28messagesIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28messagesIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28numpunctIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28numpunctIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29__num_getIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29__num_getIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29__num_putIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29__num_putIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29basic_iosIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29basic_iosIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29strstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__29time_baseE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTId'} +{'type': 'I', 'is_defined': True, 'name': '__ZTId'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTIy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTIy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__210__time_getE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210__time_putE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210ctype_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210istrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210money_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210moneypunctIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210moneypunctIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210moneypunctIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210moneypunctIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__210ostrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__211__money_getIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__211__money_getIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__211__money_putIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__211__money_putIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__211regex_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212bad_weak_ptrE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212codecvt_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212ctype_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212ctype_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212future_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212strstreambufE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__212system_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__213basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__213basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__213basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__213messages_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__codecvt_utf8IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__codecvt_utf8IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__codecvt_utf8IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__num_get_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__num_put_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214__shared_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214codecvt_bynameIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214codecvt_bynameIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214codecvt_bynameIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214codecvt_bynameIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214collate_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214collate_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__214error_categoryE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IDiLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IDiLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IDsLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IDsLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215__codecvt_utf16IwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215messages_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215messages_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215numpunct_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215numpunct_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__215time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__216__narrow_to_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__216__narrow_to_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217__assoc_sub_stateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217__widen_from_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217__widen_from_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217bad_function_callE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217moneypunct_bynameIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217moneypunct_bynameIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217moneypunct_bynameIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__217moneypunct_bynameIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__218__time_get_storageIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__218__time_get_storageIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__219__shared_weak_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__220__codecvt_utf8_utf16IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__220__codecvt_utf8_utf16IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__220__codecvt_utf8_utf16IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__220__time_get_c_storageIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__220__time_get_c_storageIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__224__libcpp_debug_exceptionE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__25ctypeIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__25ctypeIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__26locale5facetE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27codecvtIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27codecvtIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27codecvtIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27codecvtIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27collateIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27collateIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28__c_nodeE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28ios_base7failureE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28ios_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28messagesIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28messagesIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28numpunctIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28numpunctIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29__num_getIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29__num_getIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29__num_putIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29__num_putIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29basic_iosIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29basic_iosIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29strstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__29time_baseE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSa'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSa'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSb'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSb'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSd'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSd'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSe'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSe'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSf'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSf'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSh'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSh'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSi'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSi'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSj'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSj'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSl'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSl'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSm'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSm'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSs'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSs'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSt'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSt'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSv'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSv'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSw'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSw'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSx'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSx'} +{'type': 'U', 'is_defined': False, 'name': '__ZTSy'} +{'type': 'I', 'is_defined': True, 'name': '__ZTSy'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__210istrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__210ostrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__213basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__213basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__213basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__214basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__29strstreamE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'} +{'type': 'OBJECT', '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__210istrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__210moneypunctIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__210moneypunctIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__210moneypunctIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__210moneypunctIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__210ostrstreamE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__211regex_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212bad_weak_ptrE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212ctype_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212ctype_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212future_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212strstreambufE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__212system_errorE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__213basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__213basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__213basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214__codecvt_utf8IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214__codecvt_utf8IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214__codecvt_utf8IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214__shared_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214codecvt_bynameIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214codecvt_bynameIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214codecvt_bynameIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214codecvt_bynameIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214collate_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214collate_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__214error_categoryE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IDiLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IDiLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IDsLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IDsLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215__codecvt_utf16IwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215messages_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215messages_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215numpunct_bynameIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215numpunct_bynameIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__215time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__216__narrow_to_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__216__narrow_to_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217__assoc_sub_stateE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217__widen_from_utf8ILm16EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217__widen_from_utf8ILm32EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217bad_function_callE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217moneypunct_bynameIcLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217moneypunct_bynameIcLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217moneypunct_bynameIwLb0EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__217moneypunct_bynameIwLb1EEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__219__shared_weak_countE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__220__codecvt_utf8_utf16IDiEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__220__codecvt_utf8_utf16IDsEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__220__codecvt_utf8_utf16IwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__224__libcpp_debug_exceptionE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__25ctypeIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__25ctypeIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__26locale5facetE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27codecvtIDic11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27codecvtIDsc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27codecvtIcc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27codecvtIwc11__mbstate_tEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27collateIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27collateIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28__c_nodeE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28ios_base7failureE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28ios_baseE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28messagesIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28messagesIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28numpunctIcEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28numpunctIwEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29basic_iosIcNS_11char_traitsIcEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29basic_iosIwNS_11char_traitsIwEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__29strstreamE', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'} +{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'} +{'type': 'OBJECT', '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': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'} +{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'} +{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__214basic_iostreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__214basic_iostreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__29strstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__29strstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__210istrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__210istrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__210ostrstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__210ostrstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_istreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_istreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_istreamIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_istreamIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_ostreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__213basic_ostreamIwNS_11char_traitsIwEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__214basic_iostreamIcNS_11char_traitsIcEEED0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__214basic_iostreamIcNS_11char_traitsIcEEED1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__29strstreamD0Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__29strstreamD1Ev'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'} +{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'} +{'type': 'I', 'is_defined': True, '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': 'I', 'is_defined': True, 'name': '___cxa_deleted_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exceptions'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'} +{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'} +{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'} +{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'} +{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'} +{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'} +{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'} diff --git a/lib/abi/x86_64-unknown-linux-gnu.v1.abilist b/lib/abi/x86_64-unknown-linux-gnu.v1.abilist new file mode 100644 index 0000000000000..c883a593ee8ef --- /dev/null +++ b/lib/abi/x86_64-unknown-linux-gnu.v1.abilist @@ -0,0 +1,1883 @@ +{'name': '_ZNKSt11logic_error4whatEv', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNKSt12bad_any_cast4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt13runtime_error4whatEv', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNKSt16nested_exception14rethrow_nestedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt18bad_variant_access4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt19bad_optional_access4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110error_code7messageEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db8__find_cEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112bad_weak_ptr4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__112strstreambuf6pcountEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__113random_device7entropyEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__114error_category23default_error_conditionEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__115error_condition7messageEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__124__libcpp_debug_exception4whatEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE10do_toupperEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE8do_widenEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE10do_toupperEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE5do_isEtw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE8do_widenEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__16locale4nameEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__16locale9has_facetERNS0_2idE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__16locale9use_facetERNS0_2idE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__16localeeqERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18ios_base6getlocEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIcE8do_closeEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18messagesIwE8do_closeEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIcE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIcE11do_truenameEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIwE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIwE11do_truenameEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC1ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorC2ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt11logic_errorD2Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt11logic_erroraSERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt12length_errorD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt12out_of_rangeD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt13exception_ptrC1ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13exception_ptrC2ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13exception_ptrD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13exception_ptrD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13exception_ptraSERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC1ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorC2ERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_errorD2Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt13runtime_erroraSERKS_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt14overflow_errorD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt16invalid_argumentD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt16nested_exceptionC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt16nested_exceptionC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt16nested_exceptionD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt16nested_exceptionD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt16nested_exceptionD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt19bad_optional_accessD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt19bad_optional_accessD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt19bad_optional_accessD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_getD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110__time_putD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110adopt_lockE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110ctype_base5alnumE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5alphaE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5blankE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5cntrlE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5digitE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5graphE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5lowerE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5printE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5punctE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5spaceE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base5upperE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110ctype_base6xdigitE', 'is_defined': True, 'type': 'OBJECT', 'size': 2} +{'name': '_ZNSt3__110defer_lockE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110istrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110istrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110istrstreamD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__110ostrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110ostrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110ostrstreamD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__110to_wstringEy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db10__insert_cEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db10__insert_iEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db4swapEPvS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db9__erase_cEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_db9__erase_iEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_dbC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_dbC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_dbD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__libcpp_dbD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111regex_errorD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111regex_errorD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111regex_errorD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111timed_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__111try_to_lockE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112__do_nothingEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__get_sp_mutEPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__next_primeEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_default4__c_E', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__112__rs_defaultC1ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultC2ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112__rs_defaultclEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'is_defined': True, 'type': 'OBJECT', 'size': 8} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'is_defined': True, 'type': 'OBJECT', 'size': 8} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112ctype_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112future_errorC1ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112future_errorC2ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112future_errorD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112future_errorD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112future_errorD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112placeholders2_1E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_2E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_3E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_4E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_5E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_6E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_7E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_8E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders2_9E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112placeholders3_10E', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__112strstreambuf3strEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf4swapERS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf6__initEPclS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf6freezeEb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf8overflowEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf9pbackfailEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambuf9underflowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPKal', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPKcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPKhl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPalS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPclS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1EPhlS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC1El', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPKal', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPKcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPKhl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPalS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPclS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2EPhlS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufC2El', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112strstreambufD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__112system_errorD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113allocator_argE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113random_deviceD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113random_deviceD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113random_deviceclEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113shared_futureIvED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113shared_futureIvED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__get_const_dbEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__num_get_base5__srcE', 'is_defined': True, 'type': 'OBJECT', 'size': 33} +{'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__shared_count12__add_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__shared_count16__release_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__shared_countD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__shared_countD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114__shared_countD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114collate_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114error_categoryC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114error_categoryD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114error_categoryD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__114error_categoryD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__get_classnameEPKcb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_structC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_structC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_structD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115__thread_structD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115future_categoryEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115numpunct_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115recursive_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__115system_categoryEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__116generic_categoryEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state4copyEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state4waitEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state9__executeEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__assoc_sub_state9set_valueEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117declare_reachableEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117iostream_categoryEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcEC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcEC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwEC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwEC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variable10notify_allEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variable10notify_oneEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variableD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118condition_variableD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118get_pointer_safetyEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__118shared_timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_base8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_baseC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_mutex_baseC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_count10__add_weakEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_count14__release_weakEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_count4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_countD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_countD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__shared_weak_countD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119__start_std_streamsE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__119__thread_local_dataEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119declare_no_pointersEPcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__119piecewise_constructE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__120__get_collation_nameEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__120__throw_system_errorEiPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121__undeclare_reachableEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121recursive_timed_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__121undeclare_no_pointersEPcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__123__libcpp_debug_functionE', 'is_defined': True, 'type': 'OBJECT', 'size': 8} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__124__libcpp_debug_exceptionD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__13cinE', 'is_defined': True, 'type': 'OBJECT', 'size': 168} +{'name': '_ZNSt3__14cerrE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__14clogE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__14coutE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__14wcinE', 'is_defined': True, 'type': 'OBJECT', 'size': 168} +{'name': '_ZNSt3__15alignEmmRPvRm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcE13classic_tableEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__15ctypeIcEC1EPKtbm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcEC2EPKtbm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIwE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__15ctypeIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15ctypeIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15mutex4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15mutexD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15mutexD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__15wcerrE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__15wclogE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__15wcoutE', 'is_defined': True, 'type': 'OBJECT', 'size': 160} +{'name': '_ZNSt3__16__clocEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16chrono12steady_clock3nowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__16chrono12system_clock11from_time_tEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16chrono12system_clock3nowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16futureIvE3getEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16futureIvED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16futureIvED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16gslice6__initEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale2id5__getEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale2id6__initEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale2id9__next_idE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale3allE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale4noneE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale4timeE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale5ctypeE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale5facetD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale5facetD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale5facetD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale6globalERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale7classicEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale7collateE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale7numericE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale8__globalEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16locale8messagesE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16locale8monetaryE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__16localeC1EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1ERKS0_PKci', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1ERKS0_S2_i', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2EPKc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2ERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2ERKS0_PKci', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2ERKS0_S2_i', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16localeaSERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16thread20hardware_concurrencyEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16thread4joinEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16thread6detachEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16threadD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__16threadD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIcE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17collateIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIwE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17collateIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17collateIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__17promiseIvE10get_futureEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvE9set_valueEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvEC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvEC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__17promiseIvED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__c_nodeD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__c_nodeD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__c_nodeD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__get_dbEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__i_nodeD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__i_nodeD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__rs_getEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__sp_mut4lockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18__sp_mut6unlockEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base10floatfieldE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base10scientificE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base11adjustfieldE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base15sync_with_stdioEb', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base2inE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base3appE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base3ateE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base3decE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base3hexE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base3octE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base3outE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base4InitC1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4InitC2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4InitD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4InitD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4initEPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4leftE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base4moveERS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base4swapERS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base5clearEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base5fixedE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base5iwordEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base5pwordEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base5rightE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base5truncE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base6badbitE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base6binaryE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base6eofbitE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base6skipwsE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base6xallocEv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7copyfmtERKS0_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failbitE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7failureD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_base7goodbitE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base7showposE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base7unitbufE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base8internalE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base8showbaseE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base9__xindex_E', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base9basefieldE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base9boolalphaE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base9showpointE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_base9uppercaseE', 'is_defined': True, 'type': 'OBJECT', 'size': 4} +{'name': '_ZNSt3__18ios_baseD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_baseD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18ios_baseD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18messagesIcE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18messagesIwE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18numpunctIcE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18numpunctIcEC1Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIcEC2Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIcED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIcED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIcED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIwE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18numpunctIwEC1Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIwEC2Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIwED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIwED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18numpunctIwED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__18valarrayImE6resizeEmm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18valarrayImEC1Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18valarrayImEC2Em', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18valarrayImED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__18valarrayImED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZNSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19strstreamD2Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEd', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEe', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEf', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEi', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEj', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEl', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEx', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__19to_stringEy', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZNSt8bad_castC1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt8bad_castD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt8bad_castD2Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt9bad_allocC1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt9bad_allocD1Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZNSt9exceptionD2Ev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZSt15get_new_handlerv', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZSt17__throw_bad_allocv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt17current_exceptionv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt17rethrow_exceptionSt13exception_ptr', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt18uncaught_exceptionv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt19uncaught_exceptionsv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZSt7nothrow', 'is_defined': True, 'type': 'OBJECT', 'size': 1} +{'name': '_ZSt9terminatev', 'is_defined': False, 'type': 'FUNC'} +{'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 120} +{'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt12experimental19bad_optional_accessE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__110__time_getE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__110__time_putE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__110ctype_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__110istrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__110money_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__110ostrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__111__money_getIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__111__money_getIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__111__money_putIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__111__money_putIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__111regex_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112bad_weak_ptrE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112codecvt_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__112ctype_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112ctype_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112future_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112strstreambufE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__112system_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__113messages_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114__num_get_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__114__num_put_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__114__shared_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114collate_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114collate_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__114error_categoryE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__115messages_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115messages_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115numpunct_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115numpunct_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117__assoc_sub_stateE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__118__time_get_storageIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__118__time_get_storageIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__119__shared_weak_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__124__libcpp_debug_exceptionE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__15ctypeIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__15ctypeIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__16locale5facetE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17collateIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__17collateIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__18__c_nodeE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__18ios_base7failureE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__18ios_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTINSt3__18messagesIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__18messagesIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__18numpunctIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__18numpunctIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 72} +{'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 72} +{'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__19__num_getIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__19__num_getIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__19__num_putIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__19__num_putIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTINSt3__19strstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTINSt3__19time_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTISt11logic_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt12bad_any_cast', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTISt12length_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt12out_of_range', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt13runtime_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt14overflow_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt16invalid_argument', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt16nested_exception', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTISt18bad_variant_access', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTISt19bad_optional_access', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTISt8bad_cast', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt9bad_alloc', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTISt9exception', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'is_defined': True, 'type': 'OBJECT', 'size': 50} +{'name': '_ZTSNSt12experimental19bad_optional_accessE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTSNSt3__110__time_getE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__110__time_putE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__110ctype_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__110istrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__110money_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__110ostrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__111__money_getIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__111__money_getIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__111__money_putIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__111__money_putIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__111regex_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__112bad_weak_ptrE', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSNSt3__112codecvt_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSNSt3__112ctype_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 26} +{'name': '_ZTSNSt3__112ctype_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 26} +{'name': '_ZTSNSt3__112future_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSNSt3__112strstreambufE', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSNSt3__112system_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 47} +{'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 47} +{'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 47} +{'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 47} +{'name': '_ZTSNSt3__113messages_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__114__num_get_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__114__num_put_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__114__shared_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 43} +{'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 43} +{'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 42} +{'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 42} +{'name': '_ZTSNSt3__114collate_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__114collate_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__114error_categoryE', 'is_defined': True, 'type': 'OBJECT', 'size': 25} +{'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 33} +{'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 33} +{'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 49} +{'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 49} +{'name': '_ZTSNSt3__115messages_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__115messages_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 29} +{'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 77} +{'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 77} +{'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 77} +{'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 77} +{'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__117__assoc_sub_stateE', 'is_defined': True, 'type': 'OBJECT', 'size': 28} +{'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__118__time_get_storageIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTSNSt3__118__time_get_storageIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTSNSt3__119__shared_weak_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 30} +{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__124__libcpp_debug_exceptionE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__15ctypeIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 18} +{'name': '_ZTSNSt3__15ctypeIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 18} +{'name': '_ZTSNSt3__16locale5facetE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 35} +{'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 34} +{'name': '_ZTSNSt3__17collateIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 20} +{'name': '_ZTSNSt3__17collateIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 20} +{'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 68} +{'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 68} +{'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 68} +{'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 68} +{'name': '_ZTSNSt3__18__c_nodeE', 'is_defined': True, 'type': 'OBJECT', 'size': 18} +{'name': '_ZTSNSt3__18ios_base7failureE', 'is_defined': True, 'type': 'OBJECT', 'size': 26} +{'name': '_ZTSNSt3__18ios_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 18} +{'name': '_ZTSNSt3__18messagesIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__18messagesIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__18numpunctIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__18numpunctIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 69} +{'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 69} +{'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 69} +{'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 69} +{'name': '_ZTSNSt3__19__num_getIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__19__num_getIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__19__num_putIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__19__num_putIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 22} +{'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 42} +{'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 42} +{'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 70} +{'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 70} +{'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 70} +{'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 70} +{'name': '_ZTSNSt3__19strstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 19} +{'name': '_ZTSNSt3__19time_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 19} +{'name': '_ZTSSt12bad_any_cast', 'is_defined': True, 'type': 'OBJECT', 'size': 17} +{'name': '_ZTSSt16nested_exception', 'is_defined': True, 'type': 'OBJECT', 'size': 21} +{'name': '_ZTSSt18bad_variant_access', 'is_defined': True, 'type': 'OBJECT', 'size': 23} +{'name': '_ZTSSt19bad_optional_access', 'is_defined': True, 'type': 'OBJECT', 'size': 24} +{'name': '_ZTTNSt3__110istrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTTNSt3__110ostrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 16} +{'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTTNSt3__19strstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt12experimental19bad_optional_accessE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__110istrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__110ostrstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__111regex_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__112bad_weak_ptrE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__112ctype_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 104} +{'name': '_ZTVNSt3__112ctype_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 136} +{'name': '_ZTVNSt3__112future_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__112strstreambufE', 'is_defined': True, 'type': 'OBJECT', 'size': 128} +{'name': '_ZTVNSt3__112system_errorE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114__shared_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 120} +{'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__114collate_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__114collate_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__114error_categoryE', 'is_defined': True, 'type': 'OBJECT', 'size': 72} +{'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 128} +{'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 128} +{'name': '_ZTVNSt3__115messages_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__115messages_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 224} +{'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 224} +{'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__117__assoc_sub_stateE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'is_defined': True, 'type': 'OBJECT', 'size': 112} +{'name': '_ZTVNSt3__119__shared_weak_countE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__124__libcpp_debug_exceptionE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__15ctypeIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 104} +{'name': '_ZTVNSt3__15ctypeIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 136} +{'name': '_ZTVNSt3__16locale5facetE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'is_defined': True, 'type': 'OBJECT', 'size': 96} +{'name': '_ZTVNSt3__17collateIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__17collateIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 128} +{'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 128} +{'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 104} +{'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 104} +{'name': '_ZTVNSt3__18__c_nodeE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__18ios_base7failureE', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVNSt3__18ios_baseE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTVNSt3__18messagesIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__18messagesIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 64} +{'name': '_ZTVNSt3__18numpunctIcEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__18numpunctIwEE', 'is_defined': True, 'type': 'OBJECT', 'size': 80} +{'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 168} +{'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 168} +{'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 48} +{'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'is_defined': True, 'type': 'OBJECT', 'size': 56} +{'name': '_ZTVNSt3__19strstreamE', 'is_defined': True, 'type': 'OBJECT', 'size': 120} +{'name': '_ZTVSt11logic_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt12bad_any_cast', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVSt12length_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt12out_of_range', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt13runtime_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt14overflow_error', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt16invalid_argument', 'is_defined': False, 'type': 'OBJECT', 'size': 0} +{'name': '_ZTVSt16nested_exception', 'is_defined': True, 'type': 'OBJECT', 'size': 32} +{'name': '_ZTVSt18bad_variant_access', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZTVSt19bad_optional_access', 'is_defined': True, 'type': 'OBJECT', 'size': 40} +{'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZThn16_NSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZThn16_NSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPvRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPvSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPvSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPvm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdaPvmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPv', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPvRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPvSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPvSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPvm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZdlPvmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_Znam', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnamRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnamSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnamSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_Znwm', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnwmRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnwmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '_ZnwmSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'} +{'name': '__cxa_allocate_exception', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_begin_catch', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_current_primary_exception', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_decrement_exception_refcount', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_end_catch', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_free_exception', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_guard_abort', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_guard_acquire', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_guard_release', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_increment_exception_refcount', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_pure_virtual', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_rethrow', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_rethrow_primary_exception', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_throw', 'is_defined': False, 'type': 'FUNC'} +{'name': '__cxa_uncaught_exceptions', 'is_defined': False, 'type': 'FUNC'} diff --git a/src/any.cpp b/src/any.cpp index 45b2337eb353f..3795258bb0614 100644 --- a/src/any.cpp +++ b/src/any.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "any" -#include "experimental/any" namespace std { const char* bad_any_cast::what() const _NOEXCEPT { @@ -16,8 +15,21 @@ const char* bad_any_cast::what() const _NOEXCEPT { } } + +#include <experimental/__config> + +// Preserve std::experimental::any_bad_cast for ABI compatibility +// Even though it no longer exists in a header file _LIBCPP_BEGIN_NAMESPACE_LFTS + +class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast +{ +public: + virtual const char* what() const _NOEXCEPT; +}; + const char* bad_any_cast::what() const _NOEXCEPT { return "bad any cast"; } + _LIBCPP_END_NAMESPACE_LFTS diff --git a/src/chrono.cpp b/src/chrono.cpp index d0e184ad32fb6..882d50b9d7316 100644 --- a/src/chrono.cpp +++ b/src/chrono.cpp @@ -11,27 +11,10 @@ #include "cerrno" // errno #include "system_error" // __throw_system_error #include <time.h> // clock_gettime, CLOCK_MONOTONIC and CLOCK_REALTIME +#include "include/apple_availability.h" -#if (__APPLE__) -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200 -#define _LIBCXX_USE_CLOCK_GETTIME -#endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100000 -#define _LIBCXX_USE_CLOCK_GETTIME -#endif -#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) -#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 100000 -#define _LIBCXX_USE_CLOCK_GETTIME -#endif -#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) -#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 30000 -#define _LIBCXX_USE_CLOCK_GETTIME -#endif -#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__ -#else -#define _LIBCXX_USE_CLOCK_GETTIME +#if !defined(__APPLE__) +#define _LIBCPP_USE_CLOCK_GETTIME #endif // __APPLE__ #if defined(_LIBCPP_WIN32API) @@ -42,7 +25,7 @@ #include <winapifamily.h> #endif #else -#if !defined(CLOCK_REALTIME) || !defined(_LIBCXX_USE_CLOCK_GETTIME) +#if !defined(CLOCK_REALTIME) || !defined(_LIBCPP_USE_CLOCK_GETTIME) #include <sys/time.h> // for gettimeofday and timeval #endif // !defined(CLOCK_REALTIME) #endif // defined(_LIBCPP_WIN32API) @@ -92,16 +75,16 @@ system_clock::now() _NOEXCEPT static_cast<__int64>(ft.dwLowDateTime)}; return time_point(duration_cast<duration>(d - nt_to_unix_epoch)); #else -#if defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) - 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)); +#if defined(_LIBCPP_USE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) + 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)); #else timeval tv; gettimeofday(&tv, 0); return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec)); -#endif // _LIBCXX_USE_CLOCK_GETTIME && CLOCK_REALTIME +#endif // _LIBCPP_USE_CLOCK_GETTIME && CLOCK_REALTIME #endif } @@ -129,7 +112,7 @@ const bool steady_clock::is_steady; #if defined(__APPLE__) // Darwin libc versions >= 1133 provide ns precision via CLOCK_UPTIME_RAW -#if defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW) +#if defined(_LIBCPP_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW) steady_clock::time_point steady_clock::now() _NOEXCEPT { @@ -191,7 +174,7 @@ steady_clock::now() _NOEXCEPT static FP fp = init_steady_clock(); return time_point(duration(fp())); } -#endif // defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW) +#endif // defined(_LIBCPP_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW) #elif defined(_LIBCPP_WIN32API) diff --git a/src/experimental/filesystem/directory_iterator.cpp b/src/experimental/filesystem/directory_iterator.cpp deleted file mode 100644 index a552fdc4461db..0000000000000 --- a/src/experimental/filesystem/directory_iterator.cpp +++ /dev/null @@ -1,342 +0,0 @@ -//===------------------ directory_iterator.cpp ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "experimental/filesystem" -#include "__config" -#if defined(_LIBCPP_WIN32API) -#define WIN32_LEAN_AND_MEAN -#include <Windows.h> -#else -#include <dirent.h> -#endif -#include <errno.h> - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM - -namespace { namespace detail { - -#if !defined(_LIBCPP_WIN32API) -inline error_code capture_errno() { - _LIBCPP_ASSERT(errno, "Expected errno to be non-zero"); - return error_code{errno, std::generic_category()}; -} -#endif - -template <class ...Args> -inline bool set_or_throw(std::error_code& my_ec, - std::error_code* user_ec, - const char* msg, Args&&... args) -{ - if (user_ec) { - *user_ec = my_ec; - return true; - } - __throw_filesystem_error(msg, std::forward<Args>(args)..., my_ec); - return false; -} - -#if !defined(_LIBCPP_WIN32API) -inline path::string_type posix_readdir(DIR *dir_stream, error_code& ec) { - struct dirent* dir_entry_ptr = nullptr; - errno = 0; // zero errno in order to detect errors - ec.clear(); - if ((dir_entry_ptr = ::readdir(dir_stream)) == nullptr) { - if (errno) - ec = capture_errno(); - return {}; - } else { - return dir_entry_ptr->d_name; - } -} -#endif - -}} // namespace detail - -using detail::set_or_throw; - -#if defined(_LIBCPP_WIN32API) -class __dir_stream { -public: - __dir_stream() = delete; - __dir_stream& operator=(const __dir_stream&) = delete; - - __dir_stream(__dir_stream&& __ds) noexcept - : __stream_(__ds.__stream_), __root_(std::move(__ds.__root_)), - __entry_(std::move(__ds.__entry_)) { - __ds.__stream_ = INVALID_HANDLE_VALUE; - } - - __dir_stream(const path& root, directory_options opts, error_code& ec) - : __stream_(INVALID_HANDLE_VALUE), __root_(root) { - __stream_ = ::FindFirstFile(root.c_str(), &__data_); - if (__stream_ == INVALID_HANDLE_VALUE) { - ec = error_code(::GetLastError(), std::generic_category()); - const bool ignore_permission_denied = - bool(opts & directory_options::skip_permission_denied); - if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED) - ec.clear(); - return; - } - } - - ~__dir_stream() noexcept { - if (__stream_ == INVALID_HANDLE_VALUE) - return; - close(); - } - - 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; - __entry_.assign(__root_ / __data_.cFileName); - return true; - } - ec = error_code(::GetLastError(), std::generic_category()); - close(); - return false; - } - -private: - std::error_code close() noexcept { - std::error_code ec; - if (!::FindClose(__stream_)) - ec = error_code(::GetLastError(), std::generic_category()); - __stream_ = INVALID_HANDLE_VALUE; - return ec; - } - - HANDLE __stream_{INVALID_HANDLE_VALUE}; - WIN32_FIND_DATA __data_; - -public: - path __root_; - directory_entry __entry_; -}; -#else -class __dir_stream { -public: - __dir_stream() = delete; - __dir_stream& operator=(const __dir_stream&) = delete; - - __dir_stream(__dir_stream&& other) noexcept - : __stream_(other.__stream_), __root_(std::move(other.__root_)), - __entry_(std::move(other.__entry_)) - { - other.__stream_ = nullptr; - } - - - __dir_stream(const path& root, directory_options opts, error_code& ec) - : __stream_(nullptr), - __root_(root) - { - if ((__stream_ = ::opendir(root.c_str())) == nullptr) { - ec = detail::capture_errno(); - const bool allow_eacess = - bool(opts & directory_options::skip_permission_denied); - if (allow_eacess && ec.value() == EACCES) - ec.clear(); - return; - } - advance(ec); - } - - ~__dir_stream() noexcept - { if (__stream_) close(); } - - bool good() const noexcept { return __stream_ != nullptr; } - - bool advance(error_code &ec) { - while (true) { - auto str = detail::posix_readdir(__stream_, ec); - if (str == "." || str == "..") { - continue; - } else if (ec || str.empty()) { - close(); - return false; - } else { - __entry_.assign(__root_ / str); - return true; - } - } - } -private: - std::error_code close() noexcept { - std::error_code m_ec; - if (::closedir(__stream_) == -1) - m_ec = detail::capture_errno(); - __stream_ = nullptr; - return m_ec; - } - - DIR * __stream_{nullptr}; -public: - path __root_; - directory_entry __entry_; -}; -#endif - -// directory_iterator - -directory_iterator::directory_iterator(const path& p, error_code *ec, - directory_options opts) -{ - std::error_code m_ec; - __imp_ = make_shared<__dir_stream>(p, opts, m_ec); - if (ec) *ec = m_ec; - if (!__imp_->good()) { - __imp_.reset(); - if (m_ec) - set_or_throw(m_ec, ec, - "directory_iterator::directory_iterator(...)", p); - } -} - -directory_iterator& directory_iterator::__increment(error_code *ec) -{ - _LIBCPP_ASSERT(__imp_, "Attempting to increment an invalid iterator"); - std::error_code m_ec; - if (!__imp_->advance(m_ec)) { - __imp_.reset(); - if (m_ec) - set_or_throw(m_ec, ec, "directory_iterator::operator++()"); - } else { - if (ec) ec->clear(); - } - return *this; - -} - -directory_entry const& directory_iterator::__dereference() const { - _LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator"); - return __imp_->__entry_; -} - -// recursive_directory_iterator - -struct recursive_directory_iterator::__shared_imp { - stack<__dir_stream> __stack_; - directory_options __options_; -}; - -recursive_directory_iterator::recursive_directory_iterator(const path& p, - directory_options opt, error_code *ec) - : __imp_(nullptr), __rec_(true) -{ - if (ec) ec->clear(); - std::error_code m_ec; - __dir_stream new_s(p, opt, m_ec); - if (m_ec) set_or_throw(m_ec, ec, "recursive_directory_iterator", p); - if (m_ec || !new_s.good()) return; - - __imp_ = _VSTD::make_shared<__shared_imp>(); - __imp_->__options_ = opt; - __imp_->__stack_.push(_VSTD::move(new_s)); -} - -void recursive_directory_iterator::__pop(error_code* ec) -{ - _LIBCPP_ASSERT(__imp_, "Popping the end iterator"); - if (ec) ec->clear(); - __imp_->__stack_.pop(); - if (__imp_->__stack_.size() == 0) - __imp_.reset(); - else - __advance(ec); -} - -directory_options recursive_directory_iterator::options() const { - return __imp_->__options_; -} - -int recursive_directory_iterator::depth() const { - return __imp_->__stack_.size() - 1; -} - -const directory_entry& recursive_directory_iterator::__dereference() const { - return __imp_->__stack_.top().__entry_; -} - -recursive_directory_iterator& -recursive_directory_iterator::__increment(error_code *ec) -{ - if (ec) ec->clear(); - if (recursion_pending()) { - if (__try_recursion(ec) || (ec && *ec)) - return *this; - } - __rec_ = true; - __advance(ec); - return *this; -} - -void recursive_directory_iterator::__advance(error_code* ec) { - // REQUIRES: ec must be cleared before calling this function. - const directory_iterator end_it; - auto& stack = __imp_->__stack_; - std::error_code m_ec; - while (stack.size() > 0) { - if (stack.top().advance(m_ec)) - return; - if (m_ec) break; - stack.pop(); - } - __imp_.reset(); - if (m_ec) - set_or_throw(m_ec, ec, "recursive_directory_iterator::operator++()"); -} - -bool recursive_directory_iterator::__try_recursion(error_code *ec) { - bool rec_sym = - bool(options() & directory_options::follow_directory_symlink); - - auto& curr_it = __imp_->__stack_.top(); - - bool skip_rec = false; - std::error_code m_ec; - if (!rec_sym) { - file_status st = curr_it.__entry_.symlink_status(m_ec); - if (m_ec && status_known(st)) - m_ec.clear(); - if (m_ec || is_symlink(st) || !is_directory(st)) - skip_rec = true; - } else { - file_status st = curr_it.__entry_.status(m_ec); - if (m_ec && status_known(st)) - m_ec.clear(); - if (m_ec || !is_directory(st)) - skip_rec = true; - } - - if (!skip_rec) { - __dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec); - if (new_it.good()) { - __imp_->__stack_.push(_VSTD::move(new_it)); - return true; - } - } - if (m_ec) { - const bool allow_eacess = bool(__imp_->__options_ - & directory_options::skip_permission_denied); - if (m_ec.value() == EACCES && allow_eacess) { - if (ec) ec->clear(); - } else { - __imp_.reset(); - set_or_throw(m_ec, ec, - "recursive_directory_iterator::operator++()"); - } - } - return false; -} - - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM diff --git a/src/experimental/filesystem/filesystem_time_helper.h b/src/experimental/filesystem/filesystem_time_helper.h deleted file mode 100644 index a60fdef5f0d9a..0000000000000 --- a/src/experimental/filesystem/filesystem_time_helper.h +++ /dev/null @@ -1,173 +0,0 @@ -//===----------------------------------------------------------------------===//// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===//// - -#ifndef FILESYSTEM_TIME_HELPER_H -#define FILESYSTEM_TIME_HELPER_H - -#include "experimental/__config" -#include "chrono" -#include "cstdlib" -#include "climits" - -#include <unistd.h> -#include <sys/stat.h> -#if !defined(UTIME_OMIT) -#include <sys/time.h> // for ::utimes as used in __last_write_time -#endif - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM - -namespace time_detail { namespace { - -using namespace chrono; - -template <class FileTimeT, - bool IsFloat = is_floating_point<typename FileTimeT::rep>::value> -struct fs_time_util_base { - static constexpr auto max_seconds = - duration_cast<seconds>(FileTimeT::duration::max()).count(); - - static constexpr auto max_nsec = - duration_cast<nanoseconds>(FileTimeT::duration::max() - - seconds(max_seconds)) - .count(); - - static constexpr auto min_seconds = - duration_cast<seconds>(FileTimeT::duration::min()).count(); - - static constexpr auto min_nsec_timespec = - duration_cast<nanoseconds>( - (FileTimeT::duration::min() - seconds(min_seconds)) + seconds(1)) - .count(); - - // Static assert that these values properly round trip. - static_assert((seconds(min_seconds) + - duration_cast<microseconds>(nanoseconds(min_nsec_timespec))) - - duration_cast<microseconds>(seconds(1)) == - FileTimeT::duration::min(), - ""); -}; - -template <class FileTimeT> -struct fs_time_util_base<FileTimeT, true> { - static const long long max_seconds; - static const long long max_nsec; - static const long long min_seconds; - static const long long min_nsec_timespec; -}; - -template <class FileTimeT> -const long long fs_time_util_base<FileTimeT, true>::max_seconds = - duration_cast<seconds>(FileTimeT::duration::max()).count(); - -template <class FileTimeT> -const long long fs_time_util_base<FileTimeT, true>::max_nsec = - duration_cast<nanoseconds>(FileTimeT::duration::max() - - seconds(max_seconds)) - .count(); - -template <class FileTimeT> -const long long fs_time_util_base<FileTimeT, true>::min_seconds = - duration_cast<seconds>(FileTimeT::duration::min()).count(); - -template <class FileTimeT> -const long long fs_time_util_base<FileTimeT, true>::min_nsec_timespec = - duration_cast<nanoseconds>((FileTimeT::duration::min() - - seconds(min_seconds)) + - seconds(1)) - .count(); - -template <class FileTimeT, class TimeT, class TimeSpecT> -struct fs_time_util : fs_time_util_base<FileTimeT> { - using Base = fs_time_util_base<FileTimeT>; - using Base::max_nsec; - using Base::max_seconds; - using Base::min_nsec_timespec; - using Base::min_seconds; - -public: - template <class CType, class ChronoType> - static bool checked_set(CType* out, ChronoType time) { - using Lim = numeric_limits<CType>; - if (time > Lim::max() || time < Lim::min()) - return false; - *out = static_cast<CType>(time); - return true; - } - - static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(TimeSpecT tm) { - if (tm.tv_sec >= 0) { - return (tm.tv_sec < max_seconds) || - (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec); - } else if (tm.tv_sec == (min_seconds - 1)) { - return tm.tv_nsec >= min_nsec_timespec; - } else { - return (tm.tv_sec >= min_seconds); - } - } - - static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(FileTimeT tm) { - auto secs = duration_cast<seconds>(tm.time_since_epoch()); - auto nsecs = duration_cast<nanoseconds>(tm.time_since_epoch() - secs); - if (nsecs.count() < 0) { - secs = secs + seconds(1); - nsecs = nsecs + seconds(1); - } - using TLim = numeric_limits<TimeT>; - if (secs.count() >= 0) - return secs.count() <= TLim::max(); - return secs.count() >= TLim::min(); - } - - static _LIBCPP_CONSTEXPR_AFTER_CXX11 FileTimeT - convert_timespec(TimeSpecT tm) { - auto adj_msec = duration_cast<microseconds>(nanoseconds(tm.tv_nsec)); - if (tm.tv_sec >= 0) { - auto Dur = seconds(tm.tv_sec) + microseconds(adj_msec); - return FileTimeT(Dur); - } else if (duration_cast<microseconds>(nanoseconds(tm.tv_nsec)).count() == - 0) { - return FileTimeT(seconds(tm.tv_sec)); - } else { // tm.tv_sec < 0 - auto adj_subsec = - duration_cast<microseconds>(seconds(1) - nanoseconds(tm.tv_nsec)); - auto Dur = seconds(tm.tv_sec + 1) - adj_subsec; - return FileTimeT(Dur); - } - } - - template <class SubSecDurT, class SubSecT> - static bool set_times_checked(TimeT* sec_out, SubSecT* subsec_out, - FileTimeT tp) { - using namespace chrono; - auto dur = tp.time_since_epoch(); - auto sec_dur = duration_cast<seconds>(dur); - auto subsec_dur = duration_cast<SubSecDurT>(dur - sec_dur); - // The tv_nsec and tv_usec fields must not be negative so adjust accordingly - if (subsec_dur.count() < 0) { - if (sec_dur.count() > min_seconds) { - sec_dur -= seconds(1); - subsec_dur += seconds(1); - } else { - subsec_dur = SubSecDurT::zero(); - } - } - return checked_set(sec_out, sec_dur.count()) && - checked_set(subsec_out, subsec_dur.count()); - } -}; - -} // end namespace -} // end namespace time_detail - -using time_detail::fs_time_util; - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM - -#endif // FILESYSTEM_TIME_HELPER_H diff --git a/src/experimental/filesystem/operations.cpp b/src/experimental/filesystem/operations.cpp deleted file mode 100644 index 662fa7b8626a0..0000000000000 --- a/src/experimental/filesystem/operations.cpp +++ /dev/null @@ -1,808 +0,0 @@ -//===--------------------- filesystem/ops.cpp -----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "experimental/filesystem" -#include "iterator" -#include "fstream" -#include "type_traits" -#include "random" /* for unique_path */ -#include "cstdlib" -#include "climits" - -#include "filesystem_time_helper.h" - -#include <unistd.h> -#include <sys/stat.h> -#include <sys/statvfs.h> -#include <fcntl.h> /* values for fchmodat */ -#if !defined(UTIME_OMIT) -#include <sys/time.h> // for ::utimes as used in __last_write_time -#endif - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM - -filesystem_error::~filesystem_error() {} - - -// POSIX HELPERS - -namespace detail { namespace { - -using value_type = path::value_type; -using string_type = path::string_type; - -inline std::error_code capture_errno() { - _LIBCPP_ASSERT(errno, "Expected errno to be non-zero"); - return std::error_code(errno, std::generic_category()); -} - -void set_or_throw(std::error_code const& m_ec, std::error_code* ec, - const char* msg, path const& p = {}, path const& p2 = {}) -{ - if (ec) { - *ec = m_ec; - } else { - string msg_s("std::experimental::filesystem::"); - msg_s += msg; - __throw_filesystem_error(msg_s, p, p2, m_ec); - } -} - -void set_or_throw(std::error_code* ec, const char* msg, - path const& p = {}, path const& p2 = {}) -{ - return set_or_throw(capture_errno(), ec, msg, p, p2); -} - -perms posix_get_perms(const struct ::stat & st) noexcept { - 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(std::error_code& m_ec, path const& p, - struct ::stat& path_stat, - std::error_code* ec) -{ - if (ec) *ec = m_ec; - if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) { - return file_status(file_type::not_found); - } - else if (m_ec) { - set_or_throw(m_ec, ec, "posix_stat", p); - return file_status(file_type::none); - } - // else - - file_status fs_tmp; - auto const mode = path_stat.st_mode; - if (S_ISLNK(mode)) fs_tmp.type(file_type::symlink); - else if (S_ISREG(mode)) fs_tmp.type(file_type::regular); - else if (S_ISDIR(mode)) fs_tmp.type(file_type::directory); - else if (S_ISBLK(mode)) fs_tmp.type(file_type::block); - else if (S_ISCHR(mode)) fs_tmp.type(file_type::character); - else if (S_ISFIFO(mode)) fs_tmp.type(file_type::fifo); - else if (S_ISSOCK(mode)) fs_tmp.type(file_type::socket); - else fs_tmp.type(file_type::unknown); - - fs_tmp.permissions(detail::posix_get_perms(path_stat)); - return fs_tmp; -} - -file_status posix_stat(path const & p, struct ::stat& path_stat, - std::error_code* ec) -{ - std::error_code m_ec; - if (::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_stat(path const & p, std::error_code* ec) { - struct ::stat path_stat; - return posix_stat(p, path_stat, ec); -} - -file_status posix_lstat(path const & p, struct ::stat & path_stat, - std::error_code* ec) -{ - std::error_code m_ec; - if (::lstat(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, std::error_code* ec) { - struct ::stat path_stat; - return posix_lstat(p, path_stat, ec); -} - -bool stat_equivalent(struct ::stat& st1, struct ::stat& st2) { - return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino); -} - -// DETAIL::MISC - - -bool copy_file_impl(const path& from, const path& to, perms from_perms, - std::error_code *ec) -{ - std::ifstream in(from.c_str(), std::ios::binary); - std::ofstream out(to.c_str(), std::ios::binary); - - if (in.good() && out.good()) { - using InIt = std::istreambuf_iterator<char>; - using OutIt = std::ostreambuf_iterator<char>; - InIt bin(in); - InIt ein; - OutIt bout(out); - std::copy(bin, ein, bout); - } - if (out.fail() || in.fail()) { - set_or_throw(make_error_code(errc::operation_not_permitted), - ec, "copy_file", from, to); - return false; - } - __permissions(to, from_perms, ec); - // TODO what if permissions fails? - return true; -} - -}} // end namespace detail - -using detail::set_or_throw; - -path __canonical(path const & orig_p, const path& base, std::error_code *ec) -{ - path p = absolute(orig_p, base); - char buff[PATH_MAX + 1]; - char *ret; - if ((ret = ::realpath(p.c_str(), buff)) == nullptr) { - set_or_throw(ec, "canonical", orig_p, base); - return {}; - } - if (ec) ec->clear(); - return {ret}; -} - -void __copy(const path& from, const path& to, copy_options options, - std::error_code *ec) -{ - const bool sym_status = bool(options & - (copy_options::create_symlinks | copy_options::skip_symlinks)); - - const bool sym_status2 = bool(options & - copy_options::copy_symlinks); - - std::error_code m_ec1; - struct ::stat f_st = {}; - const file_status f = sym_status || sym_status2 - ? detail::posix_lstat(from, f_st, &m_ec1) - : detail::posix_stat(from, f_st, &m_ec1); - if (m_ec1) - return set_or_throw(m_ec1, ec, "copy", from, to); - - struct ::stat t_st = {}; - const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec1) - : detail::posix_stat(to, t_st, &m_ec1); - - if (not status_known(t)) - return set_or_throw(m_ec1, ec, "copy", from, to); - - if (!exists(f) || is_other(f) || is_other(t) - || (is_directory(f) && is_regular_file(t)) - || detail::stat_equivalent(f_st, t_st)) - { - return set_or_throw(make_error_code(errc::function_not_supported), - ec, "copy", from, to); - } - - if (ec) ec->clear(); - - if (is_symlink(f)) { - if (bool(copy_options::skip_symlinks & options)) { - // do nothing - } else if (not exists(t)) { - __copy_symlink(from, to, ec); - } else { - set_or_throw(make_error_code(errc::file_exists), - ec, "copy", from, to); - } - return; - } - else if (is_regular_file(f)) { - if (bool(copy_options::directories_only & options)) { - // do nothing - } - else if (bool(copy_options::create_symlinks & options)) { - __create_symlink(from, to, ec); - } - else if (bool(copy_options::create_hard_links & options)) { - __create_hard_link(from, to, ec); - } - else if (is_directory(t)) { - __copy_file(from, to / from.filename(), options, ec); - } else { - __copy_file(from, to, options, ec); - } - return; - } - else if (is_directory(f) && bool(copy_options::create_symlinks & options)) { - return set_or_throw(make_error_code(errc::is_a_directory), ec, "copy"); - } - else if (is_directory(f) && (bool(copy_options::recursive & options) || - copy_options::none == options)) { - - if (!exists(t)) { - // create directory to with attributes from 'from'. - __create_directory(to, from, ec); - if (ec && *ec) { return; } - } - directory_iterator it = ec ? directory_iterator(from, *ec) - : directory_iterator(from); - if (ec && *ec) { return; } - std::error_code m_ec2; - for (; it != directory_iterator(); it.increment(m_ec2)) { - if (m_ec2) return set_or_throw(m_ec2, ec, "copy", from, to); - __copy(it->path(), to / it->path().filename(), - options | copy_options::__in_recursive_copy, ec); - if (ec && *ec) { return; } - } - } -} - - -bool __copy_file(const path& from, const path& to, copy_options options, - std::error_code *ec) -{ - if (ec) ec->clear(); - - std::error_code m_ec; - auto from_st = detail::posix_stat(from, &m_ec); - if (not is_regular_file(from_st)) { - if (not m_ec) - m_ec = make_error_code(errc::not_supported); - set_or_throw(m_ec, ec, "copy_file", from, to); - return false; - } - - auto to_st = detail::posix_stat(to, &m_ec); - if (!status_known(to_st)) { - set_or_throw(m_ec, ec, "copy_file", from, to); - return false; - } - - const bool to_exists = exists(to_st); - if (to_exists && !is_regular_file(to_st)) { - set_or_throw(make_error_code(errc::not_supported), ec, "copy_file", from, to); - return false; - } - if (to_exists && bool(copy_options::skip_existing & options)) { - return false; - } - else if (to_exists && bool(copy_options::update_existing & options)) { - auto from_time = __last_write_time(from, ec); - if (ec && *ec) { return false; } - auto to_time = __last_write_time(to, ec); - if (ec && *ec) { return false; } - if (from_time <= to_time) { - return false; - } - return detail::copy_file_impl(from, to, from_st.permissions(), ec); - } - else if (!to_exists || bool(copy_options::overwrite_existing & options)) { - return detail::copy_file_impl(from, to, from_st.permissions(), ec); - } - else { - set_or_throw(make_error_code(errc::file_exists), ec, "copy", from, to); - return false; - } - - _LIBCPP_UNREACHABLE(); -} - -void __copy_symlink(const path& existing_symlink, const path& new_symlink, - std::error_code *ec) -{ - const path real_path(__read_symlink(existing_symlink, ec)); - 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); -} - - -bool __create_directories(const path& p, std::error_code *ec) -{ - std::error_code m_ec; - auto const st = detail::posix_stat(p, &m_ec); - if (!status_known(st)) { - set_or_throw(m_ec, ec, "create_directories", p); - return false; - } - else if (is_directory(st)) { - if (ec) ec->clear(); - return false; - } - else if (exists(st)) { - set_or_throw(make_error_code(errc::file_exists), - ec, "create_directories", p); - return false; - } - - const path parent = p.parent_path(); - if (!parent.empty()) { - const file_status parent_st = status(parent, m_ec); - if (not status_known(parent_st)) { - set_or_throw(m_ec, ec, "create_directories", p); - return false; - } - if (not exists(parent_st)) { - __create_directories(parent, ec); - if (ec && *ec) { return false; } - } - } - return __create_directory(p, ec); -} - -bool __create_directory(const path& p, std::error_code *ec) -{ - if (ec) ec->clear(); - if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0) - return true; - if (errno != EEXIST || !is_directory(p)) - set_or_throw(ec, "create_directory", p); - return false; -} - -bool __create_directory(path const & p, path const & attributes, - std::error_code *ec) -{ - struct ::stat attr_stat; - std::error_code mec; - auto st = detail::posix_stat(attributes, attr_stat, &mec); - if (!status_known(st)) { - set_or_throw(mec, ec, "create_directory", p, attributes); - return false; - } - if (ec) ec->clear(); - if (::mkdir(p.c_str(), attr_stat.st_mode) == 0) - return true; - if (errno != EEXIST || !is_directory(p)) - set_or_throw(ec, "create_directory", p, attributes); - return false; -} - -void __create_directory_symlink(path const & from, path const & to, - std::error_code *ec){ - if (::symlink(from.c_str(), to.c_str()) != 0) - set_or_throw(ec, "create_directory_symlink", from, to); - else if (ec) - ec->clear(); -} - -void __create_hard_link(const path& from, const path& to, std::error_code *ec){ - if (::link(from.c_str(), to.c_str()) == -1) - set_or_throw(ec, "create_hard_link", from, to); - else if (ec) - ec->clear(); -} - -void __create_symlink(path const & from, path const & to, std::error_code *ec) { - - if (::symlink(from.c_str(), to.c_str()) == -1) - set_or_throw(ec, "create_symlink", from, to); - else if (ec) - ec->clear(); -} - -path __current_path(std::error_code *ec) { - auto size = ::pathconf(".", _PC_PATH_MAX); - _LIBCPP_ASSERT(size >= 0, "pathconf returned a 0 as max size"); - - auto buff = std::unique_ptr<char[]>(new char[size + 1]); - char* ret; - if ((ret = ::getcwd(buff.get(), static_cast<size_t>(size))) == nullptr) { - set_or_throw(ec, "current_path"); - return {}; - } - if (ec) ec->clear(); - return {buff.get()}; -} - -void __current_path(const path& p, std::error_code *ec) { - if (::chdir(p.c_str()) == -1) - set_or_throw(ec, "current_path", p); - else if (ec) - ec->clear(); -} - -bool __equivalent(const path& p1, const path& p2, std::error_code *ec) -{ - auto make_unsupported_error = [&]() { - set_or_throw(make_error_code(errc::not_supported), ec, - "equivalent", p1, p2); - return false; - }; - std::error_code ec1, ec2; - struct ::stat st1 = {}; - struct ::stat st2 = {}; - auto s1 = detail::posix_stat(p1.native(), st1, &ec1); - if (!exists(s1)) - return make_unsupported_error(); - auto s2 = detail::posix_stat(p2.native(), st2, &ec2); - if (!exists(s2)) - return make_unsupported_error(); - if (ec) ec->clear(); - return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino); -} - - -std::uintmax_t __file_size(const path& p, std::error_code *ec) -{ - std::error_code m_ec; - struct ::stat st; - file_status fst = detail::posix_stat(p, st, &m_ec); - if (!exists(fst) || !is_regular_file(fst)) { - if (!m_ec) - m_ec = make_error_code(errc::not_supported); - set_or_throw(m_ec, ec, "file_size", p); - return static_cast<uintmax_t>(-1); - } - // is_regular_file(p) == true - if (ec) ec->clear(); - return static_cast<std::uintmax_t>(st.st_size); -} - -std::uintmax_t __hard_link_count(const path& p, std::error_code *ec) -{ - std::error_code m_ec; - struct ::stat st; - detail::posix_stat(p, st, &m_ec); - if (m_ec) { - set_or_throw(m_ec, ec, "hard_link_count", p); - return static_cast<std::uintmax_t>(-1); - } - if (ec) ec->clear(); - return static_cast<std::uintmax_t>(st.st_nlink); -} - - -bool __fs_is_empty(const path& p, std::error_code *ec) -{ - if (ec) ec->clear(); - std::error_code m_ec; - struct ::stat pst; - auto st = detail::posix_stat(p, pst, &m_ec); - if (m_ec) { - set_or_throw(m_ec, ec, "is_empty", p); - return false; - } - else if (!is_directory(st) && !is_regular_file(st)) { - m_ec = make_error_code(errc::not_supported); - set_or_throw(m_ec, ec, "is_empty"); - return false; - } - else if (is_directory(st)) { - auto it = ec ? directory_iterator(p, *ec) : directory_iterator(p); - if (ec && *ec) - return false; - return it == directory_iterator{}; - } - else if (is_regular_file(st)) - return static_cast<std::uintmax_t>(pst.st_size) == 0; - - _LIBCPP_UNREACHABLE(); -} - - -namespace detail { namespace { - -using TimeSpec = struct timespec; -using StatT = struct stat; - -#if defined(__APPLE__) -TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; } -__attribute__((unused)) // Suppress warning -TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; } -#else -TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; } -__attribute__((unused)) // Suppress warning -TimeSpec extract_atime(StatT const& st) { return st.st_atim; } -#endif - -}} // end namespace detail - -using FSTime = fs_time_util<file_time_type, time_t, struct timespec>; - -file_time_type __last_write_time(const path& p, std::error_code *ec) -{ - using namespace ::std::chrono; - std::error_code m_ec; - struct ::stat st; - detail::posix_stat(p, st, &m_ec); - if (m_ec) { - set_or_throw(m_ec, ec, "last_write_time", p); - return file_time_type::min(); - } - if (ec) ec->clear(); - auto ts = detail::extract_mtime(st); - if (!FSTime::is_representable(ts)) { - set_or_throw(error_code(EOVERFLOW, generic_category()), ec, - "last_write_time", p); - return file_time_type::min(); - } - return FSTime::convert_timespec(ts); -} - -void __last_write_time(const path& p, file_time_type new_time, - std::error_code *ec) -{ - using namespace std::chrono; - std::error_code m_ec; - - // We can use the presence of UTIME_OMIT to detect platforms that do not - // provide utimensat. -#if !defined(UTIME_OMIT) - // This implementation has a race condition between determining the - // last access time and attempting to set it to the same value using - // ::utimes - struct ::stat st; - file_status fst = detail::posix_stat(p, st, &m_ec); - if (m_ec && !status_known(fst)) { - set_or_throw(m_ec, ec, "last_write_time", p); - return; - } - auto atime = detail::extract_atime(st); - struct ::timeval tbuf[2]; - tbuf[0].tv_sec = atime.tv_sec; - tbuf[0].tv_usec = duration_cast<microseconds>(nanoseconds(atime.tv_nsec)).count(); - const bool overflowed = !FSTime::set_times_checked<microseconds>( - &tbuf[1].tv_sec, &tbuf[1].tv_usec, new_time); - - if (overflowed) { - set_or_throw(make_error_code(errc::invalid_argument), ec, - "last_write_time", p); - return; - } - if (::utimes(p.c_str(), tbuf) == -1) { - m_ec = detail::capture_errno(); - } -#else - struct ::timespec tbuf[2]; - tbuf[0].tv_sec = 0; - tbuf[0].tv_nsec = UTIME_OMIT; - - const bool overflowed = !FSTime::set_times_checked<nanoseconds>( - &tbuf[1].tv_sec, &tbuf[1].tv_nsec, new_time); - if (overflowed) { - set_or_throw(make_error_code(errc::invalid_argument), - ec, "last_write_time", p); - return; - } - if (::utimensat(AT_FDCWD, p.c_str(), tbuf, 0) == -1) { - m_ec = detail::capture_errno(); - } -#endif - if (m_ec) - set_or_throw(m_ec, ec, "last_write_time", p); - else if (ec) - ec->clear(); -} - - -void __permissions(const path& p, perms prms, std::error_code *ec) -{ - - const bool resolve_symlinks = !bool(perms::symlink_nofollow & prms); - const bool add_perms = bool(perms::add_perms & prms); - const bool remove_perms = bool(perms::remove_perms & prms); - _LIBCPP_ASSERT(!(add_perms && remove_perms), - "Both add_perms and remove_perms are set"); - - bool set_sym_perms = false; - prms &= perms::mask; - if (!resolve_symlinks || (add_perms || remove_perms)) { - std::error_code m_ec; - file_status st = resolve_symlinks ? detail::posix_stat(p, &m_ec) - : detail::posix_lstat(p, &m_ec); - set_sym_perms = is_symlink(st); - if (m_ec) return set_or_throw(m_ec, ec, "permissions", p); - _LIBCPP_ASSERT(st.permissions() != perms::unknown, - "Permissions unexpectedly unknown"); - if (add_perms) - prms |= st.permissions(); - else if (remove_perms) - prms = st.permissions() & ~prms; - } - const auto real_perms = detail::posix_convert_perms(prms); - -# 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) { - return set_or_throw(ec, "permissions", p); - } -# else - if (set_sym_perms) - return set_or_throw(make_error_code(errc::operation_not_supported), - ec, "permissions", p); - if (::chmod(p.c_str(), real_perms) == -1) { - return set_or_throw(ec, "permissions", p); - } -# endif - if (ec) ec->clear(); -} - - -path __read_symlink(const path& p, std::error_code *ec) { - char buff[PATH_MAX + 1]; - std::error_code m_ec; - ::ssize_t ret; - if ((ret = ::readlink(p.c_str(), buff, PATH_MAX)) == -1) { - set_or_throw(ec, "read_symlink", p); - return {}; - } - _LIBCPP_ASSERT(ret <= PATH_MAX, "TODO"); - _LIBCPP_ASSERT(ret > 0, "TODO"); - if (ec) ec->clear(); - buff[ret] = 0; - return {buff}; -} - - -bool __remove(const path& p, std::error_code *ec) { - if (ec) ec->clear(); - if (::remove(p.c_str()) == -1) { - set_or_throw(ec, "remove", p); - return false; - } - return true; -} - -namespace { - -std::uintmax_t remove_all_impl(path const & p, std::error_code& ec) -{ - const auto npos = static_cast<std::uintmax_t>(-1); - const file_status st = __symlink_status(p, &ec); - if (ec) return npos; - std::uintmax_t count = 1; - if (is_directory(st)) { - for (directory_iterator it(p, ec); !ec && it != directory_iterator(); - it.increment(ec)) { - auto other_count = remove_all_impl(it->path(), ec); - if (ec) return npos; - count += other_count; - } - if (ec) return npos; - } - if (!__remove(p, &ec)) return npos; - return count; -} - -} // end namespace - -std::uintmax_t __remove_all(const path& p, std::error_code *ec) { - std::error_code mec; - auto count = remove_all_impl(p, mec); - if (mec) { - set_or_throw(mec, ec, "remove_all", p); - return static_cast<std::uintmax_t>(-1); - } - if (ec) ec->clear(); - return count; -} - -void __rename(const path& from, const path& to, std::error_code *ec) { - if (::rename(from.c_str(), to.c_str()) == -1) - set_or_throw(ec, "rename", from, to); - else if (ec) - ec->clear(); -} - -void __resize_file(const path& p, std::uintmax_t size, std::error_code *ec) { - if (::truncate(p.c_str(), static_cast<::off_t>(size)) == -1) - set_or_throw(ec, "resize_file", p); - else if (ec) - ec->clear(); -} - -space_info __space(const path& p, std::error_code *ec) { - space_info si; - struct statvfs m_svfs = {}; - if (::statvfs(p.c_str(), &m_svfs) == -1) { - set_or_throw(ec, "space", p); - si.capacity = si.free = si.available = - static_cast<std::uintmax_t>(-1); - return si; - } - if (ec) ec->clear(); - // Multiply with overflow checking. - auto do_mult = [&](std::uintmax_t& out, std::uintmax_t other) { - out = other * m_svfs.f_frsize; - if (other == 0 || out / other != m_svfs.f_frsize) - out = static_cast<std::uintmax_t>(-1); - }; - do_mult(si.capacity, m_svfs.f_blocks); - do_mult(si.free, m_svfs.f_bfree); - do_mult(si.available, m_svfs.f_bavail); - return si; -} - -file_status __status(const path& p, std::error_code *ec) { - return detail::posix_stat(p, ec); -} - -file_status __symlink_status(const path& p, std::error_code *ec) { - return detail::posix_lstat(p, ec); -} - -path __system_complete(const path& p, std::error_code *ec) { - if (ec) ec->clear(); - return absolute(p, current_path()); -} - -path __temp_directory_path(std::error_code* ec) { - const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"}; - const char* ret = nullptr; - - for (auto& ep : env_paths) - if ((ret = std::getenv(ep))) - break; - if (ret == nullptr) - ret = "/tmp"; - - path p(ret); - std::error_code m_ec; - if (!exists(p, m_ec) || !is_directory(p, m_ec)) { - if (!m_ec || m_ec == make_error_code(errc::no_such_file_or_directory)) - m_ec = make_error_code(errc::not_a_directory); - set_or_throw(m_ec, ec, "temp_directory_path"); - return {}; - } - - if (ec) - ec->clear(); - return p; -} - -// An absolute path is composed according to the table in [fs.op.absolute]. -path absolute(const path& p, const path& base) { - auto root_name = p.root_name(); - auto root_dir = p.root_directory(); - - if (!root_name.empty() && !root_dir.empty()) - return p; - - auto abs_base = base.is_absolute() ? base : absolute(base); - - /* !has_root_name && !has_root_dir */ - if (root_name.empty() && root_dir.empty()) - { - return abs_base / p; - } - else if (!root_name.empty()) /* has_root_name && !has_root_dir */ - { - return root_name / abs_base.root_directory() - / - abs_base.relative_path() / p.relative_path(); - } - else /* !has_root_name && has_root_dir */ - { - if (abs_base.has_root_name()) - return abs_base.root_name() / p; - // else p is absolute, return outside of block - } - return p; -} - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM diff --git a/src/experimental/filesystem/path.cpp b/src/experimental/filesystem/path.cpp deleted file mode 100644 index dd4026cfe13a1..0000000000000 --- a/src/experimental/filesystem/path.cpp +++ /dev/null @@ -1,448 +0,0 @@ -//===--------------------- filesystem/path.cpp ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include "experimental/filesystem" -#include "string_view" -#include "utility" - -namespace { namespace parser -{ -using namespace std; -using namespace std::experimental::filesystem; - -using string_view_t = path::__string_view; -using string_view_pair = pair<string_view_t, string_view_t>; -using PosPtr = path::value_type const*; - -struct PathParser { - enum ParserState : unsigned char { - // Zero is a special sentinel value used by default constructed iterators. - PS_BeforeBegin = 1, - PS_InRootName, - PS_InRootDir, - PS_InFilenames, - PS_InTrailingSep, - PS_AtEnd - }; - - const string_view_t Path; - string_view_t RawEntry; - ParserState State; - -private: - PathParser(string_view_t P, ParserState State) noexcept - : Path(P), State(State) {} - -public: - PathParser(string_view_t P, string_view_t E, unsigned char S) - : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) { - // S cannot be '0' or PS_BeforeBegin. - } - - static PathParser CreateBegin(string_view_t P) noexcept { - PathParser PP(P, PS_BeforeBegin); - PP.increment(); - return PP; - } - - static PathParser CreateEnd(string_view_t P) noexcept { - PathParser PP(P, PS_AtEnd); - return PP; - } - - PosPtr peek() const noexcept { - auto TkEnd = getNextTokenStartPos(); - auto End = getAfterBack(); - return TkEnd == End ? nullptr : TkEnd; - } - - void increment() noexcept { - const PosPtr End = getAfterBack(); - const PosPtr Start = getNextTokenStartPos(); - if (Start == End) - return makeState(PS_AtEnd); - - switch (State) { - case PS_BeforeBegin: { - PosPtr TkEnd = consumeSeparator(Start, End); - // If we consumed exactly two separators we have a root name. - if (TkEnd && TkEnd == Start + 2) { - // FIXME Do we need to consume a name or is '//' a root name on its own? - // what about '//.', '//..', '//...'? - auto NameEnd = consumeName(TkEnd, End); - if (NameEnd) - TkEnd = NameEnd; - return makeState(PS_InRootName, Start, TkEnd); - } - else if (TkEnd) - return makeState(PS_InRootDir, Start, TkEnd); - else - return makeState(PS_InFilenames, Start, consumeName(Start, End)); - } - - case PS_InRootName: - return makeState(PS_InRootDir, Start, consumeSeparator(Start, End)); - case PS_InRootDir: - return makeState(PS_InFilenames, Start, consumeName(Start, End)); - - case PS_InFilenames: { - PosPtr SepEnd = consumeSeparator(Start, End); - if (SepEnd != End) { - PosPtr TkEnd = consumeName(SepEnd, End); - if (TkEnd) - return makeState(PS_InFilenames, SepEnd, TkEnd); - } - return makeState(PS_InTrailingSep, Start, SepEnd); - } - - case PS_InTrailingSep: - return makeState(PS_AtEnd); - - case PS_AtEnd: - _LIBCPP_UNREACHABLE(); - } - } - - void decrement() noexcept { - const PosPtr REnd = getBeforeFront(); - const PosPtr RStart = getCurrentTokenStartPos() - 1; - - switch (State) { - case PS_AtEnd: { - // Try to consume a trailing separator or root directory first. - if (PosPtr SepEnd = consumeSeparator(RStart, REnd)) { - if (SepEnd == REnd) - return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir, - Path.data(), RStart + 1); - // Check if we're seeing the root directory separator - auto PP = CreateBegin(Path); - bool InRootDir = PP.State == PS_InRootName && - &PP.RawEntry.back() == SepEnd; - return makeState(InRootDir ? PS_InRootDir : PS_InTrailingSep, - SepEnd + 1, RStart + 1); - } else { - PosPtr TkStart = consumeName(RStart, REnd); - if (TkStart == REnd + 2 && consumeSeparator(TkStart, REnd) == REnd) - return makeState(PS_InRootName, Path.data(), RStart + 1); - else - return makeState(PS_InFilenames, TkStart + 1, RStart + 1); - } - } - case PS_InTrailingSep: - return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1, RStart + 1); - case PS_InFilenames: { - PosPtr SepEnd = consumeSeparator(RStart, REnd); - if (SepEnd == REnd) - return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir, - Path.data(), RStart + 1); - PosPtr TkEnd = consumeName(SepEnd, REnd); - if (TkEnd == REnd + 2 && consumeSeparator(TkEnd, REnd) == REnd) - return makeState(PS_InRootDir, SepEnd + 1, RStart + 1); - return makeState(PS_InFilenames, TkEnd + 1, SepEnd + 1); - } - case PS_InRootDir: - return makeState(PS_InRootName, Path.data(), RStart + 1); - case PS_InRootName: - case PS_BeforeBegin: - _LIBCPP_UNREACHABLE(); - } - } - - /// \brief Return a view with the "preferred representation" of the current - /// element. For example trailing separators are represented as a '.' - string_view_t operator*() const noexcept { - switch (State) { - case PS_BeforeBegin: - case PS_AtEnd: - return ""; - case PS_InRootDir: - return "/"; - case PS_InTrailingSep: - return "."; - case PS_InRootName: - case PS_InFilenames: - return RawEntry; - } - _LIBCPP_UNREACHABLE(); - } - - explicit operator bool() const noexcept { - return State != PS_BeforeBegin && State != PS_AtEnd; - } - - PathParser& operator++() noexcept { - increment(); - return *this; - } - - PathParser& operator--() noexcept { - decrement(); - return *this; - } - -private: - void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept { - State = NewState; - RawEntry = string_view_t(Start, End - Start); - } - void makeState(ParserState NewState) noexcept { - State = NewState; - RawEntry = {}; - } - - PosPtr getAfterBack() const noexcept { - return Path.data() + Path.size(); - } - - PosPtr getBeforeFront() const noexcept { - return Path.data() - 1; - } - - /// \brief Return a pointer to the first character after the currently - /// lexed element. - PosPtr getNextTokenStartPos() const noexcept { - switch (State) { - case PS_BeforeBegin: - return Path.data(); - case PS_InRootName: - case PS_InRootDir: - case PS_InFilenames: - return &RawEntry.back() + 1; - case PS_InTrailingSep: - case PS_AtEnd: - return getAfterBack(); - } - _LIBCPP_UNREACHABLE(); - } - - /// \brief Return a pointer to the first character in the currently lexed - /// element. - PosPtr getCurrentTokenStartPos() const noexcept { - switch (State) { - case PS_BeforeBegin: - case PS_InRootName: - return &Path.front(); - case PS_InRootDir: - case PS_InFilenames: - case PS_InTrailingSep: - return &RawEntry.front(); - case PS_AtEnd: - return &Path.back() + 1; - } - _LIBCPP_UNREACHABLE(); - } - - PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept { - if (P == End || *P != '/') - return nullptr; - const int Inc = P < End ? 1 : -1; - P += Inc; - while (P != End && *P == '/') - P += Inc; - return P; - } - - PosPtr consumeName(PosPtr P, PosPtr End) const noexcept { - if (P == End || *P == '/') - return nullptr; - const int Inc = P < End ? 1 : -1; - P += Inc; - while (P != End && *P != '/') - P += Inc; - return P; - } -}; - -string_view_pair separate_filename(string_view_t const & s) { - if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""}; - auto pos = s.find_last_of('.'); - if (pos == string_view_t::npos) - return string_view_pair{s, string_view_t{}}; - return string_view_pair{s.substr(0, pos), s.substr(pos)}; -} - -string_view_t createView(PosPtr S, PosPtr E) noexcept { - return {S, static_cast<size_t>(E - S) + 1}; -} - -}} // namespace parser - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM - -using parser::string_view_t; -using parser::string_view_pair; -using parser::PathParser; -using parser::createView; - -/////////////////////////////////////////////////////////////////////////////// -// path definitions -/////////////////////////////////////////////////////////////////////////////// - -constexpr path::value_type path::preferred_separator; - -path & path::replace_extension(path const & replacement) -{ - path p = extension(); - if (not p.empty()) { - __pn_.erase(__pn_.size() - p.native().size()); - } - if (!replacement.empty()) { - if (replacement.native()[0] != '.') { - __pn_ += "."; - } - __pn_.append(replacement.__pn_); - } - return *this; -} - -/////////////////////////////////////////////////////////////////////////////// -// path.decompose - -string_view_t path::__root_name() const -{ - auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) - return *PP; - return {}; -} - -string_view_t path::__root_directory() const -{ - auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) - ++PP; - if (PP.State == PathParser::PS_InRootDir) - return *PP; - return {}; -} - -string_view_t path::__root_path_raw() const -{ - auto PP = PathParser::CreateBegin(__pn_); - if (PP.State == PathParser::PS_InRootName) { - auto NextCh = PP.peek(); - if (NextCh && *NextCh == '/') { - ++PP; - return createView(__pn_.data(), &PP.RawEntry.back()); - } - return PP.RawEntry; - } - if (PP.State == PathParser::PS_InRootDir) - return *PP; - return {}; -} - -string_view_t path::__relative_path() const -{ - auto PP = PathParser::CreateBegin(__pn_); - while (PP.State <= PathParser::PS_InRootDir) - ++PP; - if (PP.State == PathParser::PS_AtEnd) - return {}; - return createView(PP.RawEntry.data(), &__pn_.back()); -} - -string_view_t path::__parent_path() const -{ - if (empty()) - return {}; - auto PP = PathParser::CreateEnd(__pn_); - --PP; - if (PP.RawEntry.data() == __pn_.data()) - return {}; - --PP; - return createView(__pn_.data(), &PP.RawEntry.back()); -} - -string_view_t path::__filename() const -{ - if (empty()) return {}; - return *(--PathParser::CreateEnd(__pn_)); -} - -string_view_t path::__stem() const -{ - return parser::separate_filename(__filename()).first; -} - -string_view_t path::__extension() const -{ - return parser::separate_filename(__filename()).second; -} - -//////////////////////////////////////////////////////////////////////////// -// path.comparisons -int path::__compare(string_view_t __s) const { - auto PP = PathParser::CreateBegin(__pn_); - auto PP2 = PathParser::CreateBegin(__s); - while (PP && PP2) { - int res = (*PP).compare(*PP2); - if (res != 0) return res; - ++PP; ++PP2; - } - if (PP.State == PP2.State && PP.State == PathParser::PS_AtEnd) - return 0; - if (PP.State == PathParser::PS_AtEnd) - return -1; - return 1; -} - -//////////////////////////////////////////////////////////////////////////// -// path.nonmembers -size_t hash_value(const path& __p) noexcept { - auto PP = PathParser::CreateBegin(__p.native()); - size_t hash_value = 0; - std::hash<string_view_t> hasher; - while (PP) { - hash_value = __hash_combine(hash_value, hasher(*PP)); - ++PP; - } - return hash_value; -} - -//////////////////////////////////////////////////////////////////////////// -// path.itr -path::iterator path::begin() const -{ - auto PP = PathParser::CreateBegin(__pn_); - iterator it; - it.__path_ptr_ = this; - it.__state_ = PP.State; - it.__entry_ = PP.RawEntry; - it.__stashed_elem_.__assign_view(*PP); - return it; -} - -path::iterator path::end() const -{ - iterator it{}; - it.__state_ = PathParser::PS_AtEnd; - it.__path_ptr_ = this; - return it; -} - -path::iterator& path::iterator::__increment() { - static_assert(__at_end == PathParser::PS_AtEnd, ""); - PathParser PP(__path_ptr_->native(), __entry_, __state_); - ++PP; - __state_ = PP.State; - __entry_ = PP.RawEntry; - __stashed_elem_.__assign_view(*PP); - return *this; -} - -path::iterator& path::iterator::__decrement() { - PathParser PP(__path_ptr_->native(), __entry_, __state_); - --PP; - __state_ = PP.State; - __entry_ = PP.RawEntry; - __stashed_elem_.__assign_view(*PP); - return *this; -} - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM diff --git a/src/experimental/memory_resource.cpp b/src/experimental/memory_resource.cpp index c4dc1ca894a07..a3b64cc8b493f 100644 --- a/src/experimental/memory_resource.cpp +++ b/src/experimental/memory_resource.cpp @@ -31,10 +31,10 @@ public: protected: virtual void* do_allocate(size_t __size, size_t __align) - { return __allocate(__size); } + { return _VSTD::__libcpp_allocate(__size, __align); /* FIXME */} - virtual void do_deallocate(void * __p, size_t, size_t) - { _VSTD::__libcpp_deallocate(__p); } + virtual void do_deallocate(void * __p, size_t, size_t __align) + { _VSTD::__libcpp_deallocate(__p, __align); /* FIXME */ } virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT { return &__other == this; } @@ -68,12 +68,23 @@ union ResourceInitHelper { _LIBCPP_CONSTEXPR_AFTER_CXX11 ResourceInitHelper() : resources() {} ~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 __attribute__((init_priority (101))); +ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; } // end namespace diff --git a/src/filesystem/directory_iterator.cpp b/src/filesystem/directory_iterator.cpp new file mode 100644 index 0000000000000..f0d807a03db61 --- /dev/null +++ b/src/filesystem/directory_iterator.cpp @@ -0,0 +1,396 @@ +//===------------------ directory_iterator.cpp ----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "filesystem" +#include "__config" +#if defined(_LIBCPP_WIN32API) +#define WIN32_LEAN_AND_MEAN +#include <Windows.h> +#else +#include <dirent.h> +#endif +#include <errno.h> + +#include "filesystem_common.h" + +_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM + +namespace detail { +namespace { + +#if !defined(_LIBCPP_WIN32API) +template <class DirEntT, class = decltype(DirEntT::d_type)> +static file_type get_file_type(DirEntT* ent, int) { + switch (ent->d_type) { + case DT_BLK: + return file_type::block; + case DT_CHR: + return file_type::character; + case DT_DIR: + return file_type::directory; + case DT_FIFO: + return file_type::fifo; + case DT_LNK: + return file_type::symlink; + case DT_REG: + return file_type::regular; + case DT_SOCK: + return file_type::socket; + // Unlike in lstat, hitting "unknown" here simply means that the underlying + // filesystem doesn't support d_type. Report is as 'none' so we correctly + // set the cache to empty. + case DT_UNKNOWN: + break; + } + return file_type::none; +} + +template <class DirEntT> +static file_type get_file_type(DirEntT* ent, long) { + return file_type::none; +} + +static pair<string_view, file_type> posix_readdir(DIR* dir_stream, + error_code& ec) { + struct dirent* dir_entry_ptr = nullptr; + errno = 0; // zero errno in order to detect errors + ec.clear(); + if ((dir_entry_ptr = ::readdir(dir_stream)) == nullptr) { + if (errno) + ec = capture_errno(); + return {}; + } else { + return {dir_entry_ptr->d_name, get_file_type(dir_entry_ptr, 0)}; + } +} +#else + +static file_type get_file_type(const WIN32_FIND_DATA& data) { + //auto attrs = data.dwFileAttributes; + // FIXME(EricWF) + return file_type::unknown; +} +static uintmax_t get_file_size(const WIN32_FIND_DATA& data) { + return (data.nFileSizeHight * (MAXDWORD + 1)) + data.nFileSizeLow; +} +static file_time_type get_write_time(const WIN32_FIND_DATA& data) { + ULARGE_INTEGER tmp; + FILETIME& time = data.ftLastWriteTime; + tmp.u.LowPart = time.dwLowDateTime; + tmp.u.HighPart = time.dwHighDateTime; + return file_time_type(file_time_type::duration(time.QuadPart)); +} + +#endif + +} // namespace +} // namespace detail + +using detail::ErrorHandler; + +#if defined(_LIBCPP_WIN32API) +class __dir_stream { +public: + __dir_stream() = delete; + __dir_stream& operator=(const __dir_stream&) = delete; + + __dir_stream(__dir_stream&& __ds) noexcept : __stream_(__ds.__stream_), + __root_(move(__ds.__root_)), + __entry_(move(__ds.__entry_)) { + __ds.__stream_ = INVALID_HANDLE_VALUE; + } + + __dir_stream(const path& root, directory_options opts, error_code& ec) + : __stream_(INVALID_HANDLE_VALUE), __root_(root) { + __stream_ = ::FindFirstFileEx(root.c_str(), &__data_); + if (__stream_ == INVALID_HANDLE_VALUE) { + ec = error_code(::GetLastError(), generic_category()); + const bool ignore_permission_denied = + bool(opts & directory_options::skip_permission_denied); + if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED) + ec.clear(); + return; + } + } + + ~__dir_stream() noexcept { + if (__stream_ == INVALID_HANDLE_VALUE) + return; + close(); + } + + 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(get_file_type(__data))); + return true; + } + ec = error_code(::GetLastError(), generic_category()); + close(); + return false; + } + +private: + error_code close() noexcept { + error_code ec; + if (!::FindClose(__stream_)) + ec = error_code(::GetLastError(), generic_category()); + __stream_ = INVALID_HANDLE_VALUE; + return ec; + } + + HANDLE __stream_{INVALID_HANDLE_VALUE}; + WIN32_FIND_DATA __data_; + +public: + path __root_; + directory_entry __entry_; +}; +#else +class __dir_stream { +public: + __dir_stream() = delete; + __dir_stream& operator=(const __dir_stream&) = delete; + + __dir_stream(__dir_stream&& other) noexcept : __stream_(other.__stream_), + __root_(move(other.__root_)), + __entry_(move(other.__entry_)) { + other.__stream_ = nullptr; + } + + __dir_stream(const path& root, directory_options opts, error_code& ec) + : __stream_(nullptr), __root_(root) { + if ((__stream_ = ::opendir(root.c_str())) == nullptr) { + ec = detail::capture_errno(); + const bool allow_eacess = + bool(opts & directory_options::skip_permission_denied); + if (allow_eacess && ec.value() == EACCES) + ec.clear(); + return; + } + advance(ec); + } + + ~__dir_stream() noexcept { + if (__stream_) + close(); + } + + bool good() const noexcept { return __stream_ != nullptr; } + + bool advance(error_code& ec) { + while (true) { + auto str_type_pair = detail::posix_readdir(__stream_, ec); + auto& str = str_type_pair.first; + if (str == "." || str == "..") { + continue; + } else if (ec || str.empty()) { + close(); + return false; + } else { + __entry_.__assign_iter_entry( + __root_ / str, + directory_entry::__create_iter_result(str_type_pair.second)); + return true; + } + } + } + +private: + error_code close() noexcept { + error_code m_ec; + if (::closedir(__stream_) == -1) + m_ec = detail::capture_errno(); + __stream_ = nullptr; + return m_ec; + } + + DIR* __stream_{nullptr}; + +public: + path __root_; + directory_entry __entry_; +}; +#endif + +// directory_iterator + +directory_iterator::directory_iterator(const path& p, error_code* ec, + directory_options opts) { + ErrorHandler<void> err("directory_iterator::directory_iterator(...)", ec, &p); + + error_code m_ec; + __imp_ = make_shared<__dir_stream>(p, opts, m_ec); + if (ec) + *ec = m_ec; + if (!__imp_->good()) { + __imp_.reset(); + if (m_ec) + err.report(m_ec); + } +} + +directory_iterator& directory_iterator::__increment(error_code* ec) { + _LIBCPP_ASSERT(__imp_, "Attempting to increment an invalid iterator"); + ErrorHandler<void> err("directory_iterator::operator++()", ec); + + error_code m_ec; + if (!__imp_->advance(m_ec)) { + path root = move(__imp_->__root_); + __imp_.reset(); + if (m_ec) + err.report(m_ec, "at root \"%s\"", root); + } + return *this; +} + +directory_entry const& directory_iterator::__dereference() const { + _LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator"); + return __imp_->__entry_; +} + +// recursive_directory_iterator + +struct recursive_directory_iterator::__shared_imp { + stack<__dir_stream> __stack_; + directory_options __options_; +}; + +recursive_directory_iterator::recursive_directory_iterator( + const path& p, directory_options opt, error_code* ec) + : __imp_(nullptr), __rec_(true) { + ErrorHandler<void> err("recursive_directory_iterator", ec, &p); + + error_code m_ec; + __dir_stream new_s(p, opt, m_ec); + if (m_ec) + err.report(m_ec); + if (m_ec || !new_s.good()) + return; + + __imp_ = make_shared<__shared_imp>(); + __imp_->__options_ = opt; + __imp_->__stack_.push(move(new_s)); +} + +void recursive_directory_iterator::__pop(error_code* ec) { + _LIBCPP_ASSERT(__imp_, "Popping the end iterator"); + if (ec) + ec->clear(); + __imp_->__stack_.pop(); + if (__imp_->__stack_.size() == 0) + __imp_.reset(); + else + __advance(ec); +} + +directory_options recursive_directory_iterator::options() const { + return __imp_->__options_; +} + +int recursive_directory_iterator::depth() const { + return __imp_->__stack_.size() - 1; +} + +const directory_entry& recursive_directory_iterator::__dereference() const { + return __imp_->__stack_.top().__entry_; +} + +recursive_directory_iterator& +recursive_directory_iterator::__increment(error_code* ec) { + if (ec) + ec->clear(); + if (recursion_pending()) { + if (__try_recursion(ec) || (ec && *ec)) + return *this; + } + __rec_ = true; + __advance(ec); + return *this; +} + +void recursive_directory_iterator::__advance(error_code* ec) { + ErrorHandler<void> err("recursive_directory_iterator::operator++()", ec); + + const directory_iterator end_it; + auto& stack = __imp_->__stack_; + error_code m_ec; + while (stack.size() > 0) { + if (stack.top().advance(m_ec)) + return; + if (m_ec) + break; + stack.pop(); + } + + if (m_ec) { + path root = move(stack.top().__root_); + __imp_.reset(); + err.report(m_ec, "at root \"%s\"", root); + } else { + __imp_.reset(); + } +} + +bool recursive_directory_iterator::__try_recursion(error_code* ec) { + ErrorHandler<void> err("recursive_directory_iterator::operator++()", ec); + + bool rec_sym = bool(options() & directory_options::follow_directory_symlink); + + auto& curr_it = __imp_->__stack_.top(); + + bool skip_rec = false; + error_code m_ec; + if (!rec_sym) { + file_status st(curr_it.__entry_.__get_sym_ft(&m_ec)); + if (m_ec && status_known(st)) + m_ec.clear(); + if (m_ec || is_symlink(st) || !is_directory(st)) + skip_rec = true; + } else { + file_status st(curr_it.__entry_.__get_ft(&m_ec)); + if (m_ec && status_known(st)) + m_ec.clear(); + if (m_ec || !is_directory(st)) + skip_rec = true; + } + + if (!skip_rec) { + __dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec); + if (new_it.good()) { + __imp_->__stack_.push(move(new_it)); + return true; + } + } + if (m_ec) { + const bool allow_eacess = + bool(__imp_->__options_ & directory_options::skip_permission_denied); + if (m_ec.value() == EACCES && allow_eacess) { + if (ec) + ec->clear(); + } else { + path at_ent = move(curr_it.__entry_.__p_); + __imp_.reset(); + err.report(m_ec, "attempting recursion into \"%s\"", at_ent); + } + } + return false; +} + +_LIBCPP_END_NAMESPACE_FILESYSTEM diff --git a/src/filesystem/filesystem_common.h b/src/filesystem/filesystem_common.h new file mode 100644 index 0000000000000..ed92877c425c3 --- /dev/null +++ b/src/filesystem/filesystem_common.h @@ -0,0 +1,429 @@ +//===----------------------------------------------------------------------===//// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===//// + +#ifndef FILESYSTEM_COMMON_H +#define FILESYSTEM_COMMON_H + +#include "__config" +#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 "../include/apple_availability.h" + +#if !defined(__APPLE__) +// We can use the presence of UTIME_OMIT to detect platforms that provide +// utimensat. +#if defined(UTIME_OMIT) +#define _LIBCPP_USE_UTIMENSAT +#endif +#endif + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +#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); + + array<char, 256> local_buff; + size_t size = local_buff.size(); + auto ret = ::vsnprintf(local_buff.data(), size, msg, args_cp); + + args_copy_guard.clear(); + + // handle empty expansion + if (ret == 0) + return string{}; + if (static_cast<size_t>(ret) < size) + return string(local_buff.data()); + + // we did not provide a long enough buffer on our first attempt. + // add 1 to size to account for null-byte in size cast to prevent overflow + size = static_cast<size_t>(ret) + 1; + auto buff_ptr = unique_ptr<char[]>(new char[size]); + ret = ::vsnprintf(buff_ptr.get(), size, msg, args); + return string(buff_ptr.get()); +} + +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)...); +} + +error_code capture_errno() { + _LIBCPP_ASSERT(errno, "Expected errno to be non-zero"); + return error_code(errno, generic_category()); +} + +template <class T> +T error_value(); +template <> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void error_value<void>() {} +template <> +bool error_value<bool>() { + return false; +} +template <> +uintmax_t error_value<uintmax_t>() { + return uintmax_t(-1); +} +template <> +_LIBCPP_CONSTEXPR_AFTER_CXX11 file_time_type error_value<file_time_type>() { + return file_time_type::min(); +} +template <> +path error_value<path>() { + return {}; +} + +template <class T> +struct ErrorHandler { + 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(); + } + + T report(const error_code& m_ec) const { + if (ec) { + *ec = m_ec; + return error_value<T>(); + } + string what = string("in ") + func_name; + switch (bool(p1) + bool(p2)) { + case 0: + __throw_filesystem_error(what, m_ec); + case 1: + __throw_filesystem_error(what, *p1, m_ec); + case 2: + __throw_filesystem_error(what, *p1, *p2, m_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>(); + } + string what = + string("in ") + func_name + ": " + format_string(msg, args...); + switch (bool(p1) + bool(p2)) { + case 0: + __throw_filesystem_error(what, m_ec); + case 1: + __throw_filesystem_error(what, *p1, m_ec); + case 2: + __throw_filesystem_error(what, *p1, *p2, m_ec); + } + _LIBCPP_UNREACHABLE(); + } + + T report(errc const& err) const { return report(make_error_code(err)); } + + template <class... Args> + T report(errc const& err, const char* msg, Args const&... args) const { + return report(make_error_code(err), msg, args...); + } + +private: + ErrorHandler(ErrorHandler const&) = delete; + ErrorHandler& operator=(ErrorHandler const&) = delete; +}; + +using chrono::duration; +using chrono::duration_cast; + +using TimeSpec = struct ::timespec; +using StatT = struct ::stat; + +template <class FileTimeT, class TimeT, + bool IsFloat = is_floating_point<typename FileTimeT::rep>::value> +struct time_util_base { + using rep = typename FileTimeT::rep; + using fs_duration = typename FileTimeT::duration; + using fs_seconds = duration<rep>; + using fs_nanoseconds = duration<rep, nano>; + using fs_microseconds = duration<rep, micro>; + + static constexpr rep max_seconds = + duration_cast<fs_seconds>(FileTimeT::duration::max()).count(); + + static constexpr rep max_nsec = + duration_cast<fs_nanoseconds>(FileTimeT::duration::max() - + fs_seconds(max_seconds)) + .count(); + + static constexpr rep min_seconds = + duration_cast<fs_seconds>(FileTimeT::duration::min()).count(); + + static constexpr rep min_nsec_timespec = + duration_cast<fs_nanoseconds>( + (FileTimeT::duration::min() - fs_seconds(min_seconds)) + + fs_seconds(1)) + .count(); + +private: +#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) + static constexpr fs_duration get_min_nsecs() { + return duration_cast<fs_duration>( + fs_nanoseconds(min_nsec_timespec) - + duration_cast<fs_nanoseconds>(fs_seconds(1))); + } + // Static assert that these values properly round trip. + static_assert(fs_seconds(min_seconds) + get_min_nsecs() == + FileTimeT::duration::min(), + "value doesn't roundtrip"); + + static constexpr 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; + return duration_cast<Years>(fs_seconds(max_seconds)) > Years(250) && + duration_cast<Years>(fs_seconds(min_seconds)) < Years(-250); + } + return max_seconds >= numeric_limits<TimeT>::max() && + min_seconds <= numeric_limits<TimeT>::min(); + } + static_assert(check_range(), "the representable range is unacceptable small"); +#endif +}; + +template <class FileTimeT, class TimeT> +struct time_util_base<FileTimeT, TimeT, true> { + using rep = typename FileTimeT::rep; + using fs_duration = typename FileTimeT::duration; + using fs_seconds = duration<rep>; + using fs_nanoseconds = duration<rep, nano>; + using fs_microseconds = duration<rep, micro>; + + static const rep max_seconds; + static const rep max_nsec; + static const rep min_seconds; + static const rep min_nsec_timespec; +}; + +template <class FileTimeT, class TimeT> +const typename FileTimeT::rep + time_util_base<FileTimeT, TimeT, true>::max_seconds = + duration_cast<fs_seconds>(FileTimeT::duration::max()).count(); + +template <class FileTimeT, class TimeT> +const typename FileTimeT::rep time_util_base<FileTimeT, TimeT, true>::max_nsec = + duration_cast<fs_nanoseconds>(FileTimeT::duration::max() - + fs_seconds(max_seconds)) + .count(); + +template <class FileTimeT, class TimeT> +const typename FileTimeT::rep + time_util_base<FileTimeT, TimeT, true>::min_seconds = + duration_cast<fs_seconds>(FileTimeT::duration::min()).count(); + +template <class FileTimeT, class TimeT> +const typename FileTimeT::rep + time_util_base<FileTimeT, TimeT, true>::min_nsec_timespec = + duration_cast<fs_nanoseconds>((FileTimeT::duration::min() - + fs_seconds(min_seconds)) + + fs_seconds(1)) + .count(); + +template <class FileTimeT, class TimeT, class TimeSpecT> +struct time_util : time_util_base<FileTimeT, TimeT> { + using Base = time_util_base<FileTimeT, TimeT>; + using Base::max_nsec; + using Base::max_seconds; + using Base::min_nsec_timespec; + using Base::min_seconds; + + using typename Base::fs_duration; + using typename Base::fs_microseconds; + using typename Base::fs_nanoseconds; + using typename Base::fs_seconds; + +public: + template <class CType, class ChronoType> + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool checked_set(CType* out, + ChronoType time) { + using Lim = numeric_limits<CType>; + if (time > Lim::max() || time < Lim::min()) + return false; + *out = static_cast<CType>(time); + return true; + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(TimeSpecT tm) { + if (tm.tv_sec >= 0) { + return tm.tv_sec < max_seconds || + (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec); + } else if (tm.tv_sec == (min_seconds - 1)) { + return tm.tv_nsec >= min_nsec_timespec; + } else { + return tm.tv_sec >= min_seconds; + } + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool is_representable(FileTimeT tm) { + auto secs = duration_cast<fs_seconds>(tm.time_since_epoch()); + auto nsecs = duration_cast<fs_nanoseconds>(tm.time_since_epoch() - secs); + if (nsecs.count() < 0) { + secs = secs + fs_seconds(1); + nsecs = nsecs + fs_seconds(1); + } + using TLim = numeric_limits<TimeT>; + if (secs.count() >= 0) + return secs.count() <= TLim::max(); + return secs.count() >= TLim::min(); + } + + static _LIBCPP_CONSTEXPR_AFTER_CXX11 FileTimeT + convert_from_timespec(TimeSpecT tm) { + if (tm.tv_sec >= 0 || tm.tv_nsec == 0) { + return FileTimeT(fs_seconds(tm.tv_sec) + + duration_cast<fs_duration>(fs_nanoseconds(tm.tv_nsec))); + } else { // tm.tv_sec < 0 + auto adj_subsec = duration_cast<fs_duration>(fs_seconds(1) - + fs_nanoseconds(tm.tv_nsec)); + auto Dur = fs_seconds(tm.tv_sec + 1) - adj_subsec; + return FileTimeT(Dur); + } + } + + template <class SubSecT> + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool + set_times_checked(TimeT* sec_out, SubSecT* subsec_out, FileTimeT tp) { + auto dur = tp.time_since_epoch(); + auto sec_dur = duration_cast<fs_seconds>(dur); + auto subsec_dur = duration_cast<fs_nanoseconds>(dur - sec_dur); + // The tv_nsec and tv_usec fields must not be negative so adjust accordingly + if (subsec_dur.count() < 0) { + if (sec_dur.count() > min_seconds) { + sec_dur = sec_dur - fs_seconds(1); + subsec_dur = subsec_dur + fs_seconds(1); + } else { + subsec_dur = fs_nanoseconds::zero(); + } + } + return checked_set(sec_out, sec_dur.count()) && + checked_set(subsec_out, subsec_dur.count()); + } + static _LIBCPP_CONSTEXPR_AFTER_CXX11 bool convert_to_timespec(TimeSpecT& dest, + FileTimeT tp) { + if (!is_representable(tp)) + return false; + return set_times_checked(&dest.tv_sec, &dest.tv_nsec, tp); + } +}; + +using fs_time = time_util<file_time_type, time_t, TimeSpec>; + +#if defined(__APPLE__) +TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; } +TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; } +#else +TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; } +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) { + using namespace chrono; + auto Convert = [](long nsec) { + 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)}}; + if (::utimes(p.c_str(), ConvertedTS) == -1) { + ec = capture_errno(); + return true; + } + return false; +} + +#if defined(_LIBCPP_USE_UTIMENSAT) +bool posix_utimensat(const path& p, std::array<TimeSpec, 2> const& TS, + error_code& ec) { + if (::utimensat(AT_FDCWD, p.c_str(), TS.data(), 0) == -1) { + ec = capture_errno(); + return true; + } + return false; +} +#endif + +bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS, + error_code& ec) { +#if !defined(_LIBCPP_USE_UTIMENSAT) + return posix_utimes(p, TS, ec); +#else + return posix_utimensat(p, TS, ec); +#endif +} + +} // namespace +} // end namespace detail + +_LIBCPP_END_NAMESPACE_FILESYSTEM + +#endif // FILESYSTEM_COMMON_H diff --git a/src/filesystem/int128_builtins.cpp b/src/filesystem/int128_builtins.cpp new file mode 100644 index 0000000000000..66adbdd2dc89e --- /dev/null +++ b/src/filesystem/int128_builtins.cpp @@ -0,0 +1,55 @@ +/*===-- int128_builtins.cpp - Implement __muloti4 --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __muloti4, and is stolen from the compiler_rt library. + * + * FIXME: we steal and re-compile it into filesystem, which uses __int128_t, + * and requires this builtin when sanitized. See llvm.org/PR30643 + * + * ===----------------------------------------------------------------------=== + */ +#include "__config" +#include "climits" + +#if !defined(_LIBCPP_HAS_NO_INT128) + +extern "C" __attribute__((no_sanitize("undefined"))) +__int128_t __muloti4(__int128_t a, __int128_t b, int* overflow) { + const int N = (int)(sizeof(__int128_t) * CHAR_BIT); + const __int128_t MIN = (__int128_t)1 << (N - 1); + const __int128_t MAX = ~MIN; + *overflow = 0; + __int128_t result = a * b; + if (a == MIN) { + if (b != 0 && b != 1) + *overflow = 1; + return result; + } + if (b == MIN) { + if (a != 0 && a != 1) + *overflow = 1; + return result; + } + __int128_t sa = a >> (N - 1); + __int128_t abs_a = (a ^ sa) - sa; + __int128_t sb = b >> (N - 1); + __int128_t abs_b = (b ^ sb) - sb; + if (abs_a < 2 || abs_b < 2) + return result; + if (sa == sb) { + if (abs_a > MAX / abs_b) + *overflow = 1; + } else { + if (abs_a > MIN / -abs_b) + *overflow = 1; + } + return result; +} + +#endif diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp new file mode 100644 index 0000000000000..65a4b319339b5 --- /dev/null +++ b/src/filesystem/operations.cpp @@ -0,0 +1,1686 @@ +//===--------------------- filesystem/ops.cpp -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "filesystem" +#include "array" +#include "iterator" +#include "fstream" +#include "random" /* for unique_path */ +#include "string_view" +#include "type_traits" +#include "vector" +#include "cstdlib" +#include "climits" + +#include "filesystem_common.h" + +#include <unistd.h> +#include <sys/stat.h> +#include <sys/statvfs.h> +#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 +#elif defined(__APPLE__) || __has_include(<copyfile.h>) +#include <copyfile.h> +#define _LIBCPP_USE_COPYFILE +#endif + +#if !defined(__APPLE__) +#define _LIBCPP_USE_CLOCK_GETTIME +#endif + +#if !defined(CLOCK_REALTIME) || !defined(_LIBCPP_USE_CLOCK_GETTIME) +#include <sys/time.h> // for gettimeofday and timeval +#endif // !defined(CLOCK_REALTIME) + +#if defined(_LIBCPP_COMPILER_GCC) +#if _GNUC_VER < 500 +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif +#endif + +_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM + +namespace { +namespace parser { + +using string_view_t = path::__string_view; +using string_view_pair = pair<string_view_t, string_view_t>; +using PosPtr = path::value_type const*; + +struct PathParser { + enum ParserState : unsigned char { + // Zero is a special sentinel value used by default constructed iterators. + PS_BeforeBegin = path::iterator::_BeforeBegin, + PS_InRootName = path::iterator::_InRootName, + PS_InRootDir = path::iterator::_InRootDir, + PS_InFilenames = path::iterator::_InFilenames, + PS_InTrailingSep = path::iterator::_InTrailingSep, + PS_AtEnd = path::iterator::_AtEnd + }; + + const string_view_t Path; + string_view_t RawEntry; + ParserState State; + +private: + PathParser(string_view_t P, ParserState State) noexcept : Path(P), + State(State) {} + +public: + PathParser(string_view_t P, string_view_t E, unsigned char S) + : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) { + // S cannot be '0' or PS_BeforeBegin. + } + + static PathParser CreateBegin(string_view_t P) noexcept { + PathParser PP(P, PS_BeforeBegin); + PP.increment(); + return PP; + } + + static PathParser CreateEnd(string_view_t P) noexcept { + PathParser PP(P, PS_AtEnd); + return PP; + } + + PosPtr peek() const noexcept { + auto TkEnd = getNextTokenStartPos(); + auto End = getAfterBack(); + return TkEnd == End ? nullptr : TkEnd; + } + + void increment() noexcept { + const PosPtr End = getAfterBack(); + const PosPtr Start = getNextTokenStartPos(); + if (Start == End) + return makeState(PS_AtEnd); + + switch (State) { + case PS_BeforeBegin: { + PosPtr TkEnd = consumeSeparator(Start, End); + if (TkEnd) + return makeState(PS_InRootDir, Start, TkEnd); + else + return makeState(PS_InFilenames, Start, consumeName(Start, End)); + } + case PS_InRootDir: + return makeState(PS_InFilenames, Start, consumeName(Start, End)); + + case PS_InFilenames: { + PosPtr SepEnd = consumeSeparator(Start, End); + if (SepEnd != End) { + PosPtr TkEnd = consumeName(SepEnd, End); + if (TkEnd) + return makeState(PS_InFilenames, SepEnd, TkEnd); + } + return makeState(PS_InTrailingSep, Start, SepEnd); + } + + case PS_InTrailingSep: + return makeState(PS_AtEnd); + + case PS_InRootName: + case PS_AtEnd: + _LIBCPP_UNREACHABLE(); + } + } + + void decrement() noexcept { + const PosPtr REnd = getBeforeFront(); + const PosPtr RStart = getCurrentTokenStartPos() - 1; + if (RStart == REnd) // we're decrementing the begin + return makeState(PS_BeforeBegin); + + switch (State) { + case PS_AtEnd: { + // Try to consume a trailing separator or root directory first. + if (PosPtr SepEnd = consumeSeparator(RStart, REnd)) { + if (SepEnd == REnd) + return makeState(PS_InRootDir, Path.data(), RStart + 1); + return makeState(PS_InTrailingSep, SepEnd + 1, RStart + 1); + } else { + PosPtr TkStart = consumeName(RStart, REnd); + return makeState(PS_InFilenames, TkStart + 1, RStart + 1); + } + } + case PS_InTrailingSep: + return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1, + RStart + 1); + case PS_InFilenames: { + PosPtr SepEnd = consumeSeparator(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); + } + case PS_InRootDir: + // return makeState(PS_InRootName, Path.data(), RStart + 1); + case PS_InRootName: + case PS_BeforeBegin: + _LIBCPP_UNREACHABLE(); + } + } + + /// \brief Return a view with the "preferred representation" of the current + /// element. For example trailing separators are represented as a '.' + string_view_t operator*() const noexcept { + switch (State) { + case PS_BeforeBegin: + case PS_AtEnd: + return ""; + case PS_InRootDir: + return "/"; + case PS_InTrailingSep: + return ""; + case PS_InRootName: + case PS_InFilenames: + return RawEntry; + } + _LIBCPP_UNREACHABLE(); + } + + explicit operator bool() const noexcept { + return State != PS_BeforeBegin && State != PS_AtEnd; + } + + PathParser& operator++() noexcept { + increment(); + return *this; + } + + PathParser& operator--() noexcept { + decrement(); + return *this; + } + + bool inRootPath() const noexcept { + return State == PS_InRootDir || State == PS_InRootName; + } + +private: + void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept { + State = NewState; + RawEntry = string_view_t(Start, End - Start); + } + void makeState(ParserState NewState) noexcept { + State = NewState; + RawEntry = {}; + } + + PosPtr getAfterBack() const noexcept { return Path.data() + Path.size(); } + + PosPtr getBeforeFront() const noexcept { return Path.data() - 1; } + + /// \brief Return a pointer to the first character after the currently + /// lexed element. + PosPtr getNextTokenStartPos() const noexcept { + switch (State) { + case PS_BeforeBegin: + return Path.data(); + case PS_InRootName: + case PS_InRootDir: + case PS_InFilenames: + return &RawEntry.back() + 1; + case PS_InTrailingSep: + case PS_AtEnd: + return getAfterBack(); + } + _LIBCPP_UNREACHABLE(); + } + + /// \brief Return a pointer to the first character in the currently lexed + /// element. + PosPtr getCurrentTokenStartPos() const noexcept { + switch (State) { + case PS_BeforeBegin: + case PS_InRootName: + return &Path.front(); + case PS_InRootDir: + case PS_InFilenames: + case PS_InTrailingSep: + return &RawEntry.front(); + case PS_AtEnd: + return &Path.back() + 1; + } + _LIBCPP_UNREACHABLE(); + } + + PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept { + if (P == End || *P != '/') + return nullptr; + const int Inc = P < End ? 1 : -1; + P += Inc; + while (P != End && *P == '/') + P += Inc; + return P; + } + + PosPtr consumeName(PosPtr P, PosPtr End) const noexcept { + if (P == End || *P == '/') + return nullptr; + const int Inc = P < End ? 1 : -1; + P += Inc; + while (P != End && *P != '/') + P += Inc; + return P; + } +}; + +string_view_pair separate_filename(string_view_t const& s) { + if (s == "." || s == ".." || s.empty()) + return string_view_pair{s, ""}; + auto pos = s.find_last_of('.'); + if (pos == string_view_t::npos || pos == 0) + return string_view_pair{s, string_view_t{}}; + return string_view_pair{s.substr(0, pos), s.substr(pos)}; +} + +string_view_t createView(PosPtr S, PosPtr E) noexcept { + return {S, static_cast<size_t>(E - S) + 1}; +} + +} // namespace parser +} // namespace + +// POSIX HELPERS + +namespace detail { +namespace { + +using value_type = path::value_type; +using string_type = path::string_type; + +struct FileDescriptor { + const path& name; + int fd = -1; + StatT m_stat; + file_status m_status; + + template <class... Args> + static FileDescriptor create(const path* p, error_code& ec, Args... args) { + ec.clear(); + int fd; + if ((fd = ::open(p->c_str(), args...)) == -1) { + ec = capture_errno(); + return FileDescriptor{p}; + } + return FileDescriptor(p, fd); + } + + template <class... Args> + static FileDescriptor create_with_status(const path* p, error_code& ec, + Args... args) { + FileDescriptor fd = create(p, ec, args...); + if (!ec) + fd.refresh_status(ec); + + return fd; + } + + file_status get_status() const { return m_status; } + StatT const& get_stat() const { return m_stat; } + + bool status_known() const { return _VSTD_FS::status_known(m_status); } + + file_status refresh_status(error_code& ec); + + void close() noexcept { + if (fd != -1) + ::close(fd); + fd = -1; + } + + FileDescriptor(FileDescriptor&& other) + : name(other.name), fd(other.fd), m_stat(other.m_stat), + m_status(other.m_status) { + other.fd = -1; + other.m_status = file_status{}; + } + + ~FileDescriptor() { close(); } + + FileDescriptor() = default; + FileDescriptor(FileDescriptor const&) = delete; + FileDescriptor& operator=(FileDescriptor const&) = delete; + +private: + explicit FileDescriptor(const path* p, int fd = -1) : name(*p), fd(fd) {} +}; + +perms posix_get_perms(const StatT& st) noexcept { + 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) + *ec = m_ec; + if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) { + return file_status(file_type::not_found); + } else if (m_ec) { + ErrorHandler<void> err("posix_stat", ec, &p); + err.report(m_ec, "failed to determine attributes for the specified path"); + return file_status(file_type::none); + } + // else + + file_status fs_tmp; + auto const mode = path_stat.st_mode; + if (S_ISLNK(mode)) + fs_tmp.type(file_type::symlink); + else if (S_ISREG(mode)) + fs_tmp.type(file_type::regular); + else if (S_ISDIR(mode)) + fs_tmp.type(file_type::directory); + else if (S_ISBLK(mode)) + fs_tmp.type(file_type::block); + else if (S_ISCHR(mode)) + fs_tmp.type(file_type::character); + else if (S_ISFIFO(mode)) + fs_tmp.type(file_type::fifo); + else if (S_ISSOCK(mode)) + fs_tmp.type(file_type::socket); + else + fs_tmp.type(file_type::unknown); + + fs_tmp.permissions(detail::posix_get_perms(path_stat)); + return fs_tmp; +} + +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) + m_ec = detail::capture_errno(); + return create_file_status(m_ec, p, path_stat, ec); +} + +file_status posix_stat(path const& p, error_code* ec) { + StatT path_stat; + return posix_stat(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) + m_ec = detail::capture_errno(); + return create_file_status(m_ec, p, path_stat, ec); +} + +file_status posix_lstat(path const& p, error_code* ec) { + StatT path_stat; + return posix_lstat(p, path_stat, ec); +} + +bool posix_ftruncate(const FileDescriptor& fd, size_t to_size, error_code& ec) { + if (::ftruncate(fd.fd, to_size) == -1) { + ec = capture_errno(); + return true; + } + ec.clear(); + return false; +} + +bool posix_fchmod(const FileDescriptor& fd, const StatT& st, error_code& ec) { + if (::fchmod(fd.fd, st.st_mode) == -1) { + ec = capture_errno(); + return true; + } + ec.clear(); + return false; +} + +bool stat_equivalent(const StatT& st1, const StatT& st2) { + return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino); +} + +file_status FileDescriptor::refresh_status(error_code& ec) { + // FD must be open and good. + m_status = file_status{}; + m_stat = {}; + error_code m_ec; + if (::fstat(fd, &m_stat) == -1) + m_ec = capture_errno(); + m_status = create_file_status(m_ec, name, m_stat, &ec); + return m_status; +} +} // namespace +} // end namespace detail + +using detail::capture_errno; +using detail::ErrorHandler; +using detail::StatT; +using detail::TimeSpec; +using parser::createView; +using parser::PathParser; +using parser::string_view_t; + +const bool _FilesystemClock::is_steady; + +_FilesystemClock::time_point _FilesystemClock::now() noexcept { + typedef chrono::duration<rep> __secs; +#if defined(_LIBCPP_USE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) + typedef chrono::duration<rep, nano> __nsecs; + struct timespec tp; + if (0 != clock_gettime(CLOCK_REALTIME, &tp)) + __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed"); + return time_point(__secs(tp.tv_sec) + + chrono::duration_cast<duration>(__nsecs(tp.tv_nsec))); +#else + typedef chrono::duration<rep, micro> __microsecs; + timeval tv; + gettimeofday(&tv, 0); + return time_point(__secs(tv.tv_sec) + __microsecs(tv.tv_usec)); +#endif // _LIBCPP_USE_CLOCK_GETTIME && CLOCK_REALTIME +} + +filesystem_error::~filesystem_error() {} + +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: + return detail::format_string("filesystem error: %s", derived_what); + case 1: + return detail::format_string("filesystem error: %s [%s]", derived_what, + p1); + case 2: + return detail::format_string("filesystem error: %s [%s] [%s]", + derived_what, p1, p2); + } + }(); +} + +static path __do_absolute(const path& p, path* cwd, error_code* ec) { + if (ec) + ec->clear(); + if (p.is_absolute()) + return p; + *cwd = __current_path(ec); + if (ec && *ec) + return {}; + return (*cwd) / p; +} + +path __absolute(const path& p, error_code* ec) { + path cwd; + return __do_absolute(p, &cwd, ec); +} + +path __canonical(path const& orig_p, error_code* ec) { + path cwd; + ErrorHandler<path> err("canonical", ec, &orig_p, &cwd); + + path p = __do_absolute(orig_p, &cwd, ec); + char buff[PATH_MAX + 1]; + char* ret; + if ((ret = ::realpath(p.c_str(), buff)) == nullptr) + return err.report(capture_errno()); + return {ret}; +} + +void __copy(const path& from, const path& to, copy_options options, + error_code* ec) { + ErrorHandler<void> err("copy", ec, &from, &to); + + const bool sym_status = bool( + options & (copy_options::create_symlinks | copy_options::skip_symlinks)); + + const bool sym_status2 = bool(options & copy_options::copy_symlinks); + + error_code m_ec1; + StatT f_st = {}; + const file_status f = sym_status || sym_status2 + ? detail::posix_lstat(from, f_st, &m_ec1) + : detail::posix_stat(from, f_st, &m_ec1); + if (m_ec1) + return err.report(m_ec1); + + StatT t_st = {}; + const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec1) + : detail::posix_stat(to, t_st, &m_ec1); + + if (not status_known(t)) + return err.report(m_ec1); + + if (!exists(f) || is_other(f) || is_other(t) || + (is_directory(f) && is_regular_file(t)) || + detail::stat_equivalent(f_st, t_st)) { + return err.report(errc::function_not_supported); + } + + if (ec) + ec->clear(); + + if (is_symlink(f)) { + if (bool(copy_options::skip_symlinks & options)) { + // do nothing + } else if (not exists(t)) { + __copy_symlink(from, to, ec); + } else { + return err.report(errc::file_exists); + } + return; + } else if (is_regular_file(f)) { + if (bool(copy_options::directories_only & options)) { + // do nothing + } else if (bool(copy_options::create_symlinks & options)) { + __create_symlink(from, to, ec); + } else if (bool(copy_options::create_hard_links & options)) { + __create_hard_link(from, to, ec); + } else if (is_directory(t)) { + __copy_file(from, to / from.filename(), options, ec); + } else { + __copy_file(from, to, options, ec); + } + return; + } else if (is_directory(f) && bool(copy_options::create_symlinks & options)) { + return err.report(errc::is_a_directory); + } else if (is_directory(f) && (bool(copy_options::recursive & options) || + copy_options::none == options)) { + + if (!exists(t)) { + // create directory to with attributes from 'from'. + __create_directory(to, from, ec); + if (ec && *ec) { + return; + } + } + directory_iterator it = + ec ? directory_iterator(from, *ec) : directory_iterator(from); + if (ec && *ec) { + return; + } + error_code m_ec2; + for (; it != directory_iterator(); it.increment(m_ec2)) { + if (m_ec2) { + return err.report(m_ec2); + } + __copy(it->path(), to / it->path().filename(), + options | copy_options::__in_recursive_copy, ec); + if (ec && *ec) { + return; + } + } + } +} + +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(); + + 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; + }; + + CopyFileState cfs; + if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) { + ec = capture_errno(); + return false; + } + + ec.clear(); + return true; +} +#endif + +// 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; + } + + 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); +#else + return copy_file_impl_default(from, to, ec); +#endif +} + +} // namespace +} // namespace detail + +bool __copy_file(const path& from, const path& to, copy_options options, + error_code* ec) { + using detail::FileDescriptor; + 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); + if (m_ec) + return err.report(m_ec); + + auto from_st = from_fd.get_status(); + StatT const& from_stat = from_fd.get_stat(); + if (!is_regular_file(from_st)) { + if (not m_ec) + m_ec = make_error_code(errc::not_supported); + return err.report(m_ec); + } + + const bool skip_existing = bool(copy_options::skip_existing & options); + const bool update_existing = bool(copy_options::update_existing & options); + const bool overwrite_existing = + bool(copy_options::overwrite_existing & options); + + StatT to_stat_path; + file_status to_st = detail::posix_stat(to, to_stat_path, &m_ec); + if (!status_known(to_st)) + return err.report(m_ec); + + const bool to_exists = exists(to_st); + if (to_exists && !is_regular_file(to_st)) + return err.report(errc::not_supported); + + if (to_exists && detail::stat_equivalent(from_stat, to_stat_path)) + return err.report(errc::file_exists); + + if (to_exists && skip_existing) + return false; + + bool ShouldCopy = [&]() { + if (to_exists && update_existing) { + auto from_time = detail::extract_mtime(from_stat); + auto to_time = detail::extract_mtime(to_stat_path); + if (from_time.tv_sec < to_time.tv_sec) + return false; + if (from_time.tv_sec == to_time.tv_sec && + from_time.tv_nsec <= to_time.tv_nsec) + return false; + return true; + } + if (!to_exists || overwrite_existing) + return true; + return err.report(errc::file_exists); + }(); + if (!ShouldCopy) + return false; + + // 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; + if (!to_exists) + to_open_flags |= O_CREAT; + FileDescriptor to_fd = FileDescriptor::create_with_status( + &to, m_ec, to_open_flags, from_stat.st_mode); + if (m_ec) + return err.report(m_ec); + + if (to_exists) { + // Check that the file we initially stat'ed is equivalent to the one + // we opened. + // FIXME: report this better. + if (!detail::stat_equivalent(to_stat_path, to_fd.get_stat())) + return err.report(errc::bad_file_descriptor); + + // Set the permissions and truncate the file we opened. + if (detail::posix_fchmod(to_fd, from_stat, m_ec)) + return err.report(m_ec); + if (detail::posix_ftruncate(to_fd, 0, m_ec)) + return err.report(m_ec); + } + + if (!copy_file_impl(from_fd, to_fd, m_ec)) { + // FIXME: Remove the dest file if we failed, and it didn't exist previously. + return err.report(m_ec); + } + + return true; +} + +void __copy_symlink(const path& existing_symlink, const path& new_symlink, + error_code* ec) { + const path real_path(__read_symlink(existing_symlink, ec)); + 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); +} + +bool __create_directories(const path& p, error_code* ec) { + ErrorHandler<bool> err("create_directories", ec, &p); + + error_code m_ec; + auto const st = detail::posix_stat(p, &m_ec); + if (!status_known(st)) + return err.report(m_ec); + else if (is_directory(st)) + return false; + else if (exists(st)) + return err.report(errc::file_exists); + + const path parent = p.parent_path(); + if (!parent.empty()) { + const file_status parent_st = status(parent, m_ec); + if (not status_known(parent_st)) + return err.report(m_ec); + if (not exists(parent_st)) { + __create_directories(parent, ec); + if (ec && *ec) { + return false; + } + } + } + return __create_directory(p, ec); +} + +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) + return true; + if (errno != EEXIST) + err.report(capture_errno()); + return false; +} + +bool __create_directory(path const& p, path const& attributes, error_code* ec) { + ErrorHandler<bool> err("create_directory", ec, &p, &attributes); + + StatT attr_stat; + error_code mec; + auto 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) + return true; + if (errno != EEXIST) + err.report(capture_errno()); + 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) + 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) + 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) + return err.report(capture_errno()); +} + +path __current_path(error_code* ec) { + ErrorHandler<path> err("current_path", ec); + + 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) + return err.report(capture_errno(), "call to getcwd failed"); + + return {buff.get()}; +} + +void __current_path(const path& p, error_code* ec) { + ErrorHandler<void> err("current_path", ec, &p); + if (::chdir(p.c_str()) == -1) + err.report(capture_errno()); +} + +bool __equivalent(const path& p1, const path& p2, error_code* ec) { + ErrorHandler<bool> err("equivalent", ec, &p1, &p2); + + error_code ec1, ec2; + StatT st1 = {}, st2 = {}; + auto s1 = detail::posix_stat(p1.native(), st1, &ec1); + if (!exists(s1)) + return err.report(errc::not_supported); + auto s2 = detail::posix_stat(p2.native(), st2, &ec2); + if (!exists(s2)) + return err.report(errc::not_supported); + + return detail::stat_equivalent(st1, st2); +} + +uintmax_t __file_size(const path& p, error_code* ec) { + ErrorHandler<uintmax_t> err("file_size", ec, &p); + + error_code m_ec; + StatT st; + file_status fst = detail::posix_stat(p, st, &m_ec); + if (!exists(fst) || !is_regular_file(fst)) { + errc error_kind = + is_directory(fst) ? errc::is_a_directory : errc::not_supported; + if (!m_ec) + m_ec = make_error_code(error_kind); + return err.report(m_ec); + } + // is_regular_file(p) == true + return static_cast<uintmax_t>(st.st_size); +} + +uintmax_t __hard_link_count(const path& p, error_code* ec) { + ErrorHandler<uintmax_t> err("hard_link_count", ec, &p); + + error_code m_ec; + StatT st; + detail::posix_stat(p, st, &m_ec); + if (m_ec) + return err.report(m_ec); + return static_cast<uintmax_t>(st.st_nlink); +} + +bool __fs_is_empty(const path& p, error_code* ec) { + ErrorHandler<bool> err("is_empty", ec, &p); + + error_code m_ec; + StatT pst; + auto st = detail::posix_stat(p, pst, &m_ec); + if (m_ec) + return err.report(m_ec); + else if (!is_directory(st) && !is_regular_file(st)) + return err.report(errc::not_supported); + else if (is_directory(st)) { + auto it = ec ? directory_iterator(p, *ec) : directory_iterator(p); + if (ec && *ec) + return false; + return it == directory_iterator{}; + } else if (is_regular_file(st)) + return static_cast<uintmax_t>(pst.st_size) == 0; + + _LIBCPP_UNREACHABLE(); +} + +static file_time_type __extract_last_write_time(const path& p, const StatT& st, + error_code* ec) { + using detail::fs_time; + ErrorHandler<file_time_type> err("last_write_time", ec, &p); + + auto ts = detail::extract_mtime(st); + if (!fs_time::is_representable(ts)) + return err.report(errc::value_too_large); + + return fs_time::convert_from_timespec(ts); +} + +file_time_type __last_write_time(const path& p, error_code* ec) { + using namespace chrono; + ErrorHandler<file_time_type> err("last_write_time", ec, &p); + + error_code m_ec; + StatT st; + detail::posix_stat(p, st, &m_ec); + if (m_ec) + return err.report(m_ec); + return __extract_last_write_time(p, st, ec); +} + +void __last_write_time(const path& p, file_time_type new_time, error_code* ec) { + using detail::fs_time; + ErrorHandler<void> err("last_write_time", ec, &p); + + error_code m_ec; + array<TimeSpec, 2> tbuf; +#if !defined(_LIBCPP_USE_UTIMENSAT) + // This implementation has a race condition between determining the + // last access time and attempting to set it to the same value using + // ::utimes + StatT st; + file_status fst = detail::posix_stat(p, st, &m_ec); + if (m_ec) + return err.report(m_ec); + tbuf[0] = detail::extract_atime(st); +#else + tbuf[0].tv_sec = 0; + tbuf[0].tv_nsec = UTIME_OMIT; +#endif + if (!fs_time::convert_to_timespec(tbuf[1], new_time)) + return err.report(errc::value_too_large); + + detail::set_file_times(p, tbuf, m_ec); + if (m_ec) + return err.report(m_ec); +} + +void __permissions(const path& p, perms prms, perm_options opts, + error_code* ec) { + ErrorHandler<void> err("permissions", ec, &p); + + auto has_opt = [&](perm_options o) { return bool(o & opts); }; + const bool resolve_symlinks = !has_opt(perm_options::nofollow); + const bool add_perms = has_opt(perm_options::add); + const bool remove_perms = has_opt(perm_options::remove); + _LIBCPP_ASSERT( + (add_perms + remove_perms + has_opt(perm_options::replace)) == 1, + "One and only one of the perm_options constants replace, add, or remove " + "is present in opts"); + + bool set_sym_perms = false; + prms &= perms::mask; + if (!resolve_symlinks || (add_perms || remove_perms)) { + error_code m_ec; + file_status st = resolve_symlinks ? detail::posix_stat(p, &m_ec) + : detail::posix_lstat(p, &m_ec); + set_sym_perms = is_symlink(st); + if (m_ec) + return err.report(m_ec); + _LIBCPP_ASSERT(st.permissions() != perms::unknown, + "Permissions unexpectedly unknown"); + if (add_perms) + prms |= st.permissions(); + else if (remove_perms) + prms = st.permissions() & ~prms; + } + const auto real_perms = detail::posix_convert_perms(prms); + +#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) { + return err.report(capture_errno()); + } +#else + if (set_sym_perms) + return err.report(errc::operation_not_supported); + if (::chmod(p.c_str(), real_perms) == -1) { + return err.report(capture_errno()); + } +#endif +} + +path __read_symlink(const path& p, error_code* ec) { + ErrorHandler<path> err("read_symlink", ec, &p); + + char buff[PATH_MAX + 1]; + error_code m_ec; + ::ssize_t ret; + if ((ret = ::readlink(p.c_str(), buff, PATH_MAX)) == -1) { + return err.report(capture_errno()); + } + _LIBCPP_ASSERT(ret <= PATH_MAX, "TODO"); + _LIBCPP_ASSERT(ret > 0, "TODO"); + buff[ret] = 0; + return {buff}; +} + +bool __remove(const path& p, error_code* ec) { + ErrorHandler<bool> err("remove", ec, &p); + if (::remove(p.c_str()) == -1) { + if (errno != ENOENT) + err.report(capture_errno()); + return false; + } + return true; +} + +namespace { + +uintmax_t remove_all_impl(path const& p, error_code& ec) { + const auto npos = static_cast<uintmax_t>(-1); + const file_status st = __symlink_status(p, &ec); + if (ec) + return npos; + uintmax_t count = 1; + if (is_directory(st)) { + for (directory_iterator it(p, ec); !ec && it != directory_iterator(); + it.increment(ec)) { + auto other_count = remove_all_impl(it->path(), ec); + if (ec) + return npos; + count += other_count; + } + if (ec) + return npos; + } + if (!__remove(p, &ec)) + return npos; + return count; +} + +} // end namespace + +uintmax_t __remove_all(const path& p, error_code* ec) { + ErrorHandler<uintmax_t> err("remove_all", ec, &p); + + error_code mec; + auto count = remove_all_impl(p, mec); + if (mec) { + if (mec == errc::no_such_file_or_directory) + return 0; + return err.report(mec); + } + return count; +} + +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) + 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) + 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) { + err.report(capture_errno()); + si.capacity = si.free = si.available = static_cast<uintmax_t>(-1); + return si; + } + // Multiply with overflow checking. + auto do_mult = [&](uintmax_t& out, uintmax_t other) { + out = other * m_svfs.f_frsize; + if (other == 0 || out / other != m_svfs.f_frsize) + out = static_cast<uintmax_t>(-1); + }; + do_mult(si.capacity, m_svfs.f_blocks); + do_mult(si.free, m_svfs.f_bfree); + do_mult(si.available, m_svfs.f_bavail); + return si; +} + +file_status __status(const path& p, error_code* ec) { + return detail::posix_stat(p, ec); +} + +file_status __symlink_status(const path& p, error_code* ec) { + return detail::posix_lstat(p, ec); +} + +path __temp_directory_path(error_code* ec) { + ErrorHandler<path> err("temp_directory_path", ec); + + const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"}; + const char* ret = nullptr; + + for (auto& ep : env_paths) + if ((ret = getenv(ep))) + break; + if (ret == nullptr) + ret = "/tmp"; + + path p(ret); + 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); + + if (!exists(st) || !is_directory(st)) + return err.report(errc::not_a_directory, "path \"%s\" is not a directory", + p); + + return p; +} + +path __weakly_canonical(const path& p, error_code* ec) { + ErrorHandler<path> err("weakly_canonical", ec, &p); + + if (p.empty()) + return __canonical("", ec); + + path result; + path tmp; + tmp.__reserve(p.native().size()); + auto PP = PathParser::CreateEnd(p.native()); + --PP; + vector<string_view_t> DNEParts; + + while (PP.State != PathParser::PS_BeforeBegin) { + tmp.assign(createView(p.native().data(), &PP.RawEntry.back())); + error_code m_ec; + file_status st = __status(tmp, &m_ec); + if (!status_known(st)) { + return err.report(m_ec); + } else if (exists(st)) { + result = __canonical(tmp, ec); + break; + } + DNEParts.push_back(*PP); + --PP; + } + if (PP.State == PathParser::PS_BeforeBegin) + result = __canonical("", ec); + if (ec) + ec->clear(); + if (DNEParts.empty()) + return result; + for (auto It = DNEParts.rbegin(); It != DNEParts.rend(); ++It) + result /= *It; + return result.lexically_normal(); +} + +/////////////////////////////////////////////////////////////////////////////// +// path definitions +/////////////////////////////////////////////////////////////////////////////// + +constexpr path::value_type path::preferred_separator; + +path& path::replace_extension(path const& replacement) { + path p = extension(); + if (not p.empty()) { + __pn_.erase(__pn_.size() - p.native().size()); + } + if (!replacement.empty()) { + if (replacement.native()[0] != '.') { + __pn_ += "."; + } + __pn_.append(replacement.__pn_); + } + return *this; +} + +/////////////////////////////////////////////////////////////////////////////// +// path.decompose + +string_view_t path::__root_name() const { + auto PP = PathParser::CreateBegin(__pn_); + if (PP.State == PathParser::PS_InRootName) + return *PP; + return {}; +} + +string_view_t path::__root_directory() const { + auto PP = PathParser::CreateBegin(__pn_); + if (PP.State == PathParser::PS_InRootName) + ++PP; + if (PP.State == PathParser::PS_InRootDir) + return *PP; + return {}; +} + +string_view_t path::__root_path_raw() const { + auto PP = PathParser::CreateBegin(__pn_); + if (PP.State == PathParser::PS_InRootName) { + auto NextCh = PP.peek(); + if (NextCh && *NextCh == '/') { + ++PP; + return createView(__pn_.data(), &PP.RawEntry.back()); + } + return PP.RawEntry; + } + if (PP.State == PathParser::PS_InRootDir) + return *PP; + return {}; +} + +static bool ConsumeRootDir(PathParser* PP) { + while (PP->State <= PathParser::PS_InRootDir) + ++(*PP); + return PP->State == PathParser::PS_AtEnd; +} + +string_view_t path::__relative_path() const { + auto PP = PathParser::CreateBegin(__pn_); + if (ConsumeRootDir(&PP)) + return {}; + return createView(PP.RawEntry.data(), &__pn_.back()); +} + +string_view_t path::__parent_path() const { + if (empty()) + return {}; + // Determine if we have a root path but not a relative path. In that case + // return *this. + { + auto PP = PathParser::CreateBegin(__pn_); + if (ConsumeRootDir(&PP)) + return __pn_; + } + // Otherwise remove a single element from the end of the path, and return + // a string representing that path + { + auto PP = PathParser::CreateEnd(__pn_); + --PP; + if (PP.RawEntry.data() == __pn_.data()) + return {}; + --PP; + return createView(__pn_.data(), &PP.RawEntry.back()); + } +} + +string_view_t path::__filename() const { + if (empty()) + return {}; + { + PathParser PP = PathParser::CreateBegin(__pn_); + if (ConsumeRootDir(&PP)) + return {}; + } + return *(--PathParser::CreateEnd(__pn_)); +} + +string_view_t path::__stem() const { + return parser::separate_filename(__filename()).first; +} + +string_view_t path::__extension() const { + return parser::separate_filename(__filename()).second; +} + +//////////////////////////////////////////////////////////////////////////// +// path.gen + +enum PathPartKind : unsigned char { + PK_None, + PK_RootSep, + PK_Filename, + PK_Dot, + PK_DotDot, + PK_TrailingSep +}; + +static PathPartKind ClassifyPathPart(string_view_t Part) { + if (Part.empty()) + return PK_TrailingSep; + if (Part == ".") + return PK_Dot; + if (Part == "..") + return PK_DotDot; + if (Part == "/") + return PK_RootSep; + return PK_Filename; +} + +path path::lexically_normal() const { + if (__pn_.empty()) + return *this; + + using PartKindPair = pair<string_view_t, PathPartKind>; + vector<PartKindPair> Parts; + // Guess as to how many elements the path has to avoid reallocating. + Parts.reserve(32); + + // Track the total size of the parts as we collect them. This allows the + // resulting path to reserve the correct amount of memory. + size_t NewPathSize = 0; + auto AddPart = [&](PathPartKind K, string_view_t P) { + NewPathSize += P.size(); + Parts.emplace_back(P, K); + }; + auto LastPartKind = [&]() { + if (Parts.empty()) + return PK_None; + return Parts.back().second; + }; + + bool MaybeNeedTrailingSep = false; + // Build a stack containing the remaining elements of the path, popping off + // elements which occur before a '..' entry. + for (auto PP = PathParser::CreateBegin(__pn_); PP; ++PP) { + auto Part = *PP; + PathPartKind Kind = ClassifyPathPart(Part); + switch (Kind) { + case PK_Filename: + case PK_RootSep: { + // Add all non-dot and non-dot-dot elements to the stack of elements. + AddPart(Kind, Part); + MaybeNeedTrailingSep = false; + break; + } + case PK_DotDot: { + // Only push a ".." element if there are no elements preceding the "..", + // or if the preceding element is itself "..". + auto LastKind = LastPartKind(); + if (LastKind == PK_Filename) { + NewPathSize -= Parts.back().first.size(); + Parts.pop_back(); + } else if (LastKind != PK_RootSep) + AddPart(PK_DotDot, ".."); + MaybeNeedTrailingSep = LastKind == PK_Filename; + break; + } + case PK_Dot: + case PK_TrailingSep: { + MaybeNeedTrailingSep = true; + break; + } + case PK_None: + _LIBCPP_UNREACHABLE(); + } + } + // [fs.path.generic]p6.8: If the path is empty, add a dot. + if (Parts.empty()) + return "."; + + // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any + // trailing directory-separator. + bool NeedTrailingSep = MaybeNeedTrailingSep && LastPartKind() == PK_Filename; + + path Result; + Result.__pn_.reserve(Parts.size() + NewPathSize + NeedTrailingSep); + for (auto& PK : Parts) + Result /= PK.first; + + if (NeedTrailingSep) + Result /= ""; + + return Result; +} + +static int DetermineLexicalElementCount(PathParser PP) { + int Count = 0; + for (; PP; ++PP) { + auto Elem = *PP; + if (Elem == "..") + --Count; + else if (Elem != ".") + ++Count; + } + return Count; +} + +path path::lexically_relative(const path& base) const { + { // perform root-name/root-directory mismatch checks + auto PP = PathParser::CreateBegin(__pn_); + auto PPBase = PathParser::CreateBegin(base.__pn_); + auto CheckIterMismatchAtBase = [&]() { + return PP.State != PPBase.State && + (PP.inRootPath() || PPBase.inRootPath()); + }; + if (PP.State == PathParser::PS_InRootName && + PPBase.State == PathParser::PS_InRootName) { + if (*PP != *PPBase) + return {}; + } else if (CheckIterMismatchAtBase()) + return {}; + + if (PP.inRootPath()) + ++PP; + if (PPBase.inRootPath()) + ++PPBase; + if (CheckIterMismatchAtBase()) + return {}; + } + + // Find the first mismatching element + auto PP = PathParser::CreateBegin(__pn_); + auto PPBase = PathParser::CreateBegin(base.__pn_); + while (PP && PPBase && PP.State == PPBase.State && *PP == *PPBase) { + ++PP; + ++PPBase; + } + + // If there is no mismatch, return ".". + if (!PP && !PPBase) + return "."; + + // Otherwise, determine the number of elements, 'n', which are not dot or + // dot-dot minus the number of dot-dot elements. + int ElemCount = DetermineLexicalElementCount(PPBase); + if (ElemCount < 0) + return {}; + + // 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 /= ".."; + for (; PP; ++PP) + Result /= *PP; + return Result; +} + +//////////////////////////////////////////////////////////////////////////// +// path.comparisons +int path::__compare(string_view_t __s) const { + auto PP = PathParser::CreateBegin(__pn_); + auto PP2 = PathParser::CreateBegin(__s); + while (PP && PP2) { + int res = (*PP).compare(*PP2); + if (res != 0) + return res; + ++PP; + ++PP2; + } + if (PP.State == PP2.State && !PP) + return 0; + if (!PP) + return -1; + return 1; +} + +//////////////////////////////////////////////////////////////////////////// +// path.nonmembers +size_t hash_value(const path& __p) noexcept { + auto PP = PathParser::CreateBegin(__p.native()); + size_t hash_value = 0; + hash<string_view_t> hasher; + while (PP) { + hash_value = __hash_combine(hash_value, hasher(*PP)); + ++PP; + } + return hash_value; +} + +//////////////////////////////////////////////////////////////////////////// +// path.itr +path::iterator path::begin() const { + auto PP = PathParser::CreateBegin(__pn_); + iterator it; + it.__path_ptr_ = this; + it.__state_ = static_cast<path::iterator::_ParserState>(PP.State); + it.__entry_ = PP.RawEntry; + it.__stashed_elem_.__assign_view(*PP); + return it; +} + +path::iterator path::end() const { + iterator it{}; + it.__state_ = path::iterator::_AtEnd; + it.__path_ptr_ = this; + return it; +} + +path::iterator& path::iterator::__increment() { + PathParser PP(__path_ptr_->native(), __entry_, __state_); + ++PP; + __state_ = static_cast<_ParserState>(PP.State); + __entry_ = PP.RawEntry; + __stashed_elem_.__assign_view(*PP); + return *this; +} + +path::iterator& path::iterator::__decrement() { + PathParser PP(__path_ptr_->native(), __entry_, __state_); + --PP; + __state_ = static_cast<_ParserState>(PP.State); + __entry_ = PP.RawEntry; + __stashed_elem_.__assign_view(*PP); + return *this; +} + +/////////////////////////////////////////////////////////////////////////////// +// directory entry definitions +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _LIBCPP_WIN32API +error_code directory_entry::__do_refresh() noexcept { + __data_.__reset(); + error_code failure_ec; + + StatT full_st; + file_status st = detail::posix_lstat(__p_, full_st, &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 = detail::posix_stat(__p_, full_st, &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{}; + } + // Otherwise, we resolved the link, potentially as not existing. + // That's OK. + __data_.__cache_type_ = directory_entry::_RefreshSymlink; + } + + if (_VSTD_FS::is_regular_file(st)) + __data_.__size_ = static_cast<uintmax_t>(full_st.st_size); + + if (_VSTD_FS::exists(st)) { + __data_.__nlink_ = static_cast<uintmax_t>(full_st.st_nlink); + + // Attempt to extract the mtime, and fail if it's not representable using + // file_time_type. For now we ignore the error, as we'll report it when + // the value is actually used. + error_code ignored_ec; + __data_.__write_time_ = + __extract_last_write_time(__p_, full_st, &ignored_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 diff --git a/src/include/apple_availability.h b/src/include/apple_availability.h new file mode 100644 index 0000000000000..c12f7325cb41d --- /dev/null +++ b/src/include/apple_availability.h @@ -0,0 +1,52 @@ +//===------------------------ apple_availability.h ------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H +#define _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H + +#if defined(__APPLE__) + +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101300 +#define _LIBCPP_USE_UTIMENSAT +#endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 110000 +#define _LIBCPP_USE_UTIMENSAT +#endif +#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 110000 +#define _LIBCPP_USE_UTIMENSAT +#endif +#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 40000 +#define _LIBCPP_USE_UTIMENSAT +#endif +#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__ + +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200 +#define _LIBCPP_USE_CLOCK_GETTIME +#endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100000 +#define _LIBCPP_USE_CLOCK_GETTIME +#endif +#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 100000 +#define _LIBCPP_USE_CLOCK_GETTIME +#endif +#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) +#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 30000 +#define _LIBCPP_USE_CLOCK_GETTIME +#endif +#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__ + +#endif // __APPLE__ + +#endif // _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H diff --git a/src/include/config_elast.h b/src/include/config_elast.h index 4c4d853c2a687..c3cc19c2234fe 100644 --- a/src/include/config_elast.h +++ b/src/include/config_elast.h @@ -12,7 +12,7 @@ #include <__config> -#if defined(_LIBCPP_MSVCRT) +#if defined(_LIBCPP_MSVCRT_LIKE) #include <stdlib.h> #else #include <errno.h> @@ -30,7 +30,7 @@ // No _LIBCPP_ELAST needed on Apple #elif defined(__sun__) #define _LIBCPP_ELAST ESTALE -#elif defined(_LIBCPP_MSVCRT) +#elif defined(_LIBCPP_MSVCRT_LIKE) #define _LIBCPP_ELAST (_sys_nerr - 1) #else // Warn here so that the person doing the libcxx port has an easier time: diff --git a/src/locale.cpp b/src/locale.cpp index a6cb0e97d1285..b9c701137df2d 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -4240,6 +4240,7 @@ static bool checked_string_to_char_convert(char& dest, // FIXME: Work around specific multibyte sequences that we can reasonable // translate into a different single byte. switch (wout) { + case L'\u202F': // narrow non-breaking space case L'\u00A0': // non-breaking space dest = ' '; return true; @@ -4659,7 +4660,7 @@ static string* init_am_pm() { - static string am_pm[24]; + static string am_pm[2]; am_pm[0] = "AM"; am_pm[1] = "PM"; return am_pm; @@ -4669,7 +4670,7 @@ static wstring* init_wam_pm() { - static wstring am_pm[24]; + static wstring am_pm[2]; am_pm[0] = L"AM"; am_pm[1] = L"PM"; return am_pm; diff --git a/src/optional.cpp b/src/optional.cpp index 2877d175bc1b7..6099b6b41e89c 100644 --- a/src/optional.cpp +++ b/src/optional.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "optional" -#include "experimental/optional" namespace std { @@ -21,8 +20,23 @@ const char* bad_optional_access::what() const _NOEXCEPT { } // std + +#include <experimental/__config> + +// Preserve std::experimental::bad_optional_access for ABI compatibility +// Even though it no longer exists in a header file _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL +class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access + : public std::logic_error +{ +public: + bad_optional_access() : std::logic_error("Bad optional Access") {} + +// Get the key function ~bad_optional_access() into the dylib + virtual ~bad_optional_access() _NOEXCEPT; +}; + bad_optional_access::~bad_optional_access() _NOEXCEPT = default; _LIBCPP_END_NAMESPACE_EXPERIMENTAL diff --git a/src/support/runtime/exception_libcxxabi.ipp b/src/support/runtime/exception_libcxxabi.ipp index c3dcf1ec591a9..feefc5152891c 100644 --- a/src/support/runtime/exception_libcxxabi.ipp +++ b/src/support/runtime/exception_libcxxabi.ipp @@ -18,7 +18,7 @@ bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } int uncaught_exceptions() _NOEXCEPT { -# if _LIBCPPABI_VERSION > 1101 +# if _LIBCPPABI_VERSION > 1001 return __cxa_uncaught_exceptions(); # else return __cxa_uncaught_exception() ? 1 : 0; diff --git a/src/support/runtime/exception_msvc.ipp b/src/support/runtime/exception_msvc.ipp index d5bf5b726ea5c..87d5a66fc8f98 100644 --- a/src/support/runtime/exception_msvc.ipp +++ b/src/support/runtime/exception_msvc.ipp @@ -15,30 +15,18 @@ #include <stdio.h> #include <stdlib.h> -#if !defined(_ACRTIMP) -#define _ACRTIMP __declspec(dllimport) -#endif - -#if !defined(_VCRTIMP) -#define _VCRTIMP __declspec(dllimport) -#endif - -#if !defined(__CRTDECL) -#define __CRTDECL __cdecl -#endif - extern "C" { -typedef void (__CRTDECL* terminate_handler)(); -_ACRTIMP terminate_handler __cdecl set_terminate( +typedef void (__cdecl* terminate_handler)(); +_LIBCPP_CRT_FUNC terminate_handler __cdecl set_terminate( terminate_handler _NewTerminateHandler) throw(); -_ACRTIMP terminate_handler __cdecl _get_terminate(); +_LIBCPP_CRT_FUNC terminate_handler __cdecl _get_terminate(); -typedef void (__CRTDECL* unexpected_handler)(); -_VCRTIMP unexpected_handler __cdecl set_unexpected( +typedef void (__cdecl* unexpected_handler)(); +unexpected_handler __cdecl set_unexpected( unexpected_handler _NewUnexpectedHandler) throw(); -_VCRTIMP unexpected_handler __cdecl _get_unexpected(); +unexpected_handler __cdecl _get_unexpected(); -_VCRTIMP int __cdecl __uncaught_exceptions(); +int __cdecl __uncaught_exceptions(); } namespace std { @@ -109,6 +97,7 @@ bad_array_length::what() const _NOEXCEPT return "bad_array_length"; } +#if defined(_LIBCPP_NO_VCRUNTIME) bad_cast::bad_cast() _NOEXCEPT { } @@ -137,7 +126,6 @@ bad_typeid::what() const _NOEXCEPT return "std::bad_typeid"; } -#if defined(_LIBCPP_NO_VCRUNTIME) exception::~exception() _NOEXCEPT { } diff --git a/src/support/runtime/exception_pointer_msvc.ipp b/src/support/runtime/exception_pointer_msvc.ipp index 5ca7519a60016..9b0d2361e4028 100644 --- a/src/support/runtime/exception_pointer_msvc.ipp +++ b/src/support/runtime/exception_pointer_msvc.ipp @@ -11,30 +11,16 @@ #include <stdio.h> #include <stdlib.h> -#if !defined(_CRTIMP2_PURE) -#define _CRTIMP2_PURE __declspec(dllimport) -#endif - -#if !defined(__CLRCALL_PURE_OR_CDECL) -#define __CLRCALL_PURE_OR_CDECL __cdecl -#endif - -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(void*, - const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrAssign(void*, const void*); -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL -__ExceptionPtrCompare(const void*, const void*); -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL -__ExceptionPtrToBool(const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(void*, void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrCurrentException(void*); -[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrRethrow(const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCreate(void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrDestroy(void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopy(void*, const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrAssign(void*, const void*); +_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrCompare(const void*, const void*); +_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrToBool(const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrSwap(void*, void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCurrentException(void*); +[[noreturn]] _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrRethrow(const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopyException(void*, const void*, const void*); namespace std { diff --git a/src/support/win32/locale_win32.cpp b/src/support/win32/locale_win32.cpp index fdca7efff0679..cad9d4e81466d 100644 --- a/src/support/win32/locale_win32.cpp +++ b/src/support/win32/locale_win32.cpp @@ -13,6 +13,8 @@ #include <memory> #include <type_traits> +int __libcpp_vasprintf(char **sptr, const char *__restrict fmt, va_list ap); + using std::__libcpp_locale_guard; // FIXME: base currently unused. Needs manual work to construct the new locale @@ -105,7 +107,7 @@ int asprintf_l( char **ret, locale_t loc, const char *format, ... ) int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap ) { __libcpp_locale_guard __current(loc); - return vasprintf( ret, format, ap ); + return __libcpp_vasprintf( ret, format, ap ); } #if !defined(_LIBCPP_MSVCRT) diff --git a/src/support/win32/support.cpp b/src/support/win32/support.cpp index dbd1c4c418aaa..aa636fba50bda 100644 --- a/src/support/win32/support.cpp +++ b/src/support/win32/support.cpp @@ -19,7 +19,7 @@ // Like sprintf, but when return value >= 0 it returns // a pointer to a malloc'd string in *sptr. // If return >= 0, use free to delete *sptr. -int vasprintf( char **sptr, const char *__restrict format, va_list ap ) +int __libcpp_vasprintf( char **sptr, const char *__restrict format, va_list ap ) { *sptr = NULL; // Query the count required. diff --git a/src/support/win32/thread_win32.cpp b/src/support/win32/thread_win32.cpp new file mode 100644 index 0000000000000..1567042d8e2fc --- /dev/null +++ b/src/support/win32/thread_win32.cpp @@ -0,0 +1,276 @@ +// -*- C++ -*- +//===-------------------- support/win32/thread_win32.cpp ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <__threading_support> +#include <windows.h> +#include <process.h> +#include <fibersapi.h> + +_LIBCPP_BEGIN_NAMESPACE_STD + +static_assert(sizeof(__libcpp_mutex_t) == sizeof(SRWLOCK), ""); +static_assert(alignof(__libcpp_mutex_t) == alignof(SRWLOCK), ""); + +static_assert(sizeof(__libcpp_recursive_mutex_t) == sizeof(CRITICAL_SECTION), + ""); +static_assert(alignof(__libcpp_recursive_mutex_t) == alignof(CRITICAL_SECTION), + ""); + +static_assert(sizeof(__libcpp_condvar_t) == sizeof(CONDITION_VARIABLE), ""); +static_assert(alignof(__libcpp_condvar_t) == alignof(CONDITION_VARIABLE), ""); + +static_assert(sizeof(__libcpp_exec_once_flag) == sizeof(INIT_ONCE), ""); +static_assert(alignof(__libcpp_exec_once_flag) == alignof(INIT_ONCE), ""); + +static_assert(sizeof(__libcpp_thread_id) == sizeof(DWORD), ""); +static_assert(alignof(__libcpp_thread_id) == alignof(DWORD), ""); + +static_assert(sizeof(__libcpp_thread_t) == sizeof(HANDLE), ""); +static_assert(alignof(__libcpp_thread_t) == alignof(HANDLE), ""); + +static_assert(sizeof(__libcpp_tls_key) == sizeof(DWORD), ""); +static_assert(alignof(__libcpp_tls_key) == alignof(DWORD), ""); + +// Mutex +int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) +{ + InitializeCriticalSection((LPCRITICAL_SECTION)__m); + return 0; +} + +int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m) +{ + EnterCriticalSection((LPCRITICAL_SECTION)__m); + return 0; +} + +bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m) +{ + return TryEnterCriticalSection((LPCRITICAL_SECTION)__m) != 0; +} + +int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m) +{ + LeaveCriticalSection((LPCRITICAL_SECTION)__m); + return 0; +} + +int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m) +{ + DeleteCriticalSection((LPCRITICAL_SECTION)__m); + return 0; +} + +int __libcpp_mutex_lock(__libcpp_mutex_t *__m) +{ + AcquireSRWLockExclusive((PSRWLOCK)__m); + return 0; +} + +bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m) +{ + return TryAcquireSRWLockExclusive((PSRWLOCK)__m) != 0; +} + +int __libcpp_mutex_unlock(__libcpp_mutex_t *__m) +{ + ReleaseSRWLockExclusive((PSRWLOCK)__m); + return 0; +} + +int __libcpp_mutex_destroy(__libcpp_mutex_t *__m) +{ + static_cast<void>(__m); + return 0; +} + +// Condition Variable +int __libcpp_condvar_signal(__libcpp_condvar_t *__cv) +{ + WakeConditionVariable((PCONDITION_VARIABLE)__cv); + return 0; +} + +int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv) +{ + WakeAllConditionVariable((PCONDITION_VARIABLE)__cv); + return 0; +} + +int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) +{ + SleepConditionVariableSRW((PCONDITION_VARIABLE)__cv, (PSRWLOCK)__m, INFINITE, 0); + return 0; +} + +int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, + timespec *__ts) +{ + using namespace _VSTD::chrono; + + auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec); + auto abstime = + system_clock::time_point(duration_cast<system_clock::duration>(duration)); + auto timeout_ms = duration_cast<milliseconds>(abstime - system_clock::now()); + + if (!SleepConditionVariableSRW((PCONDITION_VARIABLE)__cv, (PSRWLOCK)__m, + timeout_ms.count() > 0 ? timeout_ms.count() + : 0, + 0)) + { + auto __ec = GetLastError(); + return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec; + } + return 0; +} + +int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv) +{ + static_cast<void>(__cv); + return 0; +} + +// Execute Once +static inline _LIBCPP_INLINE_VISIBILITY BOOL CALLBACK +__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter, + PVOID *__context) +{ + static_cast<void>(__init_once); + static_cast<void>(__context); + + void (*init_routine)(void) = reinterpret_cast<void (*)(void)>(__parameter); + init_routine(); + return TRUE; +} + +int __libcpp_execute_once(__libcpp_exec_once_flag *__flag, + void (*__init_routine)(void)) +{ + if (!InitOnceExecuteOnce((PINIT_ONCE)__flag, __libcpp_init_once_execute_once_thunk, + reinterpret_cast<void *>(__init_routine), NULL)) + return GetLastError(); + return 0; +} + +// Thread ID +bool __libcpp_thread_id_equal(__libcpp_thread_id __lhs, + __libcpp_thread_id __rhs) +{ + return __lhs == __rhs; +} + +bool __libcpp_thread_id_less(__libcpp_thread_id __lhs, __libcpp_thread_id __rhs) +{ + return __lhs < __rhs; +} + +// Thread +struct __libcpp_beginthreadex_thunk_data +{ + void *(*__func)(void *); + void *__arg; +}; + +static inline _LIBCPP_INLINE_VISIBILITY unsigned WINAPI +__libcpp_beginthreadex_thunk(void *__raw_data) +{ + auto *__data = + static_cast<__libcpp_beginthreadex_thunk_data *>(__raw_data); + auto *__func = __data->__func; + void *__arg = __data->__arg; + delete __data; + return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg))); +} + +bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { + return *__t == 0; +} + +int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), + void *__arg) +{ + auto *__data = new __libcpp_beginthreadex_thunk_data; + __data->__func = __func; + __data->__arg = __arg; + + *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, + __libcpp_beginthreadex_thunk, + __data, 0, nullptr)); + + if (*__t) + return 0; + return GetLastError(); +} + +__libcpp_thread_id __libcpp_thread_get_current_id() +{ + return GetCurrentThreadId(); +} + +__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t) +{ + return GetThreadId(*__t); +} + +int __libcpp_thread_join(__libcpp_thread_t *__t) +{ + if (WaitForSingleObjectEx(*__t, INFINITE, FALSE) == WAIT_FAILED) + return GetLastError(); + if (!CloseHandle(*__t)) + return GetLastError(); + return 0; +} + +int __libcpp_thread_detach(__libcpp_thread_t *__t) +{ + if (!CloseHandle(*__t)) + return GetLastError(); + return 0; +} + +void __libcpp_thread_yield() +{ + SwitchToThread(); +} + +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)); + // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx) + Sleep(__ms.count()); +} + +// Thread Local Storage +int __libcpp_tls_create(__libcpp_tls_key* __key, + void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*)) +{ + DWORD index = FlsAlloc(__at_exit); + if (index == FLS_OUT_OF_INDEXES) + return GetLastError(); + *__key = index; + return 0; +} + +void *__libcpp_tls_get(__libcpp_tls_key __key) +{ + return FlsGetValue(__key); +} + +int __libcpp_tls_set(__libcpp_tls_key __key, void *__p) +{ + if (!FlsSetValue(__key, __p)) + return GetLastError(); + return 0; +} + +_LIBCPP_END_NAMESPACE_STD diff --git a/src/typeinfo.cpp b/src/typeinfo.cpp index 0cb193b77d9ec..42ff9351ed210 100644 --- a/src/typeinfo.cpp +++ b/src/typeinfo.cpp @@ -9,7 +9,7 @@ #include "typeinfo" -#if defined(_LIBCPP_ABI_MICROSOFT) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(_LIBCPP_NO_VCRUNTIME) #include <string.h> int std::type_info::__compare(const type_info &__rhs) const _NOEXCEPT { @@ -49,7 +49,8 @@ size_t std::type_info::hash_code() const _NOEXCEPT { // FIXME: Remove __APPLE__ default here once buildit is gone. // FIXME: Remove the _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY configuration. #if (!defined(LIBCXX_BUILDING_LIBCXXABI) && !defined(LIBCXXRT) && \ - !defined(__GLIBCXX__) && !defined(__APPLE__)) || \ + !defined(__GLIBCXX__) && !defined(__APPLE__) && \ + !(defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME))) || \ defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) std::type_info::~type_info() { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 53c6416cca6bd..f8442460a2fe3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,11 @@ endmacro() set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING "Configuration variant to use for LIT.") +set(LIBCXX_TEST_LINKER_FLAGS "" CACHE STRING + "Additonal linker flags to pass when compiling the tests") +set(LIBCXX_TEST_COMPILER_FLAGS "" CACHE STRING + "Additonal linker flags to pass when compiling the tests") + # The tests shouldn't link to any ABI library when it has been linked into # libc++ statically or via a linker script. if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT) @@ -30,6 +35,7 @@ pythonize_bool(LIBCXX_BUILD_32_BITS) pythonize_bool(LIBCXX_GENERATE_COVERAGE) pythonize_bool(LIBCXXABI_ENABLE_SHARED) pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER) +pythonize_bool(LIBCXX_USE_COMPILER_RT) pythonize_bool(LIBCXX_HAS_ATOMIC_LIB) pythonize_bool(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB) pythonize_bool(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) @@ -52,7 +58,10 @@ set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!" set(LIBCXX_TEST_DEPS "") if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY) - set(LIBCXX_TEST_DEPS cxx_experimental) + list(APPEND LIBCXX_TEST_DEPS cxx_experimental) +endif() +if (LIBCXX_ENABLE_FILESYSTEM) + list(APPEND LIBCXX_TEST_DEPS cxx_filesystem) endif() if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) @@ -99,7 +108,7 @@ if (LIBCXX_CONFIGURE_IDE) ${LIBCXX_TESTS} ${LIBCXX_TEST_HEADERS} ${LIBCXX_HEADERS}) add_dependencies(libcxx_test_objects cxx) - set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/experimental/filesystem/Inputs/static_test_env) + set(STATIC_ROOT ${LIBCXX_SOURCE_DIR}/test/std/input.output/filesystems/Inputs/static_test_env) add_definitions(-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="${STATIC_ROOT}") set(DYNAMIC_ROOT ${LIBCXX_BINARY_DIR}/test/filesystem/Output/dynamic_env) diff --git a/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp b/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp index d7b172cd1212d..9dd68bd4e459f 100644 --- a/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp +++ b/test/libcxx/atomics/atomics.flag/init_bool.pass.cpp @@ -18,8 +18,21 @@ #include <atomic> #include <cassert> +#include "test_macros.h" + +#if TEST_STD_VER >= 11 +// Ensure that static initialization happens; this is PR#37226 +extern std::atomic_flag global; +struct X { X() { global.test_and_set(); }}; +X x; +std::atomic_flag global = ATOMIC_FLAG_INIT; +#endif + int main() { +#if TEST_STD_VER >= 11 + assert(global.test_and_set() == 1); +#endif { std::atomic_flag f(false); assert(f.test_and_set() == 0); diff --git a/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp new file mode 100644 index 0000000000000..465523f84d67c --- /dev/null +++ b/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp @@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: libcpp-no-exceptions +// MODULES_DEFINES: _LIBCPP_DEBUG=1 +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS + +// Can't test the system lib because this test enables debug mode +// UNSUPPORTED: with_system_cxx_lib + +// test array<T, 0>::front() throws a debug exception. + +#define _LIBCPP_DEBUG 1 +#define _LIBCPP_DEBUG_USE_EXCEPTIONS +#include <array> + +template <class Array> +inline bool CheckDebugThrows(Array& Arr) { + try { + Arr.back(); + } catch (std::__libcpp_debug_exception const&) { + return true; + } + return false; +} + +int main() +{ + { + typedef std::array<int, 0> C; + C c = {}; + C const& cc = c; + assert(CheckDebugThrows(c)); + assert(CheckDebugThrows(cc)); + } + { + typedef std::array<const int, 0> C; + C c = {{}}; + C const& cc = c; + assert(CheckDebugThrows(c)); + assert(CheckDebugThrows(cc)); + } +} diff --git a/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp new file mode 100644 index 0000000000000..d49b3a7633457 --- /dev/null +++ b/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp @@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: libcpp-no-exceptions +// MODULES_DEFINES: _LIBCPP_DEBUG=1 +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS + +// Can't test the system lib because this test enables debug mode +// UNSUPPORTED: with_system_cxx_lib + +// test array<T, 0>::front() throws a debug exception. + +#define _LIBCPP_DEBUG 1 +#define _LIBCPP_DEBUG_USE_EXCEPTIONS +#include <array> + +template <class Array> +inline bool CheckDebugThrows(Array& Arr) { + try { + Arr.front(); + } catch (std::__libcpp_debug_exception const&) { + return true; + } + return false; +} + +int main() +{ + { + typedef std::array<int, 0> C; + C c = {}; + C const& cc = c; + assert(CheckDebugThrows(c)); + assert(CheckDebugThrows(cc)); + } + { + typedef std::array<const int, 0> C; + C c = {{}}; + C const& cc = c; + assert(CheckDebugThrows(c)); + assert(CheckDebugThrows(cc)); + } +} diff --git a/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp b/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp new file mode 100644 index 0000000000000..4d6ad69073886 --- /dev/null +++ b/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: libcpp-no-exceptions +// MODULES_DEFINES: _LIBCPP_DEBUG=1 +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS + +// Can't test the system lib because this test enables debug mode +// UNSUPPORTED: with_system_cxx_lib + +// test array<T, 0>::operator[] throws a debug exception. + +#define _LIBCPP_DEBUG 1 +#define _LIBCPP_DEBUG_USE_EXCEPTIONS +#include <array> + +template <class Array> +inline bool CheckDebugThrows(Array& Arr, size_t Index) { + try { + Arr[Index]; + } catch (std::__libcpp_debug_exception const&) { + return true; + } + return false; +} + +int main() +{ + { + typedef std::array<int, 0> C; + C c = {}; + C const& cc = c; + assert(CheckDebugThrows(c, 0)); + assert(CheckDebugThrows(c, 1)); + assert(CheckDebugThrows(cc, 0)); + assert(CheckDebugThrows(cc, 1)); + } + { + typedef std::array<const int, 0> C; + C c = {{}}; + C const& cc = c; + assert(CheckDebugThrows(c, 0)); + assert(CheckDebugThrows(c, 1)); + assert(CheckDebugThrows(cc, 0)); + assert(CheckDebugThrows(cc, 1)); + } +} diff --git a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp index 3ae009a8e96c7..57d16c2723f75 100644 --- a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp +++ b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp @@ -42,6 +42,7 @@ public: Base::run(); try { FrontOnEmptyContainer(); + if constexpr (CT != CT_ForwardList) { AssignInvalidates(); BackOnEmptyContainer(); @@ -50,6 +51,8 @@ public: InsertIterIterIter(); EmplaceIterValue(); EraseIterIter(); + } else { + SpliceFirstElemAfter(); } if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) { PopBack(); @@ -57,12 +60,66 @@ public: if constexpr (CT == CT_List || CT == CT_Deque) { PopFront(); // FIXME: Run with forward list as well } + if constexpr (CT == CT_List || CT == CT_ForwardList) { + RemoveFirstElem(); + } + if constexpr (CT == CT_List) { + SpliceFirstElem(); + } } catch (...) { assert(false && "uncaught debug exception"); } } private: + static void RemoveFirstElem() { + // See llvm.org/PR35564 + CHECKPOINT("remove(<first-elem>)"); + { + Container C = makeContainer(1); + auto FirstVal = *(C.begin()); + C.remove(FirstVal); + assert(C.empty()); + } + { + Container C = {1, 1, 1, 1}; + auto FirstVal = *(C.begin()); + C.remove(FirstVal); + assert(C.empty()); + } + } + + static void SpliceFirstElem() { + // See llvm.org/PR35564 + CHECKPOINT("splice(<first-elem>)"); + { + Container C = makeContainer(1); + Container C2; + C2.splice(C2.end(), C, C.begin(), ++C.begin()); + } + { + Container C = makeContainer(1); + Container C2; + C2.splice(C2.end(), C, C.begin()); + } + } + + + static void SpliceFirstElemAfter() { + // See llvm.org/PR35564 + CHECKPOINT("splice(<first-elem>)"); + { + Container C = makeContainer(1); + Container C2; + C2.splice_after(C2.begin(), C, C.begin(), ++C.begin()); + } + { + Container C = makeContainer(1); + Container C2; + C2.splice_after(C2.begin(), C, C.begin()); + } + } + static void AssignInvalidates() { CHECKPOINT("assign(Size, Value)"); Container C(allocator_type{}); diff --git a/test/libcxx/experimental/utilities/syserror/version.pass.cpp b/test/libcxx/depr/depr.c.headers/math_h.sh.cpp index 35f6a59c38760..8048865c34be8 100644 --- a/test/libcxx/experimental/utilities/syserror/version.pass.cpp +++ b/test/libcxx/depr/depr.c.headers/math_h.sh.cpp @@ -7,14 +7,17 @@ // //===----------------------------------------------------------------------===// -// <experimental/system_error> +// RUN: %compile -fsyntax-only -#include <experimental/system_error> +#ifdef _MSC_VER -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined +#include <math.h> + +#define _USE_MATH_DEFINES +#include <math.h> + +#ifndef M_PI +#error M_PI not defined #endif -int main() -{ -} +#endif diff --git a/test/libcxx/double_include.sh.cpp b/test/libcxx/double_include.sh.cpp index 0a9e9fcfaea8a..c98cc8065eb9a 100644 --- a/test/libcxx/double_include.sh.cpp +++ b/test/libcxx/double_include.sh.cpp @@ -41,6 +41,7 @@ #include <clocale> #include <cmath> #include <codecvt> +#include <compare> #include <complex> #include <complex.h> #include <condition_variable> @@ -61,6 +62,7 @@ #include <deque> #include <errno.h> #include <exception> +#include <filesystem> #include <float.h> #include <forward_list> #include <fstream> @@ -101,6 +103,7 @@ #ifndef _LIBCPP_HAS_NO_THREADS #include <shared_mutex> #endif +#include <span> #include <sstream> #include <stack> #include <stdbool.h> @@ -129,14 +132,13 @@ #include <valarray> #include <variant> #include <vector> +#include <version> #include <wchar.h> #include <wctype.h> // experimental headers #if __cplusplus >= 201103L #include <experimental/algorithm> -#include <experimental/any> -#include <experimental/chrono> #if defined(__cpp_coroutines) #include <experimental/coroutine> #endif @@ -149,16 +151,11 @@ #include <experimental/list> #include <experimental/map> #include <experimental/memory_resource> -#include <experimental/numeric> -#include <experimental/optional> #include <experimental/propagate_const> -#include <experimental/ratio> #include <experimental/regex> +#include <experimental/simd> #include <experimental/set> #include <experimental/string> -#include <experimental/string_view> -#include <experimental/system_error> -#include <experimental/tuple> #include <experimental/type_traits> #include <experimental/unordered_map> #include <experimental/unordered_set> diff --git a/test/libcxx/experimental/any/size_and_alignment.pass.cpp b/test/libcxx/experimental/any/size_and_alignment.pass.cpp deleted file mode 100644 index b7db54020478d..0000000000000 --- a/test/libcxx/experimental/any/size_and_alignment.pass.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// Check that the size and alignment of any are what we expect. - -#include <experimental/any> - -int main() -{ - using std::experimental::any; - static_assert(sizeof(any) == sizeof(void*)*4, ""); - static_assert(alignof(any) == alignof(void*), ""); -} diff --git a/test/libcxx/experimental/any/small_type.pass.cpp b/test/libcxx/experimental/any/small_type.pass.cpp deleted file mode 100644 index 96754126c9965..0000000000000 --- a/test/libcxx/experimental/any/small_type.pass.cpp +++ /dev/null @@ -1,114 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// Check that the size and alignment of any are what we expect. - -#include <experimental/any> -#include "experimental_any_helpers.h" - -constexpr std::size_t BufferSize = (sizeof(void*) * 3); -constexpr std::size_t BufferAlignment = alignof(void*); -// Clang doesn't like "alignof(BufferAlignment * 2)" due to PR13986. -// So we create "DoubleBufferAlignment" instead. -constexpr std::size_t DoubleBufferAlignment = BufferAlignment * 2; - -class SmallThrowsDtor -{ -public: - SmallThrowsDtor() {} - SmallThrowsDtor(SmallThrowsDtor const &) noexcept {} - SmallThrowsDtor(SmallThrowsDtor &&) noexcept {} - ~SmallThrowsDtor() noexcept(false) {} -}; - - -struct alignas(1) MaxSizeType { - char buff[BufferSize]; -}; - -struct alignas(BufferAlignment) MaxAlignType { -}; - -struct alignas(BufferAlignment) MaxSizeAndAlignType { - char buff[BufferSize]; -}; - - -struct alignas(1) OverSizeType { - char buff[BufferSize + 1]; -}; - -struct alignas(DoubleBufferAlignment) OverAlignedType { -}; - -struct alignas(DoubleBufferAlignment) OverSizeAndAlignedType { - char buff[BufferSize + 1]; -}; - -int main() -{ - using std::experimental::any; - using std::experimental::__any_imp::_IsSmallObject; - static_assert(_IsSmallObject<small>::value, ""); - static_assert(_IsSmallObject<void*>::value, ""); - static_assert(!_IsSmallObject<SmallThrowsDtor>::value, ""); - static_assert(!_IsSmallObject<large>::value, ""); - { - // Check a type that meets the size requirement *exactly* and has - // a lesser alignment requirement is considered small. - typedef MaxSizeType T; - static_assert(sizeof(T) == BufferSize, ""); - static_assert(alignof(T) < BufferAlignment, ""); - static_assert(_IsSmallObject<T>::value, ""); - } - { - // Check a type that meets the alignment requirement *exactly* and has - // a lesser size is considered small. - typedef MaxAlignType T; - static_assert(sizeof(T) < BufferSize, ""); - static_assert(alignof(T) == BufferAlignment, ""); - static_assert(_IsSmallObject<T>::value, ""); - } - { - // Check a type that meets the size and alignment requirements *exactly* - // is considered small. - typedef MaxSizeAndAlignType T; - static_assert(sizeof(T) == BufferSize, ""); - static_assert(alignof(T) == BufferAlignment, ""); - static_assert(_IsSmallObject<T>::value, ""); - } - { - // Check a type that meets the alignment requirements but is over-sized - // is not considered small. - typedef OverSizeType T; - static_assert(sizeof(T) > BufferSize, ""); - static_assert(alignof(T) < BufferAlignment, ""); - static_assert(!_IsSmallObject<T>::value, ""); - } - { - // Check a type that meets the size requirements but is over-aligned - // is not considered small. - typedef OverAlignedType T; - static_assert(sizeof(T) < BufferSize, ""); - static_assert(alignof(T) > BufferAlignment, ""); - static_assert(!_IsSmallObject<T>::value, ""); - } - { - // Check a type that exceeds both the size an alignment requirements - // is not considered small. - typedef OverSizeAndAlignedType T; - static_assert(sizeof(T) > BufferSize, ""); - static_assert(alignof(T) > BufferAlignment, ""); - static_assert(!_IsSmallObject<T>::value, ""); - } -} diff --git a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp deleted file mode 100644 index c43ea078f9896..0000000000000 --- a/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// class path - -// path& operator/=(path const&) -// path operator/(path const&, path const&) - - -#define _LIBCPP_DEBUG 0 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++) -int AssertCount = 0; - -#include <experimental/filesystem> -#include <type_traits> -#include <string_view> -#include <cassert> - -#include "test_macros.h" -#include "test_iterators.h" -#include "count_new.hpp" -#include "filesystem_test_helper.hpp" - -namespace fs = std::experimental::filesystem; - -int main() -{ - using namespace fs; - { - path lhs("//foo"); - path rhs("/bar"); - assert(AssertCount == 0); - lhs /= rhs; - assert(AssertCount == 0); - } - { - path lhs("//foo"); - path rhs("/bar"); - assert(AssertCount == 0); - (void)(lhs / rhs); - assert(AssertCount == 0); - } - { - path lhs("//foo"); - path rhs("//bar"); - assert(AssertCount == 0); - lhs /= rhs; - assert(AssertCount == 1); - AssertCount = 0; - } - { - path lhs("//foo"); - path rhs("//bar"); - assert(AssertCount == 0); - (void)(lhs / rhs); - assert(AssertCount == 1); - } - // FIXME The same error is not diagnosed for the append(Source) and - // append(It, It) overloads. -} diff --git a/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp b/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp deleted file mode 100644 index 972d518139614..0000000000000 --- a/test/libcxx/experimental/filesystem/convert_file_time.sh.cpp +++ /dev/null @@ -1,200 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/filesystem> - -// typedef TrivialClock file_time_type; - -// RUN: %build -I%libcxx_src_root/src/experimental/filesystem -// RUN: %run - -#include <experimental/filesystem> -#include <chrono> -#include <type_traits> -#include <limits> -#include <cstddef> -#include <cassert> - -#include "filesystem_time_helper.h" - -using namespace std::chrono; -namespace fs = std::experimental::filesystem; -using fs::file_time_type; -using fs::fs_time_util; - -enum TestKind { TK_64Bit, TK_32Bit, TK_FloatingPoint }; - -template <class FileTimeT, class TimeT, class TimeSpec> -constexpr TestKind getTestKind() { - if (sizeof(TimeT) == 8 && !std::is_floating_point<TimeT>::value) - return TK_64Bit; - else if (sizeof(TimeT) == 4 && !std::is_floating_point<TimeT>::value) - return TK_32Bit; - else if (std::is_floating_point<TimeT>::value) - return TK_FloatingPoint; - else - assert(false && "test kind not supported"); -} - -template <class FileTimeT, class TimeT, class TimeSpecT, - class Base = fs_time_util<FileTimeT, TimeT, TimeSpecT>, - TestKind = getTestKind<FileTimeT, TimeT, TimeSpecT>()> -struct check_is_representable; - -template <class FileTimeT, class TimeT, class TimeSpecT, class Base> -struct check_is_representable<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit> - : public Base { - - using Base::convert_timespec; - using Base::is_representable; - using Base::max_nsec; - using Base::max_seconds; - using Base::min_nsec_timespec; - using Base::min_seconds; - - static constexpr auto max_time_t = std::numeric_limits<TimeT>::max(); - static constexpr auto min_time_t = std::numeric_limits<TimeT>::min(); - - static constexpr bool test_timespec() { - static_assert(is_representable(TimeSpecT{max_seconds, max_nsec}), ""); - static_assert(!is_representable(TimeSpecT{max_seconds + 1, 0}), ""); - static_assert(!is_representable(TimeSpecT{max_seconds, max_nsec + 1}), ""); - static_assert(!is_representable(TimeSpecT{max_time_t, 0}), ""); - static_assert(is_representable(TimeSpecT{min_seconds, 0}), ""); - static_assert( - is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec}), ""); - static_assert( - is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}), - ""); - static_assert( - !is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec - 1}), - ""); - static_assert(!is_representable(TimeSpecT{min_time_t, 999999999}), ""); - return true; - } - - static constexpr bool test_file_time_type() { - static_assert(Base::is_representable(FileTimeT::max()), ""); - static_assert(Base::is_representable(FileTimeT::min()), ""); - return true; - } - - static constexpr bool test_convert_timespec() { - static_assert(convert_timespec(TimeSpecT{max_seconds, max_nsec}) == - FileTimeT::max(), - ""); - static_assert(convert_timespec(TimeSpecT{max_seconds, max_nsec - 1}) < - FileTimeT::max(), - ""); - static_assert(convert_timespec(TimeSpecT{max_seconds - 1, 999999999}) < - FileTimeT::max(), - ""); - static_assert(convert_timespec(TimeSpecT{ - min_seconds - 1, min_nsec_timespec}) == FileTimeT::min(), - ""); - static_assert( - convert_timespec(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}) > - FileTimeT::min(), - ""); - static_assert( - convert_timespec(TimeSpecT{min_seconds, 0}) > FileTimeT::min(), ""); - return true; - } - - static bool test() { - static_assert(test_timespec(), ""); - static_assert(test_file_time_type(), ""); - static_assert(test_convert_timespec(), ""); - return true; - } -}; - -template <class FileTimeT, class TimeT, class TimeSpecT, class Base> -struct check_is_representable<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit> - : public Base { - static constexpr auto max_time_t = std::numeric_limits<TimeT>::max(); - static constexpr auto min_time_t = std::numeric_limits<TimeT>::min(); - - using Base::convert_timespec; - using Base::is_representable; - using Base::max_nsec; - using Base::max_seconds; - using Base::min_nsec_timespec; - using Base::min_seconds; - - static constexpr bool test_timespec() { - static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), ""); - static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), ""); - static_assert(is_representable(TimeSpecT{min_time_t, 0}), ""); - return true; - } - - static constexpr bool test_file_time_type() { - static_assert(!is_representable(FileTimeT::max()), ""); - static_assert(!is_representable(FileTimeT::min()), ""); - static_assert(is_representable(FileTimeT(seconds(max_time_t))), ""); - static_assert(is_representable(FileTimeT(seconds(min_time_t))), ""); - return true; - } - - static constexpr bool test_convert_timespec() { - // FIXME add tests for 32 bit builds - return true; - } - - static bool test() { - static_assert(test_timespec(), ""); - static_assert(test_file_time_type(), ""); - static_assert(test_convert_timespec(), ""); - return true; - } -}; - -template <class FileTimeT, class TimeT, class TimeSpec, class Base> -struct check_is_representable<FileTimeT, TimeT, TimeSpec, Base, - TK_FloatingPoint> : public Base { - - static bool test() { return true; } -}; - -template <class TimeT, class NSecT = long> -struct TestTimeSpec { - TimeT tv_sec; - NSecT tv_nsec; -}; - -template <class Dur> -struct TestClock { - typedef Dur duration; - typedef typename duration::rep rep; - typedef typename duration::period period; - typedef std::chrono::time_point<TestClock> time_point; - static constexpr const bool is_steady = false; - - static time_point now() noexcept { return {}; } -}; - -template <class IntType, class Dur = duration<IntType, std::micro> > -using TestFileTimeT = time_point<TestClock<Dur> >; - -int main() { - assert(( - check_is_representable<file_time_type, time_t, struct timespec>::test())); - assert((check_is_representable<TestFileTimeT<int64_t>, int64_t, - TestTimeSpec<int64_t, long> >::test())); - assert((check_is_representable<TestFileTimeT<long long>, int32_t, - TestTimeSpec<int32_t, int32_t> >::test())); - - // Test that insane platforms like ppc64 linux, which use long double as time_t, - // at least compile. - assert((check_is_representable<TestFileTimeT<long double>, double, - TestTimeSpec<long double, long> >::test())); -} diff --git a/test/libcxx/experimental/filesystem/version.pass.cpp b/test/libcxx/experimental/filesystem/version.pass.cpp index 723380a26fbae..d5f36a6b313b0 100644 --- a/test/libcxx/experimental/filesystem/version.pass.cpp +++ b/test/libcxx/experimental/filesystem/version.pass.cpp @@ -7,8 +7,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03 - // <experimental/filesystem> #include <experimental/filesystem> diff --git a/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp index 83b3041963719..40bacbcbad590 100644 --- a/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp +++ b/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp @@ -79,12 +79,12 @@ struct CountCopies { }; struct CountCopiesAllocV1 { - typedef ex::memory_resource* allocator_type; - allocator_type alloc; + typedef ex::polymorphic_allocator<char> allocator_type; + ex::memory_resource *alloc; int count; CountCopiesAllocV1() : alloc(nullptr), count(0) {} CountCopiesAllocV1(std::allocator_arg_t, allocator_type const& a, - CountCopiesAllocV1 const& o) : alloc(a), count(o.count + 1) + CountCopiesAllocV1 const& o) : alloc(a.resource()), count(o.count + 1) {} CountCopiesAllocV1(CountCopiesAllocV1 const& o) : count(o.count + 1) {} @@ -92,12 +92,12 @@ struct CountCopiesAllocV1 { struct CountCopiesAllocV2 { - typedef ex::memory_resource* allocator_type; - allocator_type alloc; + typedef ex::polymorphic_allocator<char> allocator_type; + ex::memory_resource *alloc; int count; CountCopiesAllocV2() : alloc(nullptr), count(0) {} CountCopiesAllocV2(CountCopiesAllocV2 const& o, allocator_type const& a) - : alloc(a), count(o.count + 1) + : alloc(a.resource()), count(o.count + 1) { } CountCopiesAllocV2(CountCopiesAllocV2 const& o) : count(o.count + 1) {} diff --git a/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp deleted file mode 100644 index be3aacdc362ca..0000000000000 --- a/test/libcxx/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp +++ /dev/null @@ -1,21 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/system_error> - -#include <experimental/system_error> - -#ifndef _LIBCPP_SYSTEM_ERROR -# error "<experimental/system_error> must include <system_error>" -#endif - -int main() -{ -} diff --git a/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp deleted file mode 100644 index e91068c742e18..0000000000000 --- a/test/libcxx/experimental/utilities/time/header.chrono.synop/includes.pass.cpp +++ /dev/null @@ -1,21 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/chrono> - -#include <experimental/chrono> - -#ifndef _LIBCPP_CHRONO -# error "<experimental/chrono> must include <chrono>" -#endif - -int main() -{ -} diff --git a/test/libcxx/experimental/utilities/time/version.pass.cpp b/test/libcxx/experimental/utilities/time/version.pass.cpp deleted file mode 100644 index be97466f37c09..0000000000000 --- a/test/libcxx/experimental/utilities/time/version.pass.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <experimental/chrono> - -#include <experimental/chrono> - -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif - -int main() -{ -} diff --git a/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp deleted file mode 100644 index defa454d68f75..0000000000000 --- a/test/libcxx/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/tuple> - -#include <experimental/tuple> - -int main() -{ -#ifndef _LIBCPP_TUPLE -# error "<experimental/tuple> must include <tuple>" -#endif -} diff --git a/test/libcxx/experimental/utilities/tuple/version.pass.cpp b/test/libcxx/experimental/utilities/tuple/version.pass.cpp deleted file mode 100644 index 5a3fd2e39647d..0000000000000 --- a/test/libcxx/experimental/utilities/tuple/version.pass.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <experimental/tuple> - -#include <experimental/tuple> - -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif - -int main() -{ -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp b/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp index 1f04580ddabd4..84045cf3c94f0 100644 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool3.fail.cpp +++ b/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp @@ -6,20 +6,19 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. +// <fstream> -#include <experimental/numeric> +// template<class charT, class traits = char_traits<charT>> +// class basic_filebuf; +// +// The char type of the stream and the char_type of the traits have to match +#include <fstream> int main() { - std::experimental::gcd<volatile bool, int>(false, 4); + std::basic_filebuf<char, std::char_traits<wchar_t> > f; +// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} } + diff --git a/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..9808d1c096001 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_fstream + +// explicit basic_fstream(const wchar_t* s, ios_base::openmode mode = ios_base::in | ios_base::out); + +#include <fstream> +#include <cassert> +#include "platform_support.h" + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + std::wstring temp = get_wide_temp_file_name(); + { + std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); + { + std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..131b587639aa7 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_fstream + +// void open(const wchar_t* s, ios_base::openmode mode = ios_base::in|ios_base::out); + +#include <fstream> +#include <cassert> +#include "platform_support.h" + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + std::wstring temp = get_wide_temp_file_name(); + { + std::fstream fs; + assert(!fs.is_open()); + fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); + assert(fs.is_open()); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); + { + std::wfstream fs; + assert(!fs.is_open()); + fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); + assert(fs.is_open()); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat new file mode 100644 index 0000000000000..64064d34a8e3e --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/test.dat @@ -0,0 +1 @@ +3.25
\ No newline at end of file diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..84a2bf992eb33 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ifstream + +// explicit basic_ifstream(const wchar_t* s, ios_base::openmode mode = ios_base::in); + +#include <fstream> +#include <cassert> + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + { + std::ifstream fs(L"test.dat"); + double x = 0; + fs >> x; + assert(x == 3.25); + } + // std::ifstream(const wchar_t*, std::ios_base::openmode) is tested in + // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp + // which creates writable files. + { + std::wifstream fs(L"test.dat"); + double x = 0; + fs >> x; + assert(x == 3.25); + } + // std::wifstream(const wchar_t*, std::ios_base::openmode) is tested in + // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp + // which creates writable files. +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..81351b5572b69 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ifstream + +// void open(const wchar_t* s, ios_base::openmode mode = ios_base::in); + +#include <fstream> +#include <cassert> + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + { + std::ifstream fs; + assert(!fs.is_open()); + char c = 'a'; + fs >> c; + assert(fs.fail()); + assert(c == 'a'); + fs.open(L"test.dat"); + assert(fs.is_open()); + fs >> c; + assert(c == 'r'); + } + { + std::wifstream fs; + assert(!fs.is_open()); + wchar_t c = L'a'; + fs >> c; + assert(fs.fail()); + assert(c == L'a'); + fs.open(L"test.dat"); + assert(fs.is_open()); + fs >> c; + assert(c == L'r'); + } +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat new file mode 100644 index 0000000000000..1d2f01491f783 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ifstream.members/test.dat @@ -0,0 +1 @@ +r
\ No newline at end of file diff --git a/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..6741e75cebadc --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ofstream + +// explicit basic_ofstream(const wchar_t* s, ios_base::openmode mode = ios_base::out); + +#include <fstream> +#include <cassert> +#include "platform_support.h" + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + std::wstring temp = get_wide_temp_file_name(); + { + std::ofstream fs(temp.c_str()); + fs << 3.25; + } + { + std::ifstream fs(temp.c_str()); + double x = 0; + fs >> x; + assert(x == 3.25); + } + { + std::ifstream fs(temp.c_str(), std::ios_base::out); + double x = 0; + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); + { + std::wofstream fs(temp.c_str()); + fs << 3.25; + } + { + std::wifstream fs(temp.c_str()); + double x = 0; + fs >> x; + assert(x == 3.25); + } + { + std::wifstream fs(temp.c_str(), std::ios_base::out); + double x = 0; + fs >> x; + assert(x == 3.25); + } + _wremove(temp.c_str()); +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp b/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp new file mode 100644 index 0000000000000..8c2e6230857cc --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ofstream + +// void open(const wchar_t* s, ios_base::openmode mode = ios_base::out); + +#include <fstream> +#include <cassert> +#include "platform_support.h" + +int main() +{ +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR + std::wstring temp = get_wide_temp_file_name(); + { + std::ofstream fs; + assert(!fs.is_open()); + char c = 'a'; + fs << c; + assert(fs.fail()); + fs.open(temp.c_str()); + assert(fs.is_open()); + fs << c; + } + { + std::ifstream fs(temp.c_str()); + char c = 0; + fs >> c; + assert(c == 'a'); + } + _wremove(temp.c_str()); + { + std::wofstream fs; + assert(!fs.is_open()); + wchar_t c = L'a'; + fs << c; + assert(fs.fail()); + fs.open(temp.c_str()); + assert(fs.is_open()); + fs << c; + } + { + std::wifstream fs(temp.c_str()); + wchar_t c = 0; + fs >> c; + assert(c == L'a'); + } + _wremove(temp.c_str()); +#endif +} diff --git a/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp new file mode 100644 index 0000000000000..c843b7e988ba1 --- /dev/null +++ b/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_fstream + +// The char type of the stream and the char_type of the traits have to match + +#include <fstream> + +int main() +{ + std::basic_fstream<char, std::char_traits<wchar_t> > f; +// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} +// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} + +// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching +// exception specifications for types which are already invalid for one reason or another. +// For now we tolerate this diagnostic. +// expected-error@ostream:* 0-1 {{exception specification of overriding function is more lax than base version}} +} + diff --git a/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp b/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp new file mode 100644 index 0000000000000..6372755fc09e1 --- /dev/null +++ b/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// RUN: %build -I%libcxx_src_root/src/filesystem +// RUN: %run + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +#include "filesystem_common.h" + +using namespace fs::detail; + +TEST_SUITE(directory_entry_mods_suite) + +TEST_CASE(last_write_time_not_representable_error) { + using namespace fs; + using namespace std::chrono; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + + TimeSpec ToTime; + ToTime.tv_sec = std::numeric_limits<decltype(ToTime.tv_sec)>::max(); + ToTime.tv_nsec = duration_cast<nanoseconds>(seconds(1)).count() - 1; + + std::array<TimeSpec, 2> TS = {ToTime, ToTime}; + + file_time_type old_time = last_write_time(file); + directory_entry ent(file); + + file_time_type start_time = file_time_type::clock::now() - hours(1); + last_write_time(file, start_time); + + TEST_CHECK(ent.last_write_time() == old_time); + + bool IsRepresentable = true; + file_time_type rep_value; + { + std::error_code ec; + TEST_REQUIRE(!set_file_times(file, TS, ec)); + ec.clear(); + rep_value = last_write_time(file, ec); + IsRepresentable = !bool(ec); + } + + if (!IsRepresentable) { + std::error_code rec = GetTestEC(); + ent.refresh(rec); + TEST_CHECK(!rec); + + const std::errc expected_err = std::errc::value_too_large; + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, expected_err)); + + ec = GetTestEC(); + TEST_CHECK(last_write_time(file, ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, expected_err)); + + ExceptionChecker CheckExcept(file, expected_err, + "directory_entry::last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, CheckExcept, + ent.last_write_time()); + + } else { + ent.refresh(); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == rep_value); + TEST_CHECK(!ec); + } +} + +TEST_SUITE_END() diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp b/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp index aea46f10c9bc9..405f9abc242c7 100644 --- a/test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp +++ b/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp @@ -10,14 +10,16 @@ // UNSUPPORTED: c++98, c++03 // UNSUPPORTED: libcpp-no-exceptions -// <experimental/filesystem> +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS +// MODULES_DEFINES: _LIBCPP_DEBUG=0 + +// <filesystem> // class path #define _LIBCPP_DEBUG 0 -#define _LIBCPP_ASSERT(cond, msg) ((cond) ? ((void)0) : throw 42) - -#include <experimental/filesystem> +#define _LIBCPP_DEBUG_USE_EXCEPTIONS +#include "filesystem_include.hpp" #include <iterator> #include <type_traits> #include <cassert> @@ -25,21 +27,20 @@ #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; - int main() { using namespace fs; + using ExType = std::__libcpp_debug_exception; // Test incrementing/decrementing a singular iterator { path::iterator singular; try { ++singular; assert(false); - } catch (int) {} + } catch (ExType const&) {} try { --singular; assert(false); - } catch (int) {} + } catch (ExType const&) {} } // Test decrementing the begin iterator { @@ -48,13 +49,13 @@ int main() { try { --it; assert(false); - } catch (int) {} + } catch (ExType const&) {} ++it; ++it; try { ++it; assert(false); - } catch (int) {} + } catch (ExType const&) {} } // Test incrementing the end iterator { @@ -63,12 +64,12 @@ int main() { try { ++it; assert(false); - } catch (int) {} + } catch (ExType const&) {} --it; --it; try { --it; assert(false); - } catch (int) {} + } catch (ExType const&) {} } } diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp b/test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp index 5a6f5304a0618..992cdebb5f064 100644 --- a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp +++ b/test/libcxx/input.output/filesystems/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp @@ -9,16 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <iterator> -namespace fs = std::experimental::filesystem; - int main() { using namespace fs; using RIt = std::reverse_iterator<path::iterator>; diff --git a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp b/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp index 61d3225240714..ff0cc5935f5c9 100644 --- a/test/libcxx/experimental/filesystem/class.path/path.req/is_pathable.pass.cpp +++ b/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // template <class Tp> struct __is_pathable @@ -21,7 +21,7 @@ // * A character array, which points to a NTCTS after array-to-pointer decay. -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -30,8 +30,6 @@ #include "min_allocator.h" #include "constexpr_char_traits.hpp" -namespace fs = std::experimental::filesystem; - using fs::__is_pathable; template <class Tp> diff --git a/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp b/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp new file mode 100644 index 0000000000000..21a1a4992da39 --- /dev/null +++ b/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp @@ -0,0 +1,307 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <filesystem> + +// typedef TrivialClock file_time_type; + +// RUN: %build -I%libcxx_src_root/src/filesystem +// RUN: %run + +#include <filesystem> +#include <chrono> +#include <type_traits> +#include <limits> +#include <cstddef> +#include <cassert> + +#include "filesystem_common.h" + +#ifndef __SIZEOF_INT128__ +#define TEST_HAS_NO_INT128_T +#endif + +using namespace std::chrono; +namespace fs = std::__fs::filesystem; +using fs::file_time_type; +using fs::detail::time_util; + +#ifdef TEST_HAS_NO_INT128_T +static_assert(sizeof(fs::file_time_type::rep) <= 8, ""); +#endif + +enum TestKind { TK_128Bit, TK_64Bit, TK_32Bit, TK_FloatingPoint }; + +template <class TimeT> +constexpr TestKind getTimeTTestKind() { + if (sizeof(TimeT) == 8 && !std::is_floating_point<TimeT>::value) + return TK_64Bit; + else if (sizeof(TimeT) == 4 && !std::is_floating_point<TimeT>::value) + return TK_32Bit; + else if (std::is_floating_point<TimeT>::value) + return TK_FloatingPoint; + else + assert(false && "test kind not supported"); +} +template <class FileTimeT> +constexpr TestKind getFileTimeTestKind() { + using Rep = typename FileTimeT::rep; + if (std::is_floating_point<Rep>::value) + return TK_FloatingPoint; + else if (sizeof(Rep) == 16) + return TK_128Bit; + else if (sizeof(Rep) == 8) + return TK_64Bit; + else + assert(false && "test kind not supported"); +} + +template <class FileTimeT, class TimeT, class TimeSpecT, + class Base = time_util<FileTimeT, TimeT, TimeSpecT>, + TestKind = getTimeTTestKind<TimeT>(), + TestKind = getFileTimeTestKind<FileTimeT>()> +struct test_case; + +template <class FileTimeT, class TimeT, class TimeSpecT, class Base> +struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit> + : public Base { + + using Base::convert_from_timespec; + using Base::convert_to_timespec; + using Base::is_representable; + using Base::max_nsec; + using Base::max_seconds; + using Base::min_nsec_timespec; + using Base::min_seconds; + + static constexpr auto max_time_t = std::numeric_limits<TimeT>::max(); + static constexpr auto min_time_t = std::numeric_limits<TimeT>::min(); + + static constexpr bool test_timespec() { + static_assert(is_representable(TimeSpecT{max_time_t, 0}), ""); + static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), ""); + static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), ""); + static_assert(is_representable(TimeSpecT{max_time_t, max_nsec}), ""); + + static_assert(is_representable(TimeSpecT{min_time_t, 0}), ""); + static_assert(is_representable(TimeSpecT{min_time_t, 999999999}), ""); + static_assert(is_representable(TimeSpecT{min_time_t, 1000000000}), ""); + static_assert(is_representable(TimeSpecT{min_time_t, min_nsec_timespec}), + ""); + + return true; + } + + static constexpr bool test_file_time_type() { + // This kinda sucks. Oh well. + static_assert(!Base::is_representable(FileTimeT::max()), ""); + static_assert(!Base::is_representable(FileTimeT::min()), ""); + return true; + } + + static constexpr bool check_round_trip(TimeSpecT orig) { + TimeSpecT new_ts = {}; + FileTimeT out = convert_from_timespec(orig); + assert(convert_to_timespec(new_ts, out)); + return new_ts.tv_sec == orig.tv_sec && new_ts.tv_nsec == orig.tv_nsec; + } + + static constexpr bool test_convert_timespec() { + static_assert(check_round_trip({0, 0}), ""); + static_assert(check_round_trip({0, 1}), ""); + static_assert(check_round_trip({1, 1}), ""); + static_assert(check_round_trip({-1, 1}), ""); + static_assert(check_round_trip({max_time_t, max_nsec}), ""); + static_assert(check_round_trip({max_time_t, 123}), ""); + static_assert(check_round_trip({min_time_t, min_nsec_timespec}), ""); + static_assert(check_round_trip({min_time_t, 123}), ""); + return true; + } + + static bool test() { + static_assert(test_timespec(), ""); + static_assert(test_file_time_type(), ""); + static_assert(test_convert_timespec(), ""); + return true; + } +}; + +template <class FileTimeT, class TimeT, class TimeSpecT, class Base> +struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_128Bit> + : public test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_128Bit> { + +}; + +template <class FileTimeT, class TimeT, class TimeSpecT, class Base> +struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_64Bit, TK_64Bit> + : public Base { + + using Base::convert_from_timespec; + using Base::is_representable; + using Base::max_nsec; + using Base::max_seconds; + using Base::min_nsec_timespec; + using Base::min_seconds; + + static constexpr auto max_time_t = std::numeric_limits<TimeT>::max(); + static constexpr auto min_time_t = std::numeric_limits<TimeT>::min(); + + static constexpr bool test_timespec() { + static_assert(is_representable(TimeSpecT{max_seconds, max_nsec}), ""); + static_assert(!is_representable(TimeSpecT{max_seconds + 1, 0}), ""); + static_assert(!is_representable(TimeSpecT{max_seconds, max_nsec + 1}), ""); + static_assert(!is_representable(TimeSpecT{max_time_t, 0}), ""); + static_assert(is_representable(TimeSpecT{min_seconds, 0}), ""); + static_assert( + is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec}), ""); + static_assert( + is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}), + ""); + static_assert( + !is_representable(TimeSpecT{min_seconds - 1, min_nsec_timespec - 1}), + ""); + static_assert(!is_representable(TimeSpecT{min_time_t, 999999999}), ""); + return true; + } + + static constexpr bool test_file_time_type() { + static_assert(Base::is_representable(FileTimeT::max()), ""); + static_assert(Base::is_representable(FileTimeT::min()), ""); + return true; + } + + static constexpr bool test_convert_timespec() { + static_assert(convert_from_timespec(TimeSpecT{max_seconds, max_nsec}) == + FileTimeT::max(), + ""); + static_assert(convert_from_timespec(TimeSpecT{max_seconds, max_nsec - 1}) < + FileTimeT::max(), + ""); + static_assert(convert_from_timespec(TimeSpecT{max_seconds - 1, 999999999}) < + FileTimeT::max(), + ""); + static_assert(convert_from_timespec(TimeSpecT{ + min_seconds - 1, min_nsec_timespec}) == FileTimeT::min(), + ""); + static_assert(convert_from_timespec( + TimeSpecT{min_seconds - 1, min_nsec_timespec + 1}) > + FileTimeT::min(), + ""); + static_assert(convert_from_timespec(TimeSpecT{min_seconds, 0}) > + FileTimeT::min(), + ""); + return true; + } + + static bool test() { + static_assert(test_timespec(), ""); + static_assert(test_file_time_type(), ""); + static_assert(test_convert_timespec(), ""); + return true; + } +}; + +template <class FileTimeT, class TimeT, class TimeSpecT, class Base> +struct test_case<FileTimeT, TimeT, TimeSpecT, Base, TK_32Bit, TK_64Bit> + : public Base { + static constexpr auto max_time_t = std::numeric_limits<TimeT>::max(); + static constexpr auto min_time_t = std::numeric_limits<TimeT>::min(); + + using Base::convert_from_timespec; + using Base::is_representable; + using Base::max_nsec; + using Base::max_seconds; + using Base::min_nsec_timespec; + using Base::min_seconds; + + static constexpr bool test_timespec() { + static_assert(is_representable(TimeSpecT{max_time_t, 999999999}), ""); + static_assert(is_representable(TimeSpecT{max_time_t, 1000000000}), ""); + static_assert(is_representable(TimeSpecT{min_time_t, 0}), ""); + return true; + } + + static constexpr bool test_file_time_type() { + static_assert(!is_representable(FileTimeT::max()), ""); + static_assert(!is_representable(FileTimeT::min()), ""); + static_assert(is_representable(FileTimeT(seconds(max_time_t))), ""); + static_assert(is_representable(FileTimeT(seconds(min_time_t))), ""); + return true; + } + + static constexpr bool test_convert_timespec() { + // FIXME add tests for 32 bit builds + return true; + } + + static bool test() { + static_assert(test_timespec(), ""); + static_assert(test_file_time_type(), ""); + static_assert(test_convert_timespec(), ""); + return true; + } +}; + +template <class FileTimeT, class TimeT, class TimeSpec, class Base, + TestKind FileTimeTKind> +struct test_case<FileTimeT, TimeT, TimeSpec, Base, TK_FloatingPoint, + FileTimeTKind> : public Base { + + static bool test() { return true; } +}; + +template <class TimeT, class NSecT = long> +struct TestTimeSpec { + TimeT tv_sec; + NSecT tv_nsec; +}; + +template <class Dur> +struct TestClock { + typedef Dur duration; + typedef typename duration::rep rep; + typedef typename duration::period period; + typedef std::chrono::time_point<TestClock> time_point; + static constexpr const bool is_steady = false; + + static time_point now() noexcept { return {}; } +}; + +template <class IntType, class Period = std::micro> +using TestFileTimeT = time_point<TestClock<duration<IntType, Period> > >; + +int main() { + { assert((test_case<file_time_type, time_t, struct timespec>::test())); } + { + assert((test_case<TestFileTimeT<int64_t>, int64_t, + TestTimeSpec<int64_t, long> >::test())); + } + { + assert((test_case<TestFileTimeT<long long>, int32_t, + TestTimeSpec<int32_t, int32_t> >::test())); + } + { + // Test that insane platforms like ppc64 linux, which use long double as time_t, + // at least compile. + assert((test_case<TestFileTimeT<long double>, double, + TestTimeSpec<long double, long> >::test())); + } +#ifndef TEST_HAS_NO_INT128_T + { + assert((test_case<TestFileTimeT<__int128_t, std::nano>, int64_t, + TestTimeSpec<int64_t, long> >::test())); + } + { + assert((test_case<TestFileTimeT<__int128_t, std::nano>, int32_t, + TestTimeSpec<int32_t, int32_t> >::test())); + } +#endif +} diff --git a/test/libcxx/experimental/filesystem/lit.local.cfg b/test/libcxx/input.output/filesystems/lit.local.cfg index 3d9360431f486..3d9360431f486 100644 --- a/test/libcxx/experimental/filesystem/lit.local.cfg +++ b/test/libcxx/input.output/filesystems/lit.local.cfg diff --git a/test/libcxx/experimental/optional/version.pass.cpp b/test/libcxx/input.output/filesystems/version.pass.cpp index 585b7a24eea5a..f680217ef2ca8 100644 --- a/test/libcxx/experimental/optional/version.pass.cpp +++ b/test/libcxx/input.output/filesystems/version.pass.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -// <optional> +// <filesystem> -#include <experimental/optional> +#include <filesystem> #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp b/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp index baad3b47f3ec7..a459ec4fb71b5 100644 --- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp +++ b/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp @@ -7,27 +7,23 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> +// <istream> -// constexpr const T& optional<T>::value() const; +// template <class charT, class traits = char_traits<charT> > +// class basic_istream; -#include <experimental/optional> +// The char type of the stream and the char_type of the traits have to match + +#include <istream> #include <type_traits> #include <cassert> -using std::experimental::optional; +struct test_istream + : public std::basic_istream<char, std::char_traits<wchar_t> > {}; -struct X -{ - constexpr int test() const {return 3;} - int test() {return 4;} -}; int main() { - { - constexpr optional<X> opt; - static_assert(opt.value().test() == 3, ""); - } +// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} } + diff --git a/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp new file mode 100644 index 0000000000000..fab0dd4365772 --- /dev/null +++ b/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <ostream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ostream; + +// The char type of the stream and the char_type of the traits have to match + +#include <ostream> +#include <type_traits> +#include <cassert> + +struct test_ostream + : public std::basic_ostream<char, std::char_traits<wchar_t> > {}; + + +int main() +{ +// expected-error-re@ios:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} +} + diff --git a/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp new file mode 100644 index 0000000000000..f048cae0c565d --- /dev/null +++ b/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp @@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <sstream> + +// template<class charT, class traits = char_traits<charT>, +// class Allocator = allocator<charT>> +// class basic_stringbuf; +// +// The char type of the stream and the char_type of the traits have to match + +#include <sstream> + +int main() +{ + std::basic_stringbuf<char, std::char_traits<wchar_t> > sb; +// expected-error-re@streambuf:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} +// expected-error-re@string:* {{static_assert failed{{.*}} "traits_type::char_type must be the same type as CharT"}} +} + diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp b/test/libcxx/iterators/failed.pass.cpp index a5bfae240073c..2e4717b385975 100644 --- a/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp +++ b/test/libcxx/iterators/failed.pass.cpp @@ -7,25 +7,26 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> +// <iterator> -// constexpr explicit optional<T>::operator bool() const noexcept; +// class ostreambuf_iterator -#include <experimental/optional> -#include <type_traits> +// bool failed() const throw(); +// +// Extension: constructing from NULL is UB; we just make it a failed iterator + +#include <iterator> +#include <sstream> #include <cassert> int main() { - using std::experimental::optional; - { - constexpr optional<int> opt; - static_assert(!opt, ""); + std::ostreambuf_iterator<char> i(nullptr); + assert(i.failed()); } { - constexpr optional<int> opt(0); - static_assert(opt, ""); + std::ostreambuf_iterator<wchar_t> i(nullptr); + assert(i.failed()); } } diff --git a/test/libcxx/experimental/any/version.pass.cpp b/test/libcxx/language.support/cmp/version.pass.cpp index 611d65027b19f..570a7a6ada3e3 100644 --- a/test/libcxx/experimental/any/version.pass.cpp +++ b/test/libcxx/language.support/cmp/version.pass.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -// <experimental/any> +// <compare> -#include <experimental/any> +#include <compare> #ifndef _LIBCPP_VERSION #error _LIBCPP_VERSION not defined diff --git a/test/libcxx/experimental/utilities/ratio/version.pass.cpp b/test/libcxx/language.support/support.limits/version.pass.cpp index 8bc583fb6d946..c79a690854b3f 100644 --- a/test/libcxx/experimental/utilities/ratio/version.pass.cpp +++ b/test/libcxx/language.support/support.limits/version.pass.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -// <experimental/ratio> +// <version> -#include <experimental/ratio> +#include <version> -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined +#if !defined(_LIBCPP_VERSION) +#error "_LIBCPP_VERSION must be defined after including <version>" #endif int main() diff --git a/test/libcxx/memory/is_allocator.pass.cpp b/test/libcxx/memory/is_allocator.pass.cpp new file mode 100644 index 0000000000000..95f1079d61a5a --- /dev/null +++ b/test/libcxx/memory/is_allocator.pass.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// + +// <memory> +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// template<typename _Alloc> +// struct __is_allocator; + +// Is either true_type or false_type depending on if A is an allocator. + +#include <memory> +#include <string> + +#include "test_macros.h" +#include "min_allocator.h" +#include "test_allocator.h" + +template <typename T> +void test_allocators() +{ + static_assert(!std::__is_allocator<T>::value, "" ); + static_assert( std::__is_allocator<std::allocator<T>>::value, "" ); + static_assert( std::__is_allocator<test_allocator<T>>::value, "" ); + static_assert( std::__is_allocator<min_allocator<T>>::value, "" ); +} + + +int main() +{ +// test_allocators<void>(); + test_allocators<char>(); + test_allocators<int>(); + test_allocators<std::string>(); +} diff --git a/test/libcxx/min_max_macros.sh.cpp b/test/libcxx/min_max_macros.sh.cpp index bae4175b1d63a..087aa3645a50e 100644 --- a/test/libcxx/min_max_macros.sh.cpp +++ b/test/libcxx/min_max_macros.sh.cpp @@ -237,10 +237,6 @@ TEST_MACROS(); #if __cplusplus >= 201103L #include <experimental/algorithm> TEST_MACROS(); -#include <experimental/any> -TEST_MACROS(); -#include <experimental/chrono> -TEST_MACROS(); #include <experimental/deque> TEST_MACROS(); #include <experimental/dynarray> @@ -259,26 +255,14 @@ TEST_MACROS(); TEST_MACROS(); #include <experimental/memory_resource> TEST_MACROS(); -#include <experimental/numeric> -TEST_MACROS(); -#include <experimental/optional> -TEST_MACROS(); #include <experimental/propagate_const> TEST_MACROS(); -#include <experimental/ratio> -TEST_MACROS(); #include <experimental/regex> TEST_MACROS(); #include <experimental/set> TEST_MACROS(); #include <experimental/string> TEST_MACROS(); -#include <experimental/string_view> -TEST_MACROS(); -#include <experimental/system_error> -TEST_MACROS(); -#include <experimental/tuple> -TEST_MACROS(); #include <experimental/type_traits> TEST_MACROS(); #include <experimental/unordered_map> diff --git a/test/libcxx/numerics/complex.number/__sqr.pass.cpp b/test/libcxx/numerics/complex.number/__sqr.pass.cpp new file mode 100644 index 0000000000000..a3cc9dd388d31 --- /dev/null +++ b/test/libcxx/numerics/complex.number/__sqr.pass.cpp @@ -0,0 +1,81 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <complex> + +// template<class T> +// complex<T> +// __sqr(const complex<T>& x); + +#include <complex> +#include <cassert> + +template <class T> +void +test() +{ + const T tolerance = std::is_same<T, float>::value ? 1.e-6 : 1.e-14; + + typedef std::complex<T> cplx; + struct test_case + { + cplx value; + cplx expected; + }; + + const test_case cases[] = { + {cplx( 0, 0), cplx( 0, 0)}, + {cplx( 1, 0), cplx( 1, 0)}, + {cplx( 2, 0), cplx( 4, 0)}, + {cplx(-1, 0), cplx( 1, 0)}, + {cplx( 0, 1), cplx(-1, 0)}, + {cplx( 0, 2), cplx(-4, 0)}, + {cplx( 0, -1), cplx(-1, 0)}, + {cplx( 1, 1), cplx( 0, 2)}, + {cplx( 1, -1), cplx( 0, -2)}, + {cplx(-1, -1), cplx( 0, 2)}, + {cplx(0.5, 0), cplx(0.25, 0)}, + }; + + const unsigned num_cases = sizeof(cases) / sizeof(test_case); + for (unsigned i = 0; i < num_cases; ++i) + { + const test_case& test = cases[i]; + const std::complex<T> actual = std::__sqr(test.value); + assert(std::abs(actual.real() - test.expected.real()) < tolerance); + assert(std::abs(actual.imag() - test.expected.imag()) < tolerance); + } + + const cplx nan1 = std::__sqr(cplx(NAN, 0)); + assert(std::isnan(nan1.real())); + assert(std::isnan(nan1.imag())); + + const cplx nan2 = std::__sqr(cplx(0, NAN)); + assert(std::isnan(nan2.real())); + assert(std::isnan(nan2.imag())); + + const cplx nan3 = std::__sqr(cplx(NAN, NAN)); + assert(std::isnan(nan3.real())); + assert(std::isnan(nan3.imag())); + + const cplx inf1 = std::__sqr(cplx(INFINITY, 0)); + assert(std::isinf(inf1.real())); + assert(inf1.real() > 0); + + const cplx inf2 = std::__sqr(cplx(0, INFINITY)); + assert(std::isinf(inf2.real())); + assert(inf2.real() < 0); +} + +int main() +{ + test<float>(); + test<double>(); + test<long double>(); +} diff --git a/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp b/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp new file mode 100644 index 0000000000000..920c0d1852612 --- /dev/null +++ b/test/libcxx/strings/basic.string/string.modifiers/clear_and_shrink_db1.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> + +// Call __clear_and_shrink() and ensure string invariants hold + +#if _LIBCPP_DEBUG >= 1 + +#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) + +#include <string> +#include <cassert> + +int main() +{ + std::string l = "Long string so that allocation definitely, for sure, absolutely happens. Probably."; + std::string s = "short"; + + assert(l.__invariants()); + assert(s.__invariants()); + + s.__clear_and_shrink(); + assert(s.__invariants()); + assert(s.size() == 0); + + { + std::string::size_type cap = l.capacity(); + l.__clear_and_shrink(); + assert(l.__invariants()); + assert(l.size() == 0); + assert(l.capacity() < cap); + } +} + +#else + +int main() +{ +} + +#endif diff --git a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp index 9efa597d73e16..805aee138972a 100644 --- a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp +++ b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp @@ -11,6 +11,12 @@ // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS +// MODULES_DEFINES: _LIBCPP_DEBUG=0 + +// Can't test the system lib because this test enables debug mode +// UNSUPPORTED: with_system_cxx_lib + // <future> // class promise<R> @@ -18,9 +24,8 @@ // void set_exception(exception_ptr p); // Test that a null exception_ptr is diagnosed. -#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42) - #define _LIBCPP_DEBUG 0 +#define _LIBCPP_DEBUG_USE_EXCEPTIONS #include <future> #include <exception> #include <cstdlib> @@ -29,14 +34,14 @@ int main() { + typedef std::__libcpp_debug_exception ExType; { typedef int T; std::promise<T> p; try { p.set_exception(std::exception_ptr()); assert(false); - } catch (int const& value) { - assert(value == 42); + } catch (ExType const&) { } } { @@ -45,8 +50,7 @@ int main() try { p.set_exception(std::exception_ptr()); assert(false); - } catch (int const& value) { - assert(value == 42); + } catch (ExType const&) { } } } diff --git a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp index dca493382ba23..88061bb5f51f7 100644 --- a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp +++ b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp @@ -11,6 +11,12 @@ // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 +// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS +// MODULES_DEFINES: _LIBCPP_DEBUG=0 + +// Can't test the system lib because this test enables debug mode +// UNSUPPORTED: with_system_cxx_lib + // <future> // class promise<R> @@ -18,9 +24,8 @@ // void set_exception_on_thread_exit(exception_ptr p); // Test that a null exception_ptr is diagnosed. -#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42) - #define _LIBCPP_DEBUG 0 +#define _LIBCPP_DEBUG_USE_EXCEPTIONS #include <future> #include <exception> #include <cstdlib> @@ -29,14 +34,14 @@ int main() { + typedef std::__libcpp_debug_exception ExType; { typedef int T; std::promise<T> p; try { p.set_exception_at_thread_exit(std::exception_ptr()); assert(false); - } catch (int const& value) { - assert(value == 42); + } catch (ExType const& value) { } } { @@ -45,8 +50,7 @@ int main() try { p.set_exception_at_thread_exit(std::exception_ptr()); assert(false); - } catch (int const& value) { - assert(value == 42); + } catch (ExType const& value) { } } } diff --git a/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/libcxx/type_traits/is_floating_point.pass.cpp index ea7ef6cbc1088..98452fad384ba 100644 --- a/test/libcxx/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp +++ b/test/libcxx/type_traits/is_floating_point.pass.cpp @@ -6,18 +6,19 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// <type_traits> +// +// Test that is_floating_point<T>::value is true when T=__fp16 or T=_Float16. -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/ratio> - -// Test that <ratio> is included. - -#include <experimental/ratio> +#include <type_traits> -#ifndef _LIBCPP_RATIO -# error " <experimental/ratio> must include <ratio>" +int main() { +#ifdef __clang__ + static_assert(std::is_floating_point<__fp16>::value, ""); #endif - -int main() -{ +#ifdef __FLT16_MANT_DIG__ + static_assert(std::is_floating_point<_Float16>::value, ""); +#endif + return 0; } diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp deleted file mode 100644 index 1cc3c73d10fef..0000000000000 --- a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <tuple> - -// Test the diagnostics libc++ generates for invalid reference binding. -// Libc++ attempts to diagnose the following cases: -// * Constructing an lvalue reference from an rvalue. -// * Constructing an rvalue reference from an lvalue. - -#include <tuple> -#include <string> - -int main() { - std::allocator<void> alloc; - - // expected-error-re@tuple:* 4 {{static_assert failed{{.*}} "Attempted to construct a reference element in a tuple with an rvalue"}} - - // bind lvalue to rvalue - std::tuple<int const&> t(42); // expected-note {{requested here}} - std::tuple<int const&> t1(std::allocator_arg, alloc, 42); // expected-note {{requested here}} - // bind rvalue to constructed non-rvalue - std::tuple<std::string &&> t2("hello"); // expected-note {{requested here}} - std::tuple<std::string &&> t3(std::allocator_arg, alloc, "hello"); // expected-note {{requested here}} - - // FIXME: The below warnings may get emitted as an error, a warning, or not emitted at all - // depending on the flags used to compile this test. - { - // expected-warning@tuple:* 0+ {{binding reference member '__value_' to a temporary value}} - // expected-error@tuple:* 0+ {{binding reference member '__value_' to a temporary value}} - } -} diff --git a/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp new file mode 100644 index 0000000000000..cc222a70eb993 --- /dev/null +++ b/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp @@ -0,0 +1,85 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <tuple> + +// See llvm.org/PR20855 + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wdangling-field" +#endif + +#include <tuple> +#include <string> +#include "test_macros.h" + +template <class Tp> +struct ConvertsTo { + using RawTp = typename std::remove_cv< typename std::remove_reference<Tp>::type>::type; + + operator Tp() const { + return static_cast<Tp>(value); + } + + mutable RawTp value; +}; + +struct Base {}; +struct Derived : Base {}; + +template <class T> struct CannotDeduce { + using type = T; +}; + +template <class ...Args> +void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {} + + +int main() { +#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary) + // Test that we emit our diagnostic from the library. + // expected-error@tuple:* 8 {{"Attempted construction of reference element binds to a temporary whose lifetime has ended"}} + + // Good news everybody! Clang now diagnoses this for us! + // expected-error@tuple:* 0+ {{reference member '__value_' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object}} + + { + F<int, const std::string&>(std::make_tuple(1, "abc")); // expected-note 1 {{requested here}} + } + { + std::tuple<int, const std::string&> t(1, "a"); // expected-note 1 {{requested here}} + } + { + F<int, const std::string&>(std::tuple<int, const std::string&>(1, "abc")); // expected-note 1 {{requested here}} + } + { + ConvertsTo<int&> ct; + std::tuple<const long&, int> t(ct, 42); // expected-note {{requested here}} + } + { + ConvertsTo<int> ct; + std::tuple<int const&, void*> t(ct, nullptr); // expected-note {{requested here}} + } + { + ConvertsTo<Derived> ct; + std::tuple<Base const&, int> t(ct, 42); // expected-note {{requested here}} + } + { + std::allocator<void> alloc; + std::tuple<std::string &&> t2("hello"); // expected-note {{requested here}} + std::tuple<std::string &&> t3(std::allocator_arg, alloc, "hello"); // expected-note {{requested here}} + } +#else +#error force failure +// expected-error@-1 {{force failure}} +#endif +} diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp b/test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp index ef7bebcf5c295..0e0117e4e3ea7 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/assign_tuple.pass.cpp +++ b/test/libcxx/utilities/utility/pairs/pairs.pair/assign_tuple_like.pass.cpp @@ -21,58 +21,22 @@ #include <memory> #include <cassert> +#include "archetypes.hpp" + // Clang warns about missing braces when initializing std::array. #if defined(__clang__) #pragma clang diagnostic ignored "-Wmissing-braces" #endif -struct CountingType { - static int constructed; - static int copy_constructed; - static int move_constructed; - static int assigned; - static int copy_assigned; - static int move_assigned; - static void reset() { - constructed = copy_constructed = move_constructed = 0; - assigned = copy_assigned = move_assigned = 0; - } - CountingType() : value(0) { ++constructed; } - CountingType(int v) : value(v) { ++constructed; } - CountingType(CountingType const& o) : value(o.value) { ++constructed; ++copy_constructed; } - CountingType(CountingType&& o) : value(o.value) { ++constructed; ++move_constructed; o.value = -1;} - - CountingType& operator=(CountingType const& o) { - ++assigned; - ++copy_assigned; - value = o.value; - return *this; - } - CountingType& operator=(CountingType&& o) { - ++assigned; - ++move_assigned; - value = o.value; - o.value = -1; - return *this; - } - int value; -}; -int CountingType::constructed; -int CountingType::copy_constructed; -int CountingType::move_constructed; -int CountingType::assigned; -int CountingType::copy_assigned; -int CountingType::move_assigned; - int main() { - using C = CountingType; + using C = TestTypes::TestType; { using P = std::pair<int, C>; using T = std::tuple<int, C>; T t(42, C{42}); P p(101, C{101}); - C::reset(); + C::reset_constructors(); p = t; assert(C::constructed == 0); assert(C::assigned == 1); @@ -86,7 +50,7 @@ int main() using T = std::tuple<int, C>; T t(42, -42); P p(101, 101); - C::reset(); + C::reset_constructors(); p = std::move(t); assert(C::constructed == 0); assert(C::assigned == 1); @@ -100,7 +64,7 @@ int main() using T = std::array<C, 2>; T t = {42, -42}; P p{101, 101}; - C::reset(); + C::reset_constructors(); p = t; assert(C::constructed == 0); assert(C::assigned == 2); @@ -114,7 +78,7 @@ int main() using T = std::array<C, 2>; T t = {42, -42}; P p{101, 101}; - C::reset(); + C::reset_constructors(); p = t; assert(C::constructed == 0); assert(C::assigned == 2); @@ -128,7 +92,7 @@ int main() using T = std::array<C, 2>; T t = {42, -42}; P p{101, 101}; - C::reset(); + C::reset_constructors(); p = std::move(t); assert(C::constructed == 0); assert(C::assigned == 2); diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index 72dcc3aefda3d..53f797268f170 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -22,8 +22,12 @@ config.sysroot = "@LIBCXX_SYSROOT@" config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@" config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@" config.target_info = "@LIBCXX_TARGET_INFO@" +config.test_linker_flags = "@LIBCXX_TEST_LINKER_FLAGS@" +config.test_compiler_flags = "@LIBCXX_TEST_COMPILER_FLAGS@" + config.executor = "@LIBCXX_EXECUTOR@" config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@" +config.compiler_rt = "@LIBCXX_USE_COMPILER_RT@" config.has_libatomic = "@LIBCXX_HAS_ATOMIC_LIB@" config.use_libatomic = "@LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB@" config.debug_build = "@LIBCXX_DEBUG_BUILD@" diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp index a20d6ab7df863..d2d567f317de6 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp @@ -10,14 +10,27 @@ // <algorithm> // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter> -// OutIter +// constexpr OutIter // constexpr after C++17 // copy(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {1, 2, 3, 4, 5}; +// int ic[] = {6, 6, 6, 6, 6, 6, 6}; +// +// auto p = std::copy(std::begin(ia), std::end(ia), std::begin(ic)); +// return std::equal(std::begin(ia), std::end(ia), std::begin(ic), p) +// && std::all_of(p, std::end(ic), [](int a){return a == 6;}) +// ; +// } +// #endif + template <class InIter, class OutIter> void test() @@ -70,4 +83,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp index 039fd2fe026a7..3a2f0f62c2ec3 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp @@ -11,13 +11,28 @@ // template<BidirectionalIterator InIter, BidirectionalIterator OutIter> // requires OutputIterator<OutIter, InIter::reference> -// OutIter +// constexpr OutIter // constexpr after C++17 // copy_backward(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#include "user_defined_integral.hpp" + +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {1, 2, 3, 4, 5}; +// int ic[] = {6, 6, 6, 6, 6, 6, 6}; +// +// size_t N = std::size(ia); +// auto p = std::copy_backward(std::begin(ia), std::end(ia), std::begin(ic) + N); +// return std::equal(std::begin(ic), p, std::begin(ia)) +// && std::all_of(p, std::end(ic), [](int a){return a == 6;}) +// ; +// } +// #endif template <class InIter, class OutIter> void @@ -48,4 +63,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp index ab402a5eb8be7..19018151f20f1 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp @@ -12,14 +12,27 @@ // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter, // Predicate<auto, InIter::value_type> Pred> // requires CopyConstructible<Pred> -// OutIter +// constexpr OutIter // constexpr after C++17 // copy_if(InIter first, InIter last, OutIter result, Pred pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {2, 4, 6, 8, 6}; +// int ic[] = {0, 0, 0, 0, 0, 0}; +// +// auto p = std::copy_if(std::begin(ia), std::end(ia), std::begin(ic), is6); +// return std::all_of(std::begin(ic), p, [](int a){return a == 6;}) +// && std::all_of(p, std::end(ic), [](int a){return a == 0;}) +// ; +// } +// #endif + struct Pred { bool operator()(int i) {return i % 3 == 0;} @@ -77,4 +90,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp index 1dba8847c7e5f..0e5fa63a32575 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp @@ -10,15 +10,28 @@ // <algorithm> // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter> -// OutIter +// constexpr OutIter // constexpr after C++17 // copy_n(InIter first, InIter::difference_type n, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "user_defined_integral.hpp" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {1, 2, 3, 4, 5}; +// int ic[] = {6, 6, 6, 6, 6, 6, 6}; +// +// auto p = std::copy_n(std::begin(ia), 4, std::begin(ic)); +// return std::equal(std::begin(ic), p, std::begin(ia)) +// && std::all_of(p, std::end(ic), [](int a){return a == 6;}) +// ; +// } +// #endif + typedef UserDefinedIntegral<unsigned> UDI; template <class InIter, class OutIter> @@ -73,4 +86,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp index c72adac9e2e41..1c08fee40bc22 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.fill/fill.pass.cpp @@ -11,14 +11,26 @@ // template<ForwardIterator Iter, class T> // requires OutputIterator<Iter, const T&> -// void +// constexpr void // constexpr after C++17 // fill(Iter first, Iter last, const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + + std::fill(std::begin(ia), std::end(ia), 5); + + return std::all_of(std::begin(ia), std::end(ia), [](int a) {return a == 5; }) + ; + } +#endif + template <class Iter> void test_char() @@ -56,4 +68,8 @@ int main() test_int<bidirectional_iterator<int*> >(); test_int<random_access_iterator<int*> >(); test_int<int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp index f39436048aefa..1e962990b8feb 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.fill/fill_n.pass.cpp @@ -11,15 +11,29 @@ // template<class Iter, IntegralLike Size, class T> // requires OutputIterator<Iter, const T&> -// OutputIterator +// constexpr OutputIterator // constexpr after C++17 // fill_n(Iter first, Size n, const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "user_defined_integral.hpp" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + const size_t N = 5; + int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N + + auto it = std::fill_n(std::begin(ib), N, 5); + return it == (std::begin(ib) + N) + && std::all_of(std::begin(ib), it, [](int a) {return a == 5; }) + && *it == 0 // don't overwrite the last value in the output array + ; + } +#endif + typedef UserDefinedIntegral<unsigned> UDI; template <class Iter> @@ -153,4 +167,8 @@ int main() test5(); test6(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp index f166d67ba2f76..1b1562866f43f 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp @@ -12,19 +12,33 @@ // template<ForwardIterator Iter, Callable Generator> // requires OutputIterator<Iter, Generator::result_type> // && CopyConstructible<Generator> -// void +// constexpr void // constexpr after c++17 // generate(Iter first, Iter last, Generator gen); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct gen_test { - int operator()() const {return 1;} + TEST_CONSTEXPR int operator()() const {return 1;} }; + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + + std::generate(std::begin(ia), std::end(ia), gen_test()); + + return std::all_of(std::begin(ia), std::end(ia), [](int x) { return x == 1; }) + ; + } +#endif + + template <class Iter> void test() @@ -44,4 +58,8 @@ int main() test<bidirectional_iterator<int*> >(); test<random_access_iterator<int*> >(); test<int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp index b7322542931d1..7e81610acc831 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp @@ -12,25 +12,42 @@ // template<class Iter, IntegralLike Size, Callable Generator> // requires OutputIterator<Iter, Generator::result_type> // && CopyConstructible<Generator> -// void +// constexpr void // constexpr after c++17 // generate_n(Iter first, Size n, Generator gen); -#ifdef _MSC_VER +#include "test_macros.h" + +#ifdef TEST_COMPILER_C1XX #pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data #endif #include <algorithm> #include <cassert> -#include "test_macros.h" #include "test_iterators.h" #include "user_defined_integral.hpp" struct gen_test { - int operator()() const {return 2;} + TEST_CONSTEXPR int operator()() const {return 2;} }; + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + const size_t N = 5; + int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger than N + + auto it = std::generate_n(std::begin(ib), N, gen_test()); + + return it == (std::begin(ib) + N) + && std::all_of(std::begin(ib), it, [](int x) { return x == 2; }) + && *it == 0 // don't overwrite the last value in the output array + ; + } +#endif + + template <class Iter, class Size> void test2() @@ -64,4 +81,8 @@ int main() test<bidirectional_iterator<int*> >(); test<random_access_iterator<int*> >(); test<int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp index 8597b08da8cf5..b68b28de47c7f 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp @@ -10,7 +10,7 @@ // <algorithm> // template <class InputIterator, class Predicate> -// bool +// constpexr bool // constexpr after C++17 // is_partitioned(InputIterator first, InputIterator last, Predicate pred); #include <algorithm> @@ -18,13 +18,24 @@ #include <cstddef> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "counting_predicates.hpp" struct is_odd { - bool operator()(const int &i) const { return i & 1; } + TEST_CONSTEXPR bool operator()(const int &i) const { return i & 1; } }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int ib[] = {1, 2, 3, 4, 5, 6}; + return std::is_partitioned(std::begin(ia), std::end(ia), is_odd()) + && !std::is_partitioned(std::begin(ib), std::end(ib), is_odd()); + } +#endif + + int main() { { const int ia[] = {1, 2, 3, 4, 5, 6}; @@ -80,4 +91,8 @@ int main() { assert(static_cast<std::ptrdiff_t>(pred.count()) <= std::distance(std::begin(ia), std::end(ia))); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp index 67e1cccaf730c..9738fef3583dc 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp @@ -11,7 +11,7 @@ // template <class InputIterator, class OutputIterator1, // class OutputIterator2, class Predicate> -// pair<OutputIterator1, OutputIterator2> +// constexpr pair<OutputIterator1, OutputIterator2> // constexpr after C++17 // partition_copy(InputIterator first, InputIterator last, // OutputIterator1 out_true, OutputIterator2 out_false, // Predicate pred); @@ -19,13 +19,31 @@ #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct is_odd { - bool operator()(const int& i) const {return i & 1;} + TEST_CONSTEXPR bool operator()(const int& i) const {return i & 1;} }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int r1[10] = {0}; + int r2[10] = {0}; + + auto p = std::partition_copy(std::begin(ia), std::end(ia), + std::begin(r1), std::begin(r2), is_odd()); + + return std::all_of(std::begin(r1), p.first, is_odd()) + && std::all_of(p.first, std::end(r1), [](int a){return a == 0;}) + && std::none_of(std::begin(r2), p.second, is_odd()) + && std::all_of(p.second, std::end(r2), [](int a){return a == 0;}) + ; + } +#endif + int main() { { @@ -47,4 +65,8 @@ int main() assert(r2[2] == 6); assert(r2[3] == 8); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp index f5b832c663970..1ea9885c1bd98 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_point.pass.cpp @@ -10,19 +10,32 @@ // <algorithm> // template<class ForwardIterator, class Predicate> -// ForwardIterator +// constpexr ForwardIterator // constexpr after C++17 // partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct is_odd { - bool operator()(const int& i) const {return i & 1;} + TEST_CONSTEXPR bool operator()(const int& i) const {return i & 1;} }; + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int ib[] = {1, 2, 3, 4, 5, 6}; + return (std::partition_point(std::begin(ia), std::end(ia), is_odd()) == ia+3) + && (std::partition_point(std::begin(ib), std::end(ib), is_odd()) == ib+1) + ; + } +#endif + + int main() { { @@ -73,4 +86,8 @@ int main() forward_iterator<const int*>(std::begin(ia)), is_odd()) == forward_iterator<const int*>(ia)); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp index a77a9eddb191f..70b3316d36796 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp @@ -12,7 +12,7 @@ // template<ForwardIterator Iter, class T> // requires OutputIterator<Iter, RvalueOf<Iter::reference>::type> // && HasEqualTo<Iter::value_type, T> -// Iter +// constexpr Iter // constexpr after C++17 // remove(Iter first, Iter last, const T& value); #include <algorithm> @@ -22,6 +22,18 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 5, 6}; + + auto it = std::remove(std::begin(ia), std::end(ia), 5); + + return (std::begin(ia) + std::size(ia) - 2) == it // we removed two elements + && std::none_of(std::begin(ia), it, [](int a) {return a == 5; }) + ; + } +#endif + template <class Iter> void test() @@ -75,4 +87,8 @@ int main() test1<random_access_iterator<std::unique_ptr<int>*> >(); test1<std::unique_ptr<int>*>(); #endif // TEST_STD_VER >= 11 + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp index bf5f79cf83592..4ace1494d858c 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy.pass.cpp @@ -11,14 +11,29 @@ // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter, class T> // requires HasEqualTo<InIter::value_type, T> -// OutIter +// constexpr OutIter // constexpr after C++17 // remove_copy(InIter first, InIter last, OutIter result, const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 5, 6}; + int ib[std::size(ia)] = {0}; + + auto it = std::remove_copy(std::begin(ia), std::end(ia), std::begin(ib), 5); + + return std::distance(std::begin(ib), it) == (std::size(ia) - 2) // we removed two elements + && std::none_of(std::begin(ib), it, [](int a) {return a == 5;}) + && std::all_of (it, std::end(ib), [](int a) {return a == 0;}) + ; + } +#endif + template <class InIter, class OutIter> void test() @@ -67,4 +82,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp index 8532998eb08d9..c13788690e88a 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp @@ -12,16 +12,31 @@ // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter, // Predicate<auto, InIter::value_type> Pred> // requires CopyConstructible<Pred> -// OutIter +// constexpr OutIter // constexpr after C++17 // remove_copy_if(InIter first, InIter last, OutIter result, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" -bool equalToTwo(int v) { return v == 2; } +TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; } + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 5, 6}; + int ib[std::size(ia)] = {0}; + + auto it = std::remove_copy_if(std::begin(ia), std::end(ia), std::begin(ib), equalToTwo); + + return std::distance(std::begin(ib), it) == (std::size(ia) - 1) // we removed one element + && std::none_of(std::begin(ib), it, equalToTwo) + && std::all_of (it, std::end(ib), [](int a) {return a == 0;}) + ; + } +#endif template <class InIter, class OutIter> void @@ -72,4 +87,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp index c40f3e727836b..7a0f3405c6068 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp @@ -12,7 +12,7 @@ // template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred> // requires OutputIterator<Iter, RvalueOf<Iter::reference>::type> // && CopyConstructible<Pred> -// Iter +// constexpr Iter // constexpr after C++17 // remove_if(Iter first, Iter last, Pred pred); #include <algorithm> @@ -24,7 +24,19 @@ #include "test_iterators.h" #include "counting_predicates.hpp" -bool equal2 ( int i ) { return i == 2; } +TEST_CONSTEXPR bool equal2 ( int i ) { return i == 2; } + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 5, 6}; + + auto it = std::remove_if(std::begin(ia), std::end(ia), equal2); + + return (std::begin(ia) + std::size(ia) - 1) == it // we removed one element + && std::none_of(std::begin(ia), it, equal2) + ; + } +#endif template <class Iter> void @@ -90,4 +102,8 @@ int main() test1<random_access_iterator<std::unique_ptr<int>*> >(); test1<std::unique_ptr<int>*>(); #endif // TEST_STD_VER >= 11 + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp index f6033351ffca4..56a744b2c9d42 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace.pass.cpp @@ -13,14 +13,27 @@ // requires OutputIterator<Iter, Iter::reference> // && OutputIterator<Iter, const T&> // && HasEqualTo<Iter::value_type, T> -// void +// constexpr void // constexpr after C++17 // replace(Iter first, Iter last, const T& old_value, const T& new_value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + const int expected[] = {0, 1, 5, 3, 4}; + + std::replace(std::begin(ia), std::end(ia), 2, 5); + return std::equal(std::begin(ia), std::end(ia), std::begin(expected), std::end(expected)) + ; + } +#endif + template <class Iter> void test() @@ -41,4 +54,8 @@ int main() test<bidirectional_iterator<int*> >(); test<random_access_iterator<int*> >(); test<int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp index 3c4d0e50817b3..32be4e5bcee02 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp @@ -13,15 +13,32 @@ // requires OutputIterator<OutIter, InIter::reference> // && OutputIterator<OutIter, const T&> // && HasEqualTo<InIter::value_type, T> -// OutIter +// constexpr OutIter // constexpr after C++17 // replace_copy(InIter first, InIter last, OutIter result, const T& old_value, // const T& new_value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger + const int expected[] = {0, 1, 5, 3, 4}; + + auto it = std::replace_copy(std::begin(ia), std::end(ia), std::begin(ib), 2, 5); + + return it == (std::begin(ib) + std::size(ia)) + && *it == 0 // don't overwrite the last value in the output array + && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) + ; + } +#endif + template <class InIter, class OutIter> void test() @@ -69,4 +86,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp index f2ffece12e8b0..3d9a5bb739a97 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp @@ -14,16 +14,33 @@ // requires OutputIterator<OutIter, InIter::reference> // && OutputIterator<OutIter, const T&> // && CopyConstructible<Pred> -// OutIter +// constexpr OutIter // constexpr after C++17 // replace_copy_if(InIter first, InIter last, OutIter result, Pred pred, const T& new_value); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" -bool equalToTwo(int v) { return v == 2; } +TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; } + + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + int ib[] = {0, 0, 0, 0, 0, 0}; // one bigger + const int expected[] = {0, 1, 5, 3, 4}; + + auto it = std::replace_copy_if(std::begin(ia), std::end(ia), std::begin(ib), equalToTwo, 5); + + return it == (std::begin(ib) + std::size(ia)) + && *it == 0 // don't overwrite the last value in the output array + && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) + ; + } +#endif template <class InIter, class OutIter> void @@ -73,4 +90,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp index ebb2945d7c434..eeff4068740f6 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp @@ -13,16 +13,29 @@ // requires OutputIterator<Iter, Iter::reference> // && OutputIterator<Iter, const T&> // && CopyConstructible<Pred> -// void +// constexpr void // constexpr after C++17 // replace_if(Iter first, Iter last, Pred pred, const T& new_value); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" -bool equalToTwo(int v) { return v == 2; } +TEST_CONSTEXPR bool equalToTwo(int v) { return v == 2; } + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3, 4}; + const int expected[] = {0, 1, 5, 3, 4}; + + std::replace_if(std::begin(ia), std::end(ia), equalToTwo, 5); + return std::equal(std::begin(ia), std::end(ia), std::begin(expected), std::end(expected)) + ; + } +#endif + template <class Iter> void @@ -44,4 +57,8 @@ int main() test<bidirectional_iterator<int*> >(); test<random_access_iterator<int*> >(); test<int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp index 70840d187bfb2..e5aa427b9f4c9 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp @@ -10,14 +10,28 @@ // <algorithm> // template<BidirectionalIterator InIter, OutputIterator<auto, InIter::reference> OutIter> -// OutIter +// constexpr OutIter // constexpr after C++17 // reverse_copy(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 5, 6}; + int ib[std::size(ia)] = {0}; + + auto it = std::reverse_copy(std::begin(ia), std::end(ia), std::begin(ib)); + + return std::distance(std::begin(ib), it) == std::size(ia) + && std::equal (std::begin(ia), std::end(ia), std::rbegin(ib)) + ; + } +#endif + template <class InIter, class OutIter> void test() @@ -78,4 +92,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp index f2ad535a2f992..e0e096a6f8fd8 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp @@ -10,14 +10,31 @@ // <algorithm> // template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter> -// OutIter +// constexpr OutIter // constexpr after C++17 // rotate_copy(InIter first, InIter middle, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {1, 3, 5, 2, 5, 6}; +// int ib[std::size(ia)] = {0}; +// +// const size_t N = 2; +// const auto middle = std::begin(ia) + N; +// auto it = std::rotate_copy(std::begin(ia), middle, std::end(ia), std::begin(ib)); +// +// return std::distance(std::begin(ib), it) == std::size(ia) +// && std::equal (std::begin(ia), middle, std::begin(ib) + std::size(ia) - N) +// && std::equal (middle, std::end(ia), std::begin(ib)) +// ; +// } +// #endif + template <class InIter, class OutIter> void test() @@ -131,4 +148,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp index 8491ea59eff65..b2b894912c381 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp @@ -12,15 +12,34 @@ // template<InputIterator InIter1, InputIterator InIter2, class OutIter, // Callable<auto, const InIter1::value_type&, const InIter2::value_type&> BinaryOp> // requires OutputIterator<OutIter, BinaryOp::result_type> && CopyConstructible<BinaryOp> -// OutIter +// constexpr OutIter // constexpr after C++17 // transform(InIter1 first1, InIter1 last1, InIter2 first2, OutIter result, BinaryOp binary_op); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + const int ia[] = {1, 3, 6, 7}; + const int ib[] = {2, 4, 7, 8}; + int ic[] = {0, 0, 0, 0, 0}; // one bigger + const int expected[] = {3, 7, 13, 15}; + + auto it = std::transform(std::begin(ia), std::end(ia), + std::begin(ib), std::begin(ic), std::plus<int>()); + + return it == (std::begin(ic) + std::size(ia)) + && *it == 0 // don't overwrite the last value in the output array + && std::equal(std::begin(expected), std::end(expected), std::begin(ic), it) + ; + } +#endif + + template<class InIter1, class InIter2, class OutIter> void test() @@ -214,4 +233,8 @@ int main() test<const int*, const int*, bidirectional_iterator<int*> >(); test<const int*, const int*, random_access_iterator<int*> >(); test<const int*, const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp index 6c5e621e4b20a..a929291adba1c 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp @@ -12,16 +12,34 @@ // template<InputIterator InIter, class OutIter, // Callable<auto, const InIter::value_type&> Op> // requires OutputIterator<OutIter, Op::result_type> && CopyConstructible<Op> -// OutIter +// constexpr OutIter // constexpr after C++17 // transform(InIter first, InIter last, OutIter result, Op op); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" -int plusOne(int v) { return v + 1; } +TEST_CONSTEXPR int plusOne(int v) { return v + 1; } + + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {0, 0, 0, 0, 0}; // one bigger + const int expected[] = {2, 4, 7, 8}; + + auto it = std::transform(std::begin(ia), std::end(ia), std::begin(ib), plusOne); + + return it == (std::begin(ib) + std::size(ia)) + && *it == 0 // don't overwrite the last value in the output array + && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) + ; + } +#endif + template <class InIter, class OutIter> void @@ -76,4 +94,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp index 049ccfe9871ab..dcb09a181e135 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp @@ -12,7 +12,7 @@ // template<ForwardIterator Iter> // requires OutputIterator<Iter, Iter::reference> // && EqualityComparable<Iter::value_type> -// Iter +// constexpr Iter // constexpr after C++17 // unique(Iter first, Iter last); #include <algorithm> @@ -22,6 +22,19 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 1, 3, 4}; + const int expected[] = {0, 1, 3, 4}; + const size_t N = 4; + + auto it = std::unique(std::begin(ia), std::end(ia)); + return it == (std::begin(ia) + N) + && std::equal(std::begin(ia), it, std::begin(expected), std::end(expected)) + ; + } +#endif + template <class Iter> void test() @@ -182,4 +195,8 @@ int main() test1<random_access_iterator<Ptr*> >(); test1<Ptr*>(); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp index 761dad4ecd053..48ddcf921e49c 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy.pass.cpp @@ -14,14 +14,29 @@ // && EqualityComparable<InIter::value_type> // && HasAssign<InIter::value_type, InIter::reference> // && Constructible<InIter::value_type, InIter::reference> -// OutIter +// constexpr OutIter // constexpr after C++17 // unique_copy(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 4}; + int ib[] = {0, 0, 0, 0, 0}; + const int expected[] = {0, 1, 2, 4}; + + auto it = std::unique_copy(std::begin(ia), std::end(ia), std::begin(ib)); + return it == (std::begin(ib) + std::size(expected)) + && *it == 0 // don't overwrite final value in output + && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) + ; + } +#endif + template <class InIter, class OutIter> void test() @@ -122,4 +137,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp index 6819899a1145a..55bfd36d57033 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_copy_pred.pass.cpp @@ -15,14 +15,30 @@ // && HasAssign<InIter::value_type, InIter::reference> // && Constructible<InIter::value_type, InIter::reference> // && CopyConstructible<Pred> -// OutIter +// constexpr OutIter // constexpr after C++17 // unique_copy(InIter first, InIter last, OutIter result, Pred pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 4}; + int ib[] = {0, 0, 0, 0, 0}; + const int expected[] = {0, 1, 2, 4}; + + auto it = std::unique_copy(std::begin(ia), std::end(ia), std::begin(ib), + [](int a, int b) {return a == b; }); + return it == (std::begin(ib) + std::size(expected)) + && *it == 0 // don't overwrite final value in output + && std::equal(std::begin(ib), it, std::begin(expected), std::end(expected)) + ; + } +#endif + struct count_equal { static unsigned count; @@ -149,4 +165,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp index 1640052058c78..2936a4e66f5c1 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp +++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp @@ -12,7 +12,7 @@ // template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred> // requires OutputIterator<Iter, RvalueOf<Iter::reference>::type> // && CopyConstructible<Pred> -// Iter +// constexpr Iter // constexpr after C++17 // unique(Iter first, Iter last, Pred pred); #include <algorithm> @@ -22,6 +22,19 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 1, 3, 4}; + const int expected[] = {0, 1, 3, 4}; + const size_t N = 4; + + auto it = std::unique(std::begin(ia), std::end(ia), [](int a, int b) {return a == b; }); + return it == (std::begin(ia) + N) + && std::equal(std::begin(ia), it, std::begin(expected), std::end(expected)) + ; + } +#endif + struct count_equal { static unsigned count; @@ -224,4 +237,8 @@ int main() test1<random_access_iterator<Ptr*> >(); test1<Ptr*>(); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp index ee030925d55c5..8de06ec7b4b09 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp @@ -11,14 +11,26 @@ // template<ForwardIterator Iter> // requires EqualityComparable<Iter::value_type> -// Iter +// constexpr Iter // constexpr after C++17 // adjacent_find(Iter first, Iter last); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; + int ib[] = {0, 1, 2, 7, 0, 1, 2, 3}; + + return (std::adjacent_find(std::begin(ia), std::end(ia)) == ia+2) + && (std::adjacent_find(std::begin(ib), std::end(ib)) == std::end(ib)) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; @@ -32,4 +44,8 @@ int main() assert(std::adjacent_find(forward_iterator<const int*>(ia+3), forward_iterator<const int*>(ia + sa)) == forward_iterator<const int*>(ia+sa)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp index 4d172ff813973..bf445c54d15cd 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp @@ -11,15 +11,30 @@ // template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred> // requires CopyConstructible<Pred> -// Iter +// constexpr Iter // constexpr after C++17 // adjacent_find(Iter first, Iter last, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq (int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; + int ib[] = {0, 1, 2, 7, 0, 1, 2, 3}; + + return (std::adjacent_find(std::begin(ia), std::end(ia), eq) == ia+2) + && (std::adjacent_find(std::begin(ib), std::end(ib), eq) == std::end(ib)) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; @@ -36,4 +51,8 @@ int main() forward_iterator<const int*>(ia + sa), std::equal_to<int>()) == forward_iterator<const int*>(ia+sa)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp index c3c3480881954..3840350a03cb4 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.all_of/all_of.pass.cpp @@ -10,22 +10,33 @@ // <algorithm> // template <class InputIterator, class Predicate> -// bool +// constpexr bool // constexpr after C++17 // all_of(InputIterator first, InputIterator last, Predicate pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct test1 { - bool operator()(const int& i) const + TEST_CONSTEXPR bool operator()(const int& i) const { return i % 2 == 0; } }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {2, 4, 6, 8}; + int ib[] = {2, 4, 5, 8}; + return std::all_of(std::begin(ia), std::end(ia), test1()) + && !std::all_of(std::begin(ib), std::end(ib), test1()) + ; + } +#endif + int main() { { @@ -44,4 +55,8 @@ int main() assert(std::all_of(input_iterator<const int*>(ia), input_iterator<const int*>(ia), test1()) == true); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp index d096e20d2d27c..7c80f718f4344 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp @@ -10,22 +10,33 @@ // <algorithm> // template <class InputIterator, class Predicate> -// bool +// constpexr bool // constexpr after C++17 // any_of(InputIterator first, InputIterator last, Predicate pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct test1 { - bool operator()(const int& i) const + TEST_CONSTEXPR bool operator()(const int& i) const { return i % 2 == 0; } }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {2, 4, 6, 8}; + int ib[] = {1, 3, 5, 7}; + return std::any_of(std::begin(ia), std::end(ia), test1()) + && !std::any_of(std::begin(ib), std::end(ib), test1()) + ; + } +#endif + int main() { { @@ -52,4 +63,8 @@ int main() assert(std::any_of(input_iterator<const int*>(ia), input_iterator<const int*>(ia), test1()) == false); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp index 260e5edece5b4..bce1095f2eaf3 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.count/count.pass.cpp @@ -11,14 +11,25 @@ // template<InputIterator Iter, class T> // requires HasEqualTo<Iter::value_type, T> -// Iter::difference_type +// constexpr Iter::difference_type // constexpr after C++17 // count(Iter first, Iter last, const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; + int ib[] = {1, 2, 3, 4, 5, 6}; + return (std::count(std::begin(ia), std::end(ia), 2) == 3) + && (std::count(std::begin(ib), std::end(ib), 9) == 0) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; @@ -29,4 +40,8 @@ int main() input_iterator<const int*>(ia + sa), 7) == 0); assert(std::count(input_iterator<const int*>(ia), input_iterator<const int*>(ia), 2) == 0); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp index b837a0e514cfc..ff3b6888aa02a 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp @@ -11,21 +11,31 @@ // template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred> // requires CopyConstructible<Pred> -// Iter::difference_type +// constexpr Iter::difference_type // constexpr after C++17 // count_if(Iter first, Iter last, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct eq { - eq (int val) : v(val) {} - bool operator () (int v2) const { return v == v2; } + TEST_CONSTEXPR eq (int val) : v(val) {} + TEST_CONSTEXPR bool operator () (int v2) const { return v == v2; } int v; }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 2, 0, 1, 2, 3}; + int ib[] = {1, 2, 3, 4, 5, 6}; + return (std::count_if(std::begin(ia), std::end(ia), eq(2)) == 3) + && (std::count_if(std::begin(ib), std::end(ib), eq(9)) == 0) + ; + } +#endif int main() { @@ -40,4 +50,8 @@ int main() assert(std::count_if(input_iterator<const int*>(ia), input_iterator<const int*>(ia), eq(2)) == 0); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp index e867b86b8312c..656c7310f4d0f 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp @@ -11,8 +11,13 @@ // template<InputIterator Iter1, InputIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// bool +// constexpr bool // constexpr after c++17 // equal(Iter1 first1, Iter1 last1, Iter2 first2); +// +// Introduced in C++14: +// template<InputIterator Iter1, InputIterator Iter2> +// constexpr bool // constexpr after c++17 +// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> @@ -20,6 +25,25 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {1, 3}; + int ic[] = {1, 3, 5, 7}; + typedef input_iterator<int*> II; + typedef bidirectional_iterator<int*> BI; + + return !std::equal(std::begin(ia), std::end(ia), std::begin(ic)) + && !std::equal(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic)) + && std::equal(std::begin(ib), std::end(ib), std::begin(ic)) + && !std::equal(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic)) + + && std::equal(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic))) + && !std::equal(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic))) + ; + } +#endif + int main() { @@ -61,4 +85,8 @@ int main() random_access_iterator<const int*>(ia+s-1))); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp index d57e365a9192b..c6bb06baf80a6 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.equal/equal_pred.pass.cpp @@ -12,8 +12,16 @@ // template<InputIterator Iter1, InputIterator Iter2, // Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> // requires CopyConstructible<Pred> -// bool +// constexpr bool // constexpr after c++17 // equal(Iter1 first1, Iter1 last1, Iter2 first2, Pred pred); +// +// Introduced in C++14: +// template<InputIterator Iter1, InputIterator Iter2, +// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> +// requires CopyConstructible<Pred> +// constexpr bool // constexpr after c++17 +// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); + #include <algorithm> #include <functional> @@ -22,6 +30,28 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {1, 3}; + int ic[] = {1, 3, 5, 7}; + typedef input_iterator<int*> II; + typedef bidirectional_iterator<int*> BI; + + return !std::equal(std::begin(ia), std::end(ia), std::begin(ic) , eq) + && !std::equal(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), eq) + && std::equal(std::begin(ib), std::end(ib), std::begin(ic) , eq) + && !std::equal(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), eq) + + && std::equal(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)) , eq) + && !std::equal(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)), eq) + ; + } +#endif + + int comparison_count = 0; template <typename T> bool counting_equals ( const T &a, const T &b ) { @@ -81,4 +111,8 @@ int main() random_access_iterator<const int*>(ib+s), std::equal_to<int>())); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp index e95162b4ad733..afcf27b5555bf 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end.pass.cpp @@ -11,14 +11,34 @@ // template<ForwardIterator Iter1, ForwardIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2}; + int ib[] = {4, 5, 6}; + int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0}; + typedef forward_iterator<int*> FI; + typedef bidirectional_iterator<int*> BI; + typedef random_access_iterator<int*> RI; + + return (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia))) == FI(ic+15)) + && (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib))) == FI(std::end(ic))) + && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia))) == BI(ic+15)) + && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib))) == BI(std::end(ic))) + && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia))) == RI(ic+15)) + && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib))) == RI(std::end(ic))) + ; + } +#endif + template <class Iter1, class Iter2> void test() @@ -54,4 +74,8 @@ int main() test<random_access_iterator<const int*>, forward_iterator<const int*> >(); test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp index 411858d5b76d4..76ac991653eb3 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find.end/find_end_pred.pass.cpp @@ -12,22 +12,42 @@ // template<ForwardIterator Iter1, ForwardIterator Iter2, // Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> // requires CopyConstructible<Pred> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // find_end(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct count_equal { static unsigned count; template <class T> - bool operator()(const T& x, const T& y) + TEST_CONSTEXPR_CXX14 bool operator()(const T& x, const T& y) {++count; return x == y;} }; +#if TEST_STD_VER > 17 +constexpr bool test_constexpr() { + int ia[] = {0, 1, 2}; + int ib[] = {4, 5, 6}; + int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0}; + typedef forward_iterator<int*> FI; + typedef bidirectional_iterator<int*> BI; + typedef random_access_iterator<int*> RI; + std::equal_to<int> eq{}; + return (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia)), eq) == FI(ic+15)) + && (std::find_end(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib)), eq) == FI(std::end(ic))) + && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia)), eq) == BI(ic+15)) + && (std::find_end(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib)), eq) == BI(std::end(ic))) + && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia)), eq) == RI(ic+15)) + && (std::find_end(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib)), eq) == RI(std::end(ic))) + ; + } +#endif + unsigned count_equal::count = 0; template <class Iter1, class Iter2> @@ -83,4 +103,8 @@ int main() test<random_access_iterator<const int*>, forward_iterator<const int*> >(); test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp index 966207671fc2c..2212285ae47e1 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of.pass.cpp @@ -11,14 +11,34 @@ // template<InputIterator Iter1, ForwardIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 2, 3}; + int ib[] = {7, 8, 9}; + int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3}; + typedef forward_iterator<int*> FI; + typedef bidirectional_iterator<int*> BI; + typedef random_access_iterator<int*> RI; + + return (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia))) == FI(ic+1)) + && (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib))) == FI(std::end(ic))) + && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia))) == BI(ic+1)) + && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib))) == BI(std::end(ic))) + && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia))) == RI(ic+1)) + && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib))) == RI(std::end(ic))) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 3, 0, 1, 2, 3}; @@ -46,4 +66,8 @@ int main() forward_iterator<const int*>(ic), forward_iterator<const int*>(ic+1)) == input_iterator<const int*>(ia)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp index d1d954ca0caee..f6f1725d6fa77 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp @@ -12,15 +12,35 @@ // template<InputIterator Iter1, ForwardIterator Iter2, // Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> // requires CopyConstructible<Pred> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +constexpr bool test_constexpr() { + int ia[] = {1, 2, 3}; + int ib[] = {7, 8, 9}; + int ic[] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3}; + typedef forward_iterator<int*> FI; + typedef bidirectional_iterator<int*> BI; + typedef random_access_iterator<int*> RI; + std::equal_to<int> eq{}; + return (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ia)), FI(std::end(ia)), eq) == FI(ic+1)) + && (std::find_first_of(FI(std::begin(ic)), FI(std::end(ic)), FI(std::begin(ib)), FI(std::end(ib)), eq) == FI(std::end(ic))) + && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ia)), BI(std::end(ia)), eq) == BI(ic+1)) + && (std::find_first_of(BI(std::begin(ic)), BI(std::end(ic)), BI(std::begin(ib)), BI(std::end(ib)), eq) == BI(std::end(ic))) + && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ia)), RI(std::end(ia)), eq) == RI(ic+1)) + && (std::find_first_of(RI(std::begin(ic)), RI(std::end(ic)), RI(std::begin(ib)), RI(std::end(ib)), eq) == RI(std::end(ic))) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 3, 0, 1, 2, 3}; @@ -52,4 +72,8 @@ int main() forward_iterator<const int*>(ic+1), std::equal_to<int>()) == input_iterator<const int*>(ia)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp index 09f0f41215c27..faff926d3d67d 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp @@ -11,14 +11,25 @@ // template<InputIterator Iter, class T> // requires HasEqualTo<Iter::value_type, T> -// Iter +// constexpr Iter // constexpr after C++17 // find(Iter first, Iter last, const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int ib[] = {1, 2, 3, 4, 5, 6}; + return (std::find(std::begin(ia), std::end(ia), 5) == ia+2) + && (std::find(std::begin(ib), std::end(ib), 9) == ib+6) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 3, 4, 5}; @@ -28,4 +39,8 @@ int main() assert(*r == 3); r = std::find(input_iterator<const int*>(ia), input_iterator<const int*>(ia+s), 10); assert(r == input_iterator<const int*>(ia+s)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp index fa1faf17e0f40..0fe084c01b5f1 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp @@ -11,21 +11,33 @@ // template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred> // requires CopyConstructible<Pred> -// Iter +// constexpr Iter // constexpr after C++17 // find_if(Iter first, Iter last, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct eq { - eq (int val) : v(val) {} - bool operator () (int v2) const { return v == v2; } + TEST_CONSTEXPR eq (int val) : v(val) {} + TEST_CONSTEXPR bool operator () (int v2) const { return v == v2; } int v; }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int ib[] = {1, 2, 3, 7, 5, 6}; + eq c(4); + return (std::find_if(std::begin(ia), std::end(ia), c) == ia+4) + && (std::find_if(std::begin(ib), std::end(ib), c) == ib+6) + ; + } +#endif + int main() { int ia[] = {0, 1, 2, 3, 4, 5}; @@ -38,4 +50,8 @@ int main() input_iterator<const int*>(ia+s), eq(10)); assert(r == input_iterator<const int*>(ia+s)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp index 1f3c34b2144ff..971a94dce2e47 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp @@ -11,21 +11,32 @@ // template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred> // requires CopyConstructible<Pred> -// Iter +// constexpr Iter // constexpr after C++17 // find_if_not(Iter first, Iter last, Pred pred); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct ne { - ne (int val) : v(val) {} - bool operator () (int v2) const { return v != v2; } + TEST_CONSTEXPR ne (int val) : v(val) {} + TEST_CONSTEXPR bool operator () (int v2) const { return v != v2; } int v; }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 5, 2, 4, 6}; + int ib[] = {1, 2, 3, 7, 5, 6}; + ne c(4); + return (std::find_if_not(std::begin(ia), std::end(ia), c) == ia+4) + && (std::find_if_not(std::begin(ib), std::end(ib), c) == ib+6) + ; + } +#endif int main() { @@ -39,4 +50,8 @@ int main() input_iterator<const int*>(ia+s), ne(10)); assert(r == input_iterator<const int*>(ia+s)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp index 9b391f01cea56..6c6824fafa0ae 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp @@ -11,14 +11,29 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // template<class InputIterator, class Size, class Function> -// InputIterator for_each_n(InputIterator first, Size n, Function f); +// constexpr InputIterator // constexpr after C++17 +// for_each_n(InputIterator first, Size n, Function f); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int expected[] = {3, 5, 8, 9}; + const size_t N = 4; + + auto it = std::for_each_n(std::begin(ia), N, [](int &a) { a += 2; }); + return it == (std::begin(ia) + N) + && std::equal(std::begin(ia), std::end(ia), std::begin(expected)) + ; + } +#endif + struct for_each_test { for_each_test(int c) : count(c) {} @@ -58,4 +73,8 @@ int main() for (unsigned i = 0; i < 1; ++i) assert(ia[i] == static_cast<int>(i+2)); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp index d6fdd18968d12..a334c6093330c 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.foreach/test.pass.cpp @@ -11,14 +11,26 @@ // template<InputIterator Iter, Callable<auto, Iter::reference> Function> // requires CopyConstructible<Function> -// Function +// constexpr Function // constexpr after C++17 // for_each(Iter first, Iter last, Function f); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int expected[] = {3, 5, 8, 9}; + + std::for_each(std::begin(ia), std::end(ia), [](int &a) { a += 2; }); + return std::equal(std::begin(ia), std::end(ia), std::begin(expected)) + ; + } +#endif + struct for_each_test { for_each_test(int c) : count(c) {} @@ -36,4 +48,8 @@ int main() assert(f.count == s); for (unsigned i = 0; i < s; ++i) assert(ia[i] == static_cast<int>(i+1)); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp index e3f7c3cd87db6..52ad7befc6409 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation.pass.cpp @@ -10,7 +10,7 @@ // <algorithm> // template<class ForwardIterator1, class ForwardIterator2> -// bool +// constexpr bool // constexpr after C++17 // is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, // ForwardIterator2 first2); @@ -21,6 +21,21 @@ #include "test_macros.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 0}; + int ib[] = {1, 1, 0}; + int ic[] = {1, 0, 1}; + int id[] = {1}; + return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib)) + && !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib)) + && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic)) + && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic)) + && !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id)) + ; + } +#endif + int main() { { @@ -600,4 +615,8 @@ int main() forward_iterator<const int*>(ib + sa)) == false); #endif } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp index 6e9cdaabd308d..12bd938d2968e 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp @@ -10,7 +10,7 @@ // <algorithm> // template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> -// bool +// constexpr bool // constexpr after C++17 // is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, // ForwardIterator2 first2, BinaryPredicate pred); @@ -28,6 +28,21 @@ bool counting_equals ( const T &a, const T &b ) { return a == b; } +#if TEST_STD_VER > 17 +constexpr bool test_constexpr() { + int ia[] = {0, 0, 0}; + int ib[] = {1, 1, 0}; + int ic[] = {1, 0, 1}; + int id[] = {1}; + std::equal_to<int> c{}; + return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib) , c) + && !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), c) + && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic) , c) + && std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), c) + && !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id), c) + ; + } +#endif int main() { @@ -723,4 +738,32 @@ int main() std::equal_to<const int>()) == false); #endif } + { + struct S { + S(int i) : i_(i) {} + bool operator==(const S& other) = delete; + int i_; + }; + struct eq { + bool operator()(const S& a, const S&b) { return a.i_ == b.i_; } + }; + const S a[] = {S(0), S(1)}; + const S b[] = {S(1), S(0)}; + const unsigned sa = sizeof(a)/sizeof(a[0]); + assert(std::is_permutation(forward_iterator<const S*>(a), + forward_iterator<const S*>(a + sa), + forward_iterator<const S*>(b), + eq())); +#if TEST_STD_VER >= 14 + assert(std::is_permutation(forward_iterator<const S*>(a), + forward_iterator<const S*>(a + sa), + forward_iterator<const S*>(b), + forward_iterator<const S*>(b + sa), + eq())); +#endif + } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp index f4ea161891b27..356c2fbb8a7fb 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.none_of/none_of.pass.cpp @@ -16,16 +16,27 @@ #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" struct test1 { - bool operator()(const int& i) const + TEST_CONSTEXPR bool operator()(const int& i) const { return i % 2 == 0; } }; +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {1, 3, 5, 7}; + return !std::none_of(std::begin(ia), std::end(ia), test1()) + && std::none_of(std::begin(ib), std::end(ib), test1()) + ; + } +#endif + int main() { { @@ -52,4 +63,8 @@ int main() assert(std::none_of(input_iterator<const int*>(ia), input_iterator<const int*>(ia), test1()) == true); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp index e5c2dd29d11f1..d483800c20912 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.search/search.pass.cpp @@ -11,14 +11,52 @@ // template<ForwardIterator Iter1, ForwardIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // search(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); +// +// template<class ForwardIterator, class Searcher> +// ForwardIterator search(ForwardIterator first, ForwardIterator last, +// const Searcher& searcher); // C++17 #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +struct MySearcherC { + template <typename Iterator> + std::pair<Iterator, Iterator> + TEST_CONSTEXPR operator() (Iterator b, Iterator e) const + { + return std::make_pair(b, e); + } +}; + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3}; + int ib[] = {0, 1, 5, 3}; + int ic[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + return (std::search(std::begin(ic), std::end(ic), std::begin(ia), std::end(ia)) == ic+3) + && (std::search(std::begin(ic), std::end(ic), std::begin(ib), std::end(ib)) == std::end(ic)) + && (std::search(std::begin(ic), std::end(ic), MySearcherC()) == std::begin(ic)) + ; + } +#endif + +int searcher_called = 0; + +struct MySearcher { + template <typename Iterator> + std::pair<Iterator, Iterator> + operator() (Iterator b, Iterator e) const + { + ++searcher_called; + return std::make_pair(b, e); + } +}; + template <class Iter1, class Iter2> void test() @@ -69,4 +107,19 @@ int main() test<random_access_iterator<const int*>, forward_iterator<const int*> >(); test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 14 +{ + typedef int * RI; + static_assert((std::is_same<RI, decltype(std::search(RI(), RI(), MySearcher()))>::value), "" ); + + RI it(nullptr); + assert(it == std::search(it, it, MySearcher())); + assert(searcher_called == 1); +} +#endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp index 4874bcad833e6..528ec5696e8e7 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp @@ -10,16 +10,27 @@ // <algorithm> // template<class ForwardIterator, class Size, class T> -// ForwardIterator +// constexpr ForwardIterator // constexpr after C++17 // search_n(ForwardIterator first, ForwardIterator last, Size count, // const T& value); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "user_defined_integral.hpp" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 1, 1, 2, 2}; + return (std::search_n(std::begin(ia), std::end(ia), 1, 0) == ia) + && (std::search_n(std::begin(ia), std::end(ia), 2, 1) == ia+2) + && (std::search_n(std::begin(ia), std::end(ia), 1, 3) == std::end(ia)) + ; + } +#endif + template <class Iter> void test() @@ -74,4 +85,8 @@ int main() test<forward_iterator<const int*> >(); test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp index ff459b3489328..d5780c7e7ddc1 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp @@ -10,16 +10,29 @@ // <algorithm> // template<class ForwardIterator, class Size, class T, class BinaryPredicate> -// ForwardIterator +// constexpr ForwardIterator // constexpr after C++17 // search_n(ForwardIterator first, ForwardIterator last, Size count, // const T& value, BinaryPredicate pred); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "user_defined_integral.hpp" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 1, 1, 2, 2}; + return (std::search_n(std::begin(ia), std::end(ia), 1, 0, eq) == ia) + && (std::search_n(std::begin(ia), std::end(ia), 2, 1, eq) == ia+2) + && (std::search_n(std::begin(ia), std::end(ia), 1, 3, eq) == std::end(ia)) + ; + } +#endif + struct count_equal { static unsigned count; @@ -151,4 +164,8 @@ int main() test<forward_iterator<const int*> >(); test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp index 192da03d67b30..21a17116fc8da 100644 --- a/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp @@ -11,14 +11,28 @@ // template<ForwardIterator Iter1, ForwardIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// Iter1 +// constexpr Iter1 // constexpr after C++17 // search(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 2, 3}; + int ib[] = {0, 1, 5, 3}; + int ic[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + return (std::search(std::begin(ic), std::end(ic), std::begin(ia), std::end(ia), eq) == ic+3) + && (std::search(std::begin(ic), std::end(ic), std::begin(ib), std::end(ib), eq) == std::end(ic)) + ; + } +#endif + struct count_equal { static unsigned count; @@ -108,4 +122,8 @@ int main() test<random_access_iterator<const int*>, forward_iterator<const int*> >(); test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp index d4bc3fd70a819..4b5ddb191d4ed 100644 --- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch.pass.cpp @@ -11,8 +11,12 @@ // template<InputIterator Iter1, InputIterator Iter2> // requires HasEqualTo<Iter1::value_type, Iter2::value_type> -// pair<Iter1, Iter2> +// constexpr pair<Iter1, Iter2> // constexpr after c++17 // mismatch(Iter1 first1, Iter1 last1, Iter2 first2); +// +// template<InputIterator Iter1, InputIterator Iter2Pred> +// constexpr pair<Iter1, Iter2> // constexpr after c++17 +// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); // C++14 #include <algorithm> #include <cassert> @@ -20,6 +24,40 @@ #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {1, 3}; + int ic[] = {1, 3, 5, 7}; + typedef input_iterator<int*> II; + typedef bidirectional_iterator<int*> BI; + + auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic)); + if (p1.first != ia+2 || p1.second != ic+2) + return false; + + auto p2 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic)); + if (p2.first != ia+2 || p2.second != ic+2) + return false; + + auto p3 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic)); + if (p3.first != ib+2 || p3.second != ic+2) + return false; + + auto p4 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic)); + if (p4.first != ib+2 || p4.second != ic+2) + return false; + + auto p5 = std::mismatch(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic))); + if (p5.first != II(ib+2) || p5.second != II(ic+2)) + return false; + auto p6 = std::mismatch(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic))); + if (p6.first != BI(ib+2) || p6.second != BI(ic+2)) + return false; + + return true; + } +#endif int main() { @@ -48,4 +86,8 @@ int main() assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib+2)) == (std::pair<II, II>(II(ia+2), II(ib+2)))); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp index 2a363826261e4..ed9ba055aabc2 100644 --- a/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp +++ b/test/std/algorithms/alg.nonmodifying/mismatch/mismatch_pred.pass.cpp @@ -12,8 +12,12 @@ // template<InputIterator Iter1, InputIterator Iter2, // Predicate<auto, Iter1::value_type, Iter2::value_type> Pred> // requires CopyConstructible<Pred> -// pair<Iter1, Iter2> +// constexpr pair<Iter1, Iter2> // constexpr after c++17 // mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Pred pred); +// +// template<InputIterator Iter1, InputIterator Iter2, Predicate Pred> +// constexpr pair<Iter1, Iter2> // constexpr after c++17 +// mismatch(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred); // C++14 #include <algorithm> #include <functional> @@ -23,6 +27,44 @@ #include "test_iterators.h" #include "counting_predicates.hpp" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + int ib[] = {1, 3}; + int ic[] = {1, 3, 5, 7}; + typedef input_iterator<int*> II; + typedef bidirectional_iterator<int*> BI; + + auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), eq); + if (p1.first != ia+2 || p1.second != ic+2) + return false; + + auto p2 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), eq); + if (p2.first != ia+2 || p2.second != ic+2) + return false; + + auto p3 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), eq); + if (p3.first != ib+2 || p3.second != ic+2) + return false; + + auto p4 = std::mismatch(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), eq); + if (p4.first != ib+2 || p4.second != ic+2) + return false; + + auto p5 = std::mismatch(II(std::begin(ib)), II(std::end(ib)), II(std::begin(ic)), eq); + if (p5.first != II(ib+2) || p5.second != II(ic+2)) + return false; + auto p6 = std::mismatch(BI(std::begin(ib)), BI(std::end(ib)), BI(std::begin(ic)), BI(std::end(ic)), eq); + if (p6.first != BI(ib+2) || p6.second != BI(ic+2)) + return false; + + return true; + } +#endif + + #if TEST_STD_VER > 11 #define HAS_FOUR_ITERATOR_VERSION #endif @@ -69,4 +111,8 @@ int main() assert(std::mismatch(ia, ia + sa, ib, ib + 2, EQ()) == (std::pair<int*,int*>(ia+2,ib+2))); #endif + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp index d4d31cb3088f0..04c4c258be888 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp @@ -10,9 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T> -// requires HasLess<T, Iter::value_type> -// && HasLess<Iter::value_type, T> -// bool +// constexpr bool // constexpr after C++17 // binary_search(Iter first, Iter last, const T& value); #include <algorithm> @@ -20,8 +18,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 3, 6, 7}; + + return std::binary_search(std::begin(ia), std::end(ia), 1) + && std::binary_search(std::begin(ia), std::end(ia), 3) + && !std::binary_search(std::begin(ia), std::end(ia), 9) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value, bool x) @@ -61,4 +73,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp index e0b148499ca82..b27861022c435 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp @@ -10,9 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T, CopyConstructible Compare> -// requires Predicate<Compare, T, Iter::value_type> -// && Predicate<Compare, Iter::value_type, T> -// bool +// constexpr bool // constexpr after C++17 // binary_search(Iter first, Iter last, const T& value, Compare comp); #include <algorithm> @@ -21,8 +19,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 3, 6, 7}; + + return std::binary_search(std::begin(ia), std::end(ia), 1, lt) + && std::binary_search(std::begin(ia), std::end(ia), 3, lt) + && !std::binary_search(std::begin(ia), std::end(ia), 9, lt) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value, bool x) @@ -62,4 +74,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp index bc968f5b2aabc..02aea475c599b 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp @@ -12,7 +12,7 @@ // template<ForwardIterator Iter, class T> // requires HasLess<T, Iter::value_type> // && HasLess<Iter::value_type, T> -// pair<Iter, Iter> +// constexpr pair<Iter, Iter> // constexpr after c++17 // equal_range(Iter first, Iter last, const T& value); #include <algorithm> @@ -20,8 +20,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 3, 6, 7}; + + return (std::equal_range(std::begin(ia), std::end(ia), 1, lt) == std::pair<int *, int *>(ia+0, ia+1)) + && (std::equal_range(std::begin(ia), std::end(ia), 3, lt) == std::pair<int *, int *>(ia+1, ia+3)) + && (std::equal_range(std::begin(ia), std::end(ia), 9, lt) == std::pair<int *, int *>(std::end(ia), std::end(ia))) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -67,4 +81,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp index de0bbf25613e7..960e2c1fa568f 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp @@ -10,9 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T, CopyConstructible Compare> -// requires Predicate<Compare, T, Iter::value_type> -// && Predicate<Compare, Iter::value_type, T> -// pair<Iter, Iter> +// constexpr pair<Iter, Iter> // constexpr after c++17 // equal_range(Iter first, Iter last, const T& value, Compare comp); #include <algorithm> @@ -21,8 +19,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 3, 6, 7}; + + return (std::equal_range(std::begin(ia), std::end(ia), 1, lt) == std::pair<int *, int *>(ia+0, ia+1)) + && (std::equal_range(std::begin(ia), std::end(ia), 3, lt) == std::pair<int *, int *>(ia+1, ia+3)) + && (std::equal_range(std::begin(ia), std::end(ia), 9, lt) == std::pair<int *, int *>(std::end(ia), std::end(ia))) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -68,4 +80,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp index 1fff1d7f5b630..b6848ec9ef677 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp @@ -10,8 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T> -// requires HasLess<Iter::value_type, T> -// Iter +// constexpr Iter // constexpr after c++17 // lower_bound(Iter first, Iter last, const T& value); #include <algorithm> @@ -19,8 +18,23 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool eq(int a, int b) { return a == b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + + return (std::lower_bound(std::begin(ia), std::end(ia), 2) == ia+1) + && (std::lower_bound(std::begin(ia), std::end(ia), 3) == ia+1) + && (std::lower_bound(std::begin(ia), std::end(ia), 9) == std::end(ia)) + ; + } +#endif + + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -62,4 +76,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp index 4ec5f6c000d68..b3ef70eb0222f 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp @@ -9,10 +9,9 @@ // <algorithm> -// template<ForwardIterator Iter, class T> -// requires HasLess<Iter::value_type, T> -// Iter -// lower_bound(Iter first, Iter last, const T& value); +// template<ForwardIterator Iter, class T, class Compare> +// constexpr Iter // constexpr after c++17 +// lower_bound(Iter first, Iter last, const T& value, Compare comp); #include <algorithm> #include <functional> @@ -20,8 +19,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + + return (std::lower_bound(std::begin(ia), std::end(ia), 2, lt) == ia+1) + && (std::lower_bound(std::begin(ia), std::end(ia), 3, lt) == ia+1) + && (std::lower_bound(std::begin(ia), std::end(ia), 9, lt) == std::end(ia)) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -63,4 +76,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp index 710edb61c9b6e..43bb4c3cceb84 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp @@ -10,8 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T> -// requires HasLess<T, Iter::value_type> -// Iter +// constexpr Iter // constexpr after c++17 // upper_bound(Iter first, Iter last, const T& value); #include <algorithm> @@ -19,8 +18,20 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + + return (std::upper_bound(std::begin(ia), std::end(ia), 2) == ia+1) + && (std::upper_bound(std::begin(ia), std::end(ia), 3) == ia+2) + && (std::upper_bound(std::begin(ia), std::end(ia), 9) == std::end(ia)) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -62,4 +73,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp index 3268075b1b0bb..fa8e934b9d6f9 100644 --- a/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp @@ -10,8 +10,7 @@ // <algorithm> // template<ForwardIterator Iter, class T, Predicate<auto, T, Iter::value_type> Compare> -// requires CopyConstructible<Compare> -// Iter +// constexpr Iter // constexpr after c++17 // upper_bound(Iter first, Iter last, const T& value, Compare comp); #include <algorithm> @@ -20,8 +19,22 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool lt(int a, int b) { return a < b; } + +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 3, 6, 7}; + + return (std::upper_bound(std::begin(ia), std::end(ia), 2, lt) == ia+1) + && (std::upper_bound(std::begin(ia), std::end(ia), 3, lt) == ia+2) + && (std::upper_bound(std::begin(ia), std::end(ia), 9, lt) == std::end(ia)) + ; + } +#endif + template <class Iter, class T> void test(Iter first, Iter last, const T& value) @@ -63,4 +76,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp index f16b2c3c61aee..c3d6fd919cb5a 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp @@ -11,12 +11,23 @@ // template<RandomAccessIterator Iter> // requires LessThanComparable<Iter::value_type> -// bool +// constexpr bool // constexpr after C++17 // is_heap(Iter first, Iter last); #include <algorithm> #include <cassert> +#include "test_macros.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 1, 1, 1, 0, 1, 1}; + int ib[] = {0, 0, 1, 0, 0, 0, 0}; + return std::is_heap(std::begin(ia), std::end(ia)) + && !std::is_heap(std::begin(ib), std::end(ib)); + } +#endif + void test() { int i1[] = {0, 0}; @@ -518,4 +529,8 @@ void test() int main() { test(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp index af55cc499edac..3f290bb294495 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_comp.pass.cpp @@ -11,13 +11,24 @@ // template<RandomAccessIterator Iter> // requires LessThanComparable<Iter::value_type> -// bool +// constexpr bool // constexpr after C++17 // is_heap(Iter first, Iter last); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 1, 1, 1}; + int ib[] = {1, 0, 4, 1, 0}; + return std::is_heap(std::begin(ia), std::end(ia), std::greater<int>()) + && !std::is_heap(std::begin(ib), std::end(ib), std::greater<int>()); + } +#endif + void test() { int i1[] = {0, 0}; @@ -519,4 +530,8 @@ void test() int main() { test(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp index 082c04451825f..96369eb6053c4 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until.pass.cpp @@ -11,12 +11,23 @@ // template<RandomAccessIterator Iter> // requires LessThanComparable<Iter::value_type> -// Iter +// constexpr bool // constexpr after C++17 // is_heap_until(Iter first, Iter last); #include <algorithm> #include <cassert> +#include "test_macros.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 0, 0, 1, 0}; + int ib[] = {0, 0, 0, 1, 1, 1}; + return (std::is_heap_until(std::begin(ia), std::end(ia)) == ia+4) + && (std::is_heap_until(std::begin(ib), std::end(ib)) == ib+3); + } +#endif + void test() { int i1[] = {0, 0}; @@ -518,4 +529,8 @@ void test() int main() { test(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp index 657c177fee562..edd27b0d79020 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap_until_comp.pass.cpp @@ -11,13 +11,24 @@ // template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare> // requires CopyConstructible<Compare> -// Iter +// constexpr bool // constexpr after C++17 // is_heap_until(Iter first, Iter last, Compare comp); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 0, 0, 0}; + int ib[] = {0, 1, 1, 0}; + return (std::is_heap_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+1) + && (std::is_heap_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3); + } +#endif + void test() { int i1[] = {0, 0}; @@ -519,4 +530,8 @@ void test() int main() { test(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp index 71dfeefe7e412..adec6aec80159 100644 --- a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp @@ -12,14 +12,26 @@ // template<InputIterator Iter1, InputIterator Iter2> // requires HasLess<Iter1::value_type, Iter2::value_type> // && HasLess<Iter2::value_type, Iter1::value_type> -// bool +// constexpr bool // constexpr after C++17 // lexicographical_compare(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 2, 3}; + int ib[] = {1, 3, 5, 2, 4, 6}; + + return std::lexicographical_compare(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib)) + && !std::lexicographical_compare(std::begin(ib), std::end(ib), std::begin(ia), std::end(ia)) + ; + } +#endif + template <class Iter1, class Iter2> void test() @@ -66,4 +78,8 @@ int main() test<const int*, bidirectional_iterator<const int*> >(); test<const int*, random_access_iterator<const int*> >(); test<const int*, const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp index c1851560ef23d..b7fbdbfa299fb 100644 --- a/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare_comp.pass.cpp @@ -12,7 +12,7 @@ // template<InputIterator Iter1, InputIterator Iter2, CopyConstructible Compare> // requires Predicate<Compare, Iter1::value_type, Iter2::value_type> // && Predicate<Compare, Iter2::value_type, Iter1::value_type> -// bool +// constexpr bool // constexpr after C++17 // lexicographical_compare(Iter1 first1, Iter1 last1, // Iter2 first2, Iter2 last2, Compare comp); @@ -20,8 +20,21 @@ #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 2, 3}; + int ib[] = {1, 3, 5, 2, 4, 6}; + + std::greater<int> pred{}; + return !std::lexicographical_compare(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), pred) + && std::lexicographical_compare(std::begin(ib), std::end(ib), std::begin(ia), std::end(ia), pred) + ; + } +#endif + template <class Iter1, class Iter2> void test() @@ -70,4 +83,8 @@ int main() test<const int*, bidirectional_iterator<const int*> >(); test<const int*, random_access_iterator<const int*> >(); test<const int*, const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp index 777461023e7d3..a42936124fdfe 100644 --- a/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp @@ -15,15 +15,32 @@ // requires OutputIterator<OutIter, InIter1::reference> // && OutputIterator<OutIter, InIter2::reference> // && HasLess<InIter2::value_type, InIter1::value_type> -// OutIter +// constexpr OutIter // constexpr after C++17 // merge(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2, OutIter result); #include <algorithm> #include <random> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" + +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {0, 1, 2, 3, 4}; +// int ib[] = {2, 4, 6, 8}; +// int ic[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +// const int expected[] = {0, 1, 2, 2, 3, 4, 4, 6, 8}; +// +// auto it = std::merge(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), std::begin(ic)); +// return std::distance(std::begin(ic), it) == (std::size(ia) + std::size(ib)) +// && *it == 0 +// && std::equal(std::begin(ic), it, std::begin(expected), std::end(expected)) +// ; +// } +// #endif + std::mt19937 randomness; template <class InIter1, class InIter2, class OutIter> @@ -224,4 +241,9 @@ int main() test<const int*, const int*, bidirectional_iterator<int*> >(); test<const int*, const int*, random_access_iterator<int*> >(); test<const int*, const int*, int*>(); + +#if TEST_STD_VER > 17 +// Not yet - waiting on std::copy +// static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp index 3daaeebbeae94..1506a8cd51140 100644 --- a/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp @@ -16,7 +16,7 @@ // requires OutputIterator<OutIter, InIter1::reference> // && OutputIterator<OutIter, InIter2::reference> // && CopyConstructible<Compare> -// OutIter +// constexpr OutIter // constexpr after C++17 // merge(InIter1 first1, InIter1 last1, // InIter2 first2, InIter2 last2, OutIter result, Compare comp); @@ -25,9 +25,27 @@ #include <random> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" #include "counting_predicates.hpp" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {0, 1, 2, 3, 4}; +// int ib[] = {2, 4, 6, 8}; +// int ic[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +// const int expected[] = {0, 1, 2, 2, 3, 4, 4, 6, 8}; +// +// auto it = std::merge(std::begin(ia), std::end(ia), +// std::begin(ib), std::end(ib), +// std::begin(ic), [](int a, int b) {return a == b; }); +// return std::distance(std::begin(ic), it) == (std::size(ia) + std::size(ib)) +// && *it == 0 +// && std::equal(std::begin(ic), it, std::begin(expected), std::end(expected)) +// ; +// } +// #endif + std::mt19937 randomness; template <class InIter1, class InIter2, class OutIter> @@ -234,4 +252,9 @@ int main() test<const int*, const int*, bidirectional_iterator<int*> >(); test<const int*, const int*, random_access_iterator<int*> >(); test<const int*, const int*, int*>(); + +#if TEST_STD_VER > 17 +// Not yet - waiting on std::copy +// static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp index 70abd18097531..ca1b422517c5f 100644 --- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes.pass.cpp @@ -12,14 +12,27 @@ // template<InputIterator Iter1, InputIterator Iter2> // requires HasLess<Iter1::value_type, Iter2::value_type> // && HasLess<Iter2::value_type, Iter1::value_type> -// bool +// constexpr bool // constexpr after C++17 // includes(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; + int ib[] = {2, 4}; + int ic[] = {3, 3, 3, 3}; + + return std::includes(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib)) + && !std::includes(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic)) + ; + } +#endif + template <class Iter1, class Iter2> void test() @@ -81,4 +94,8 @@ int main() test<const int*, bidirectional_iterator<const int*> >(); test<const int*, random_access_iterator<const int*> >(); test<const int*, const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp index 299dc893560f3..06192f93bcc8a 100644 --- a/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.set.operations/includes/includes_comp.pass.cpp @@ -12,15 +12,30 @@ // template<InputIterator Iter1, InputIterator Iter2, typename Compare> // requires Predicate<Compare, Iter1::value_type, Iter2::value_type> // && Predicate<Compare, Iter2::value_type, Iter1::value_type> -// bool +// constexpr bool // constexpr after C++17 // includes(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Compare comp); #include <algorithm> #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; + int ib[] = {2, 4}; + int ic[] = {3, 3, 3, 3}; + + auto comp = [](int a, int b) {return a < b; }; + return std::includes(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), comp) + && !std::includes(std::begin(ia), std::end(ia), std::begin(ic), std::end(ic), comp) + ; + } +#endif + + template <class Iter1, class Iter2> void test() @@ -82,4 +97,8 @@ int main() test<const int*, bidirectional_iterator<const int*> >(); test<const int*, random_access_iterator<const int*> >(); test<const int*, const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp index f371890d8e7e7..8d18027eef7ef 100644 --- a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection.pass.cpp @@ -14,15 +14,34 @@ // && OutputIterator<OutIter, InIter2::reference> // && HasLess<InIter2::value_type, InIter1::value_type> // && HasLess<InIter1::value_type, InIter2::value_type> -// OutIter +// constpexr OutIter // constexpr after C++17 // set_intersection(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2, // OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + const int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; + const int ib[] = {2, 4, 4, 6}; + int results[std::size(ia)] = {0}; + + auto it = std::set_intersection(std::begin(ia), std::end(ia), + std::begin(ib), std::end(ib), std::begin(results)); + + return std::includes(std::begin(ia), std::end(ia), std::begin(results), it) + && std::includes(std::begin(ib), std::end(ib), std::begin(results), it) + && std::is_sorted(std::begin(results), it) + && std::all_of(it, std::end(results), [](int a) {return a == 0; }) + ; + } +#endif + + template <class Iter1, class Iter2, class OutIter> void test() @@ -195,4 +214,8 @@ int main() test<const int*, const int*, bidirectional_iterator<int*> >(); test<const int*, const int*, random_access_iterator<int*> >(); test<const int*, const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp index 035522b546243..6b0cfe16833c0 100644 --- a/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp @@ -15,7 +15,7 @@ // && OutputIterator<OutIter, InIter2::reference> // && Predicate<Compare, InIter1::value_type, InIter2::value_type> // && Predicate<Compare, InIter2::value_type, InIter1::value_type> -// OutIter +// constpexr OutIter // constexpr after C++17 // set_intersection(InIter1 first1, InIter1 last1, InIter2 first2, InIter2 last2, // OutIter result, Compare comp); @@ -23,8 +23,28 @@ #include <functional> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + const int ia[] = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; + const int ib[] = {2, 4, 4, 6}; + int results[std::size(ia)] = {0}; + + auto comp = [](int a, int b) {return a < b; }; + auto it = std::set_intersection(std::begin(ia), std::end(ia), + std::begin(ib), std::end(ib), std::begin(results), comp); + + return std::includes(std::begin(ia), std::end(ia), std::begin(results), it) + && std::includes(std::begin(ib), std::end(ib), std::begin(results), it) + && std::is_sorted(std::begin(results), it, comp) + && std::all_of(it, std::end(results), [](int a) {return a == 0; }) + ; + } +#endif + + template <class Iter1, class Iter2, class OutIter> void test() @@ -197,4 +217,8 @@ int main() test<const int*, const int*, bidirectional_iterator<int*> >(); test<const int*, const int*, random_access_iterator<int*> >(); test<const int*, const int*, int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp index dd6b5c1766ad9..3652c089cfbeb 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted.pass.cpp @@ -19,6 +19,15 @@ #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 0, 1, 1}; + int ib[] = {1, 1, 0, 0}; + return std::is_sorted(std::begin(ia), std::end(ia)) + && !std::is_sorted(std::begin(ib), std::end(ib)); + } +#endif + template <class Iter> void test() @@ -180,4 +189,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp index d5a34e2f2cb31..228aacac622e6 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_comp.pass.cpp @@ -20,6 +20,15 @@ #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 1, 0, 0}; + int ib[] = {0, 0, 1, 1}; + return std::is_sorted(std::begin(ia), std::end(ia), std::greater<int>()) + && !std::is_sorted(std::begin(ib), std::end(ib), std::greater<int>()); + } +#endif + template <class Iter> void test() @@ -181,4 +190,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp index bef01027472c1..b2ed76f519a46 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until.pass.cpp @@ -19,6 +19,15 @@ #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {0, 1, 0}; + int ib[] = {0, 1, 1}; + return (std::is_sorted_until(std::begin(ia), std::end(ia)) == ia+2) + && (std::is_sorted_until(std::begin(ib), std::end(ib)) == ib+3); + } +#endif + template <class Iter> void test() @@ -180,4 +189,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp index 68ed29c6f4b8b..76724bc397e12 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.sort/is.sorted/is_sorted_until_comp.pass.cpp @@ -20,6 +20,15 @@ #include "test_iterators.h" +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int ia[] = {1, 0, 1}; + int ib[] = {1, 1, 0}; + return (std::is_sorted_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+2) + && (std::is_sorted_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3); + } +#endif + template <class Iter> void test() @@ -181,4 +190,8 @@ int main() test<bidirectional_iterator<const int*> >(); test<random_access_iterator<const int*> >(); test<const int*>(); + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp b/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp index 7a4090b9c2524..7a8d4c1f4a69d 100644 --- a/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp +++ b/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp @@ -89,6 +89,7 @@ int main() CHECK_ALWAYS_LOCK_FREE(float); CHECK_ALWAYS_LOCK_FREE(double); CHECK_ALWAYS_LOCK_FREE(long double); +#if __has_attribute(vector_size) && defined(_LIBCPP_VERSION) CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(1 * sizeof(int))))); CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(2 * sizeof(int))))); CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(4 * sizeof(int))))); @@ -104,6 +105,7 @@ int main() CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(4 * sizeof(double))))); CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(16 * sizeof(double))))); CHECK_ALWAYS_LOCK_FREE(double __attribute__((vector_size(32 * sizeof(double))))); +#endif // __has_attribute(vector_size) && defined(_LIBCPP_VERSION) CHECK_ALWAYS_LOCK_FREE(struct Empty {}); CHECK_ALWAYS_LOCK_FREE(struct OneInt { int i; }); CHECK_ALWAYS_LOCK_FREE(struct IntArr2 { int i[2]; }); diff --git a/test/std/containers/associative/map/map.cons/move.pass.cpp b/test/std/containers/associative/map/map.cons/move.pass.cpp index dd68f9c39ec84..69f762ac5d6f3 100644 --- a/test/std/containers/associative/map/map.cons/move.pass.cpp +++ b/test/std/containers/associative/map/map.cons/move.pass.cpp @@ -35,7 +35,7 @@ int main() assert(m.size() == 0); assert(distance(m.begin(), m.end()) == 0); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); @@ -65,7 +65,7 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); diff --git a/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp b/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp new file mode 100644 index 0000000000000..899757e54c447 --- /dev/null +++ b/test/std/containers/associative/map/map.ops/count_transparent.pass.cpp @@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <map> + +// class map + +// template<typename K> +// size_type count(const K& x) const; // C++14 + +#include <cassert> +#include <map> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::map<std::pair<int, int>, int, Comp> s{ + {{2, 1}, 1}, {{1, 2}, 2}, {{1, 3}, 3}, {{1, 4}, 4}, {{2, 2}, 5}}; + + auto cnt = s.count(1); + assert(cnt == 3); +} diff --git a/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp new file mode 100644 index 0000000000000..cce90c69572dd --- /dev/null +++ b/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <map> + +// class map + +// template<typename K> +// pair<iterator,iterator> equal_range(const K& x); // C++14 +// template<typename K> +// pair<const_iterator,const_iterator> equal_range(const K& x) const; +// // C++14 + +#include <cassert> +#include <map> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::map<std::pair<int, int>, int, Comp> s{ + {{2, 1}, 1}, {{1, 2}, 2}, {{1, 3}, 3}, {{1, 4}, 4}, {{2, 2}, 5}}; + + auto er = s.equal_range(1); + long nels = 0; + + for (auto it = er.first; it != er.second; it++) { + assert(it->first.first == 1); + nels++; + } + + assert(nels == 3); +} diff --git a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp index 769c709cf203e..1dc6404b07c96 100644 --- a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp @@ -35,7 +35,7 @@ int main() assert(m.size() == 0); assert(distance(m.begin(), m.end()) == 0); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); @@ -71,7 +71,7 @@ int main() assert(*next(m.begin(), 7) == V(3, 1.5)); assert(*next(m.begin(), 8) == V(3, 2)); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); diff --git a/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp new file mode 100644 index 0000000000000..a1dbf806a3074 --- /dev/null +++ b/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp @@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <map> + +// class multimap + +// template<typename K> +// size_type count(const K& x) const; // C++14 + +#include <cassert> +#include <map> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::multimap<std::pair<int, int>, int, Comp> s{ + {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}}; + + auto cnt = s.count(1); + assert(cnt == 3); +} diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp new file mode 100644 index 0000000000000..2b199d23c29b8 --- /dev/null +++ b/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <map> + +// class multimap + +// template<typename K> +// pair<iterator,iterator> equal_range(const K& x); // C++14 +// template<typename K> +// pair<const_iterator,const_iterator> equal_range(const K& x) const; +// // C++14 + +#include <cassert> +#include <map> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::multimap<std::pair<int, int>, int, Comp> s{ + {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}}; + + auto er = s.equal_range(1); + long nels = 0; + + for (auto it = er.first; it != er.second; it++) { + assert(it->first.first == 1); + nels++; + } + + assert(nels == 3); +} diff --git a/test/std/containers/associative/multiset/count_transparent.pass.cpp b/test/std/containers/associative/multiset/count_transparent.pass.cpp new file mode 100644 index 0000000000000..9ef223345862e --- /dev/null +++ b/test/std/containers/associative/multiset/count_transparent.pass.cpp @@ -0,0 +1,51 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <set> + +// class multiset + +// template<typename K> +// iterator lower_bound(const K& x); // C++14 +// template<typename K> +// const_iterator lower_bound(const K& x) const; // C++14 + +#include <cassert> +#include <set> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::multiset<std::pair<int, int>, Comp> s{{2, 1}, {1, 1}, {1, 1}, {1, 1}, {2, 2}}; + + auto cnt = s.count(1); + assert(cnt == 3); +} diff --git a/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp b/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp new file mode 100644 index 0000000000000..ffd87acfd321c --- /dev/null +++ b/test/std/containers/associative/multiset/equal_range_transparent.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <set> + +// class multiset + +// template<typename K> +// pair<iterator,iterator> equal_range(const K& x); // +// C++14 +// template<typename K> +// pair<const_iterator,const_iterator> equal_range(const K& x) const; // +// C++14 + +#include <cassert> +#include <set> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::multiset<std::pair<int, int>, Comp> s{{2, 1}, {1, 1}, {1, 1}, {1, 1}, {2, 2}}; + + auto er = s.equal_range(1); + long nels = 0; + + for (auto it = er.first; it != er.second; it++) { + assert(it->first == 1); + nels++; + } + + assert(nels == 3); +} diff --git a/test/std/containers/associative/multiset/insert_cv.pass.cpp b/test/std/containers/associative/multiset/insert_cv.pass.cpp index 2aa920d709725..fe756428223ad 100644 --- a/test/std/containers/associative/multiset/insert_cv.pass.cpp +++ b/test/std/containers/associative/multiset/insert_cv.pass.cpp @@ -18,56 +18,44 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_cv_test() { - { - typedef std::multiset<int> M; - typedef M::iterator R; - M m; - R r = m.insert(M::value_type(2)); - assert(r == m.begin()); - assert(m.size() == 1); - assert(*r == 2); - - r = m.insert(M::value_type(1)); - assert(r == m.begin()); - assert(m.size() == 2); - assert(*r == 1); - - r = m.insert(M::value_type(3)); - assert(r == prev(m.end())); - assert(m.size() == 3); - assert(*r == 3); + typedef Container M; + typedef typename M::iterator R; + typedef typename M::value_type VT; + M m; + const VT v1(2); + R r = m.insert(v1); + assert(r == m.begin()); + assert(m.size() == 1); + assert(*r == 2); + + const VT v2(1); + r = m.insert(v2); + assert(r == m.begin()); + assert(m.size() == 2); + assert(*r == 1); + + const VT v3(3); + r = m.insert(v3); + assert(r == prev(m.end())); + assert(m.size() == 3); + assert(*r == 3); + + r = m.insert(v3); + assert(r == prev(m.end())); + assert(m.size() == 4); + assert(*r == 3); +} - r = m.insert(M::value_type(3)); - assert(r == prev(m.end())); - assert(m.size() == 4); - assert(*r == 3); - } +int main() +{ + do_insert_cv_test<std::multiset<int> >(); #if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> M; - typedef M::iterator R; - M m; - R r = m.insert(M::value_type(2)); - assert(r == m.begin()); - assert(m.size() == 1); - assert(*r == 2); - - r = m.insert(M::value_type(1)); - assert(r == m.begin()); - assert(m.size() == 2); - assert(*r == 1); - - r = m.insert(M::value_type(3)); - assert(r == prev(m.end())); - assert(m.size() == 3); - assert(*r == 3); - - r = m.insert(M::value_type(3)); - assert(r == prev(m.end())); - assert(m.size() == 4); - assert(*r == 3); + do_insert_cv_test<M>(); } #endif } diff --git a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp index 2adfb5c37a4fa..7a43cc1c65aad 100644 --- a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp @@ -35,7 +35,7 @@ int main() assert(m.size() == 0); assert(distance(m.begin(), m.end()) == 0); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); @@ -72,7 +72,7 @@ int main() assert(*next(m.begin(), 7) == 3); assert(*next(m.begin(), 8) == 3); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); diff --git a/test/std/containers/associative/set/count_transparent.pass.cpp b/test/std/containers/associative/set/count_transparent.pass.cpp new file mode 100644 index 0000000000000..26908eacd23bf --- /dev/null +++ b/test/std/containers/associative/set/count_transparent.pass.cpp @@ -0,0 +1,51 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <set> + +// class set + +// template<typename K> +// iterator lower_bound(const K& x); // C++14 +// template<typename K> +// const_iterator lower_bound(const K& x) const; // C++14 + +#include <cassert> +#include <set> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::set<std::pair<int, int>, Comp> s{{2, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 2}}; + + auto cnt = s.count(1); + assert(cnt == 3); +} diff --git a/test/std/containers/associative/set/equal_range_transparent.pass.cpp b/test/std/containers/associative/set/equal_range_transparent.pass.cpp new file mode 100644 index 0000000000000..88030847abcd6 --- /dev/null +++ b/test/std/containers/associative/set/equal_range_transparent.pass.cpp @@ -0,0 +1,60 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// <set> + +// class set + +// template<typename K> +// pair<iterator,iterator> equal_range(const K& x); // +// C++14 +// template<typename K> +// pair<const_iterator,const_iterator> equal_range(const K& x) const; // +// C++14 + +#include <cassert> +#include <set> +#include <utility> + +#include "min_allocator.h" +#include "private_constructor.hpp" +#include "test_macros.h" + +struct Comp { + using is_transparent = void; + + bool operator()(const std::pair<int, int> &lhs, + const std::pair<int, int> &rhs) const { + return lhs < rhs; + } + + bool operator()(const std::pair<int, int> &lhs, int rhs) const { + return lhs.first < rhs; + } + + bool operator()(int lhs, const std::pair<int, int> &rhs) const { + return lhs < rhs.first; + } +}; + +int main() { + std::set<std::pair<int, int>, Comp> s{{2, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 2}}; + + auto er = s.equal_range(1); + long nels = 0; + + for (auto it = er.first; it != er.second; it++) { + assert(it->first == 1); + nels++; + } + + assert(nels == 3); +} diff --git a/test/std/containers/associative/set/insert_cv.pass.cpp b/test/std/containers/associative/set/insert_cv.pass.cpp index 8d5290a97af93..17d3c26237c0c 100644 --- a/test/std/containers/associative/set/insert_cv.pass.cpp +++ b/test/std/containers/associative/set/insert_cv.pass.cpp @@ -18,64 +18,49 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_cv_test() { - { - typedef std::set<int> M; - typedef std::pair<M::iterator, bool> R; - M m; - R r = m.insert(M::value_type(2)); - assert(r.second); - assert(r.first == m.begin()); - assert(m.size() == 1); - assert(*r.first == 2); + typedef Container M; + typedef std::pair<typename M::iterator, bool> R; + typedef typename M::value_type VT; + M m; - r = m.insert(M::value_type(1)); - assert(r.second); - assert(r.first == m.begin()); - assert(m.size() == 2); - assert(*r.first == 1); + const VT v1(2); + R r = m.insert(v1); + assert(r.second); + assert(r.first == m.begin()); + assert(m.size() == 1); + assert(*r.first == 2); - r = m.insert(M::value_type(3)); - assert(r.second); - assert(r.first == prev(m.end())); - assert(m.size() == 3); - assert(*r.first == 3); + const VT v2(1); + r = m.insert(v2); + assert(r.second); + assert(r.first == m.begin()); + assert(m.size() == 2); + assert(*r.first == 1); - r = m.insert(M::value_type(3)); - assert(!r.second); - assert(r.first == prev(m.end())); - assert(m.size() == 3); - assert(*r.first == 3); - } + const VT v3(3); + r = m.insert(v3); + assert(r.second); + assert(r.first == prev(m.end())); + assert(m.size() == 3); + assert(*r.first == 3); + + r = m.insert(v3); + assert(!r.second); + assert(r.first == prev(m.end())); + assert(m.size() == 3); + assert(*r.first == 3); +} + +int main() +{ + do_insert_cv_test<std::set<int> >(); #if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> M; - typedef std::pair<M::iterator, bool> R; - M m; - R r = m.insert(M::value_type(2)); - assert(r.second); - assert(r.first == m.begin()); - assert(m.size() == 1); - assert(*r.first == 2); - - r = m.insert(M::value_type(1)); - assert(r.second); - assert(r.first == m.begin()); - assert(m.size() == 2); - assert(*r.first == 1); - - r = m.insert(M::value_type(3)); - assert(r.second); - assert(r.first == prev(m.end())); - assert(m.size() == 3); - assert(*r.first == 3); - - r = m.insert(M::value_type(3)); - assert(!r.second); - assert(r.first == prev(m.end())); - assert(m.size() == 3); - assert(*r.first == 3); + do_insert_cv_test<M>(); } #endif } diff --git a/test/std/containers/associative/set/set.cons/move.pass.cpp b/test/std/containers/associative/set/set.cons/move.pass.cpp index dd313e4cd5e39..ff87799b90f72 100644 --- a/test/std/containers/associative/set/set.cons/move.pass.cpp +++ b/test/std/containers/associative/set/set.cons/move.pass.cpp @@ -35,7 +35,7 @@ int main() assert(m.size() == 0); assert(distance(m.begin(), m.end()) == 0); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); @@ -66,7 +66,7 @@ int main() assert(*next(m.begin()) == 2); assert(*next(m.begin(), 2) == 3); - assert(mo.get_allocator() == A(7)); + assert(mo.get_allocator() == A(test_alloc_base::moved_value)); assert(mo.key_comp() == C(5)); assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..f3b0527946e39 --- /dev/null +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.fail.cpp @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <queue> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + +#include <queue> +#include <deque> +#include <iterator> +#include <cassert> +#include <cstddef> + + +int main() +{ +// Test the explicit deduction guides + { +// queue(Compare, Container, const Alloc); +// The '45' is not an allocator + std::priority_queue pri(std::greater<int>(), std::deque<int>({1,2,3}), 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}} + } + + { +// queue(const queue&, const Alloc&); +// The '45' is not an allocator + std::priority_queue<int> source; + std::priority_queue pri(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}} + } + + { +// priority_queue(Iter, Iter, Comp) +// int is not an iterator + std::priority_queue pri(15, 17, std::greater<double>()); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}} + } + + { +// priority_queue(Iter, Iter, Comp, Container) +// float is not an iterator + std::priority_queue pri(23.f, 2.f, std::greater<float>(), std::deque<float>()); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}} + } + +// Test the implicit deduction guides + { +// priority_queue (allocator &) + std::priority_queue pri((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'priority_queue'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// stack<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..bcbe1276af559 --- /dev/null +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp @@ -0,0 +1,123 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <queue> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + +// template<class Compare, class Container> +// 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>> +// priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) +// -> priority_queue<typename iterator_traits<InputIterator>::value_type, Container, Compare>; +// +// template<class Compare, class Container, class Allocator> +// priority_queue(Compare, Container, Allocator) +// -> priority_queue<typename Container::value_type, Container, Compare>; + + +#include <queue> +#include <vector> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::priority_queue pri(std::greater<int>(), v); // priority_queue(Compare, Container) + + static_assert(std::is_same_v<decltype(pri), std::priority_queue<int, std::vector<int>, std::greater<int>>>, ""); + assert(pri.size() == v.size()); + assert(pri.top() == 0); + } + + { + std::vector<long, test_allocator<long>> v{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + std::priority_queue pri(std::greater<long>(), v, test_allocator<long>(2)); // priority_queue(Compare, Container, Allocator) + + static_assert(std::is_same_v<decltype(pri), + std::priority_queue<long, std::vector<long, test_allocator<long>>, std::greater<long>>>, ""); + assert(pri.size() == v.size()); + assert(pri.top() == 10); + } + + { + std::vector<short> v{10, 11, 12, 13, 14, 15, 28, 17, 18, 19 }; + std::priority_queue pri(v.begin(), v.end()); // priority_queue(Iter, Iter) + + static_assert(std::is_same_v<decltype(pri), std::priority_queue<short>>, ""); + assert(pri.size() == v.size()); + assert(pri.top() == 28); + } + + { + std::vector<double> v{10, 11, 12, 13, 6, 15, 28, 17, 18, 19 }; + std::priority_queue pri(v.begin(), v.end(), std::greater<double>()); // priority_queue(Iter, Iter, Comp) + + static_assert(std::is_same_v<decltype(pri), std::priority_queue<double, std::vector<double>, std::greater<double>>>, ""); + assert(pri.size() == v.size()); + assert(pri.top() == 6); + } + + { + std::vector<double> v{10, 6, 15, 28, 4, 18, 19 }; + std::deque<double> deq; + std::priority_queue pri(v.begin(), v.end(), std::greater<double>(), deq); // priority_queue(Iter, Iter, Comp, Container) + + static_assert(std::is_same_v<decltype(pri), std::priority_queue<double, std::deque<double>, std::greater<double>>>, ""); + assert(pri.size() == v.size()); + assert(pri.top() == 4); + } + +// Test the implicit deduction guides + { +// We don't expect this one to work - no way to implicitly get value_type +// std::priority_queue pri(std::allocator<int>()); // queue (allocator &) + } + + { + std::priority_queue<float> source; + std::priority_queue pri(source); // priority_queue(priority_queue &) + static_assert(std::is_same_v<decltype(pri)::value_type, float>, ""); + static_assert(std::is_same_v<decltype(pri)::container_type, std::vector<float>>, ""); + assert(pri.size() == 0); + } + + { +// This one is odd - you can pass an allocator in to use, but the allocator +// has to match the type of the one used by the underlying container + typedef long double T; + typedef std::greater<T> Comp; + typedef test_allocator<T> A; + typedef std::deque<T, A> Cont; + + Cont c{2,3,0,1}; + std::priority_queue<T, Cont, Comp> source(Comp(), c); + std::priority_queue pri(source, A(2)); // queue(queue &, allocator) + static_assert(std::is_same_v<decltype(pri)::value_type, T>, ""); + static_assert(std::is_same_v<decltype(pri)::container_type, Cont>, ""); + assert(pri.size() == 4); + assert(pri.top() == 0); + } +} diff --git a/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..1605b96b13bc1 --- /dev/null +++ b/test/std/containers/container.adaptors/queue/queue.cons/deduct.fail.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <queue> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + +#include <queue> +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> + + +int main() +{ +// Test the explicit deduction guides + { +// queue(const Container&, const Alloc&); +// The '45' is not an allocator + std::queue que(std::list<int>{1,2,3}, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}} + } + + { +// queue(const queue&, const Alloc&); +// The '45' is not an allocator + std::queue<int> source; + std::queue que(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}} + } + +// Test the implicit deduction guides + { +// queue (allocator &) + std::queue que((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'queue'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// stack<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..58cb7f5357667 --- /dev/null +++ b/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp @@ -0,0 +1,91 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <queue> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5, apple-clang-9 +// UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +// Specifically, for the copy constructor. + +// template<class Container> +// queue(Container) -> queue<typename Container::value_type, Container>; +// +// template<class Container, class Allocator> +// queue(Container, Allocator) -> queue<typename Container::value_type, Container>; + + +#include <queue> +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + std::list<int> l{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::queue que(l); + + static_assert(std::is_same_v<decltype(que), std::queue<int, std::list<int>>>, ""); + assert(que.size() == l.size()); + assert(que.back() == l.back()); + } + + { + std::list<long, test_allocator<long>> l{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + std::queue que(l, test_allocator<long>(0,2)); // different allocator + static_assert(std::is_same_v<decltype(que)::container_type, std::list<long, test_allocator<long>>>, ""); + static_assert(std::is_same_v<decltype(que)::value_type, long>, ""); + assert(que.size() == 10); + assert(que.back() == 19); +// I'd like to assert that we've gotten the right allocator in the queue, but +// I don't know how to get at the underlying container. + } + +// Test the implicit deduction guides + { +// We don't expect this one to work - no way to implicitly get value_type +// std::queue que(std::allocator<int>()); // queue (allocator &) + } + + { + std::queue<A> source; + std::queue que(source); // queue(queue &) + static_assert(std::is_same_v<decltype(que)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(que)::container_type, std::deque<A>>, ""); + assert(que.size() == 0); + } + + { +// This one is odd - you can pass an allocator in to use, but the allocator +// has to match the type of the one used by the underlying container + typedef short T; + typedef test_allocator<T> A; + typedef std::deque<T, A> C; + + C c{0,1,2,3}; + std::queue<T, C> source(c); + std::queue que(source, A(2)); // queue(queue &, allocator) + static_assert(std::is_same_v<decltype(que)::value_type, T>, ""); + static_assert(std::is_same_v<decltype(que)::container_type, C>, ""); + assert(que.size() == 4); + assert(que.back() == 3); + } + +} diff --git a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp index 4142bc3694d11..ead9ad0bcdf82 100644 --- a/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp @@ -11,19 +11,38 @@ // <queue> -// template <class... Args> reference emplace(Args&&... args); -// return type is 'reference' in C++17; 'void' before +// template <class... Args> decltype(auto) emplace(Args&&... args); +// return type is 'decltype(auto)' in C++17; 'void' before +// whatever the return type of the underlying container's emplace_back() returns. #include <queue> #include <cassert> +#include <list> #include "test_macros.h" #include "../../../Emplaceable.h" +template <typename Queue> +void test_return_type() { + typedef typename Queue::container_type Container; + typedef typename Container::value_type value_type; + typedef decltype(std::declval<Queue>().emplace(std::declval<value_type &>())) queue_return_type; + +#if TEST_STD_VER > 14 + typedef decltype(std::declval<Container>().emplace_back(std::declval<value_type>())) container_return_type; + static_assert(std::is_same<queue_return_type, container_return_type>::value, ""); +#else + static_assert(std::is_same<queue_return_type, void>::value, ""); +#endif +} + int main() { + test_return_type<std::queue<int> > (); + test_return_type<std::queue<int, std::list<int> > > (); + typedef Emplaceable T; std::queue<Emplaceable> q; #if TEST_STD_VER > 14 diff --git a/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp b/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..e54b51084430b --- /dev/null +++ b/test/std/containers/container.adaptors/stack/stack.cons/deduct.fail.cpp @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <stack> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// vector(InputIterator, InputIterator, Allocator = Allocator()) +// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <stack> +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> + + +int main() +{ +// Test the explicit deduction guides + { +// stack(const Container&, const Alloc&); +// The '45' is not an allocator + std::stack stk(std::list<int>({1,2,3}), 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}} + } + + { +// stack(const stack&, const Alloc&); +// The '45' is not an allocator + std::stack<int> source; + std::stack stk(source, 45); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}} + } + +// Test the implicit deduction guides + { +// stack (allocator &) + std::stack stk((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'stack'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// stack<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..bb48f0e5e22e1 --- /dev/null +++ b/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp @@ -0,0 +1,94 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <stack> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5, apple-clang-9 +// UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +// Specifically, for the copy constructor. + + +// template<class Container> +// stack(Container) -> stack<typename Container::value_type, Container>; +// +// template<class Container, class Allocator> +// stack(Container, Allocator) -> stack<typename Container::value_type, Container>; + + +#include <stack> +#include <vector> +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::stack stk(v); + + static_assert(std::is_same_v<decltype(stk), std::stack<int, std::vector<int>>>, ""); + assert(stk.size() == v.size()); + assert(stk.top() == v.back()); + } + + { + std::list<long, test_allocator<long>> l{10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + std::stack stk(l, test_allocator<long>(0,2)); // different allocator + static_assert(std::is_same_v<decltype(stk)::container_type, std::list<long, test_allocator<long>>>, ""); + static_assert(std::is_same_v<decltype(stk)::value_type, long>, ""); + assert(stk.size() == 10); + assert(stk.top() == 19); +// I'd like to assert that we've gotten the right allocator in the stack, but +// I don't know how to get at the underlying container. + } + +// Test the implicit deduction guides + + { +// We don't expect this one to work - no way to implicitly get value_type +// std::stack stk(std::allocator<int>()); // stack (allocator &) + } + + { + std::stack<A> source; + std::stack stk(source); // stack(stack &) + static_assert(std::is_same_v<decltype(stk)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(stk)::container_type, std::deque<A>>, ""); + assert(stk.size() == 0); + } + + { +// This one is odd - you can pass an allocator in to use, but the allocator +// has to match the type of the one used by the underlying container + typedef short T; + typedef test_allocator<T> A; + typedef std::deque<T, A> C; + + C c{0,1,2,3}; + std::stack<T, C> source(c); + std::stack stk(source, A(2)); // stack(stack &, allocator) + static_assert(std::is_same_v<decltype(stk)::value_type, T>, ""); + static_assert(std::is_same_v<decltype(stk)::container_type, C>, ""); + assert(stk.size() == 4); + assert(stk.top() == 3); + } + +} diff --git a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp index 8b19972eb32ec..bb6ff8f91670b 100644 --- a/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp @@ -11,18 +11,37 @@ // <stack> -// template <class... Args> reference emplace(Args&&... args); -// return type is 'reference' in C++17; 'void' before +// template <class... Args> decltype(auto) emplace(Args&&... args); +// return type is 'decltype(auto)' in C++17; 'void' before +// whatever the return type of the underlying container's emplace_back() returns. #include <stack> #include <cassert> +#include <vector> #include "test_macros.h" #include "../../../Emplaceable.h" +template <typename Stack> +void test_return_type() { + typedef typename Stack::container_type Container; + typedef typename Container::value_type value_type; + typedef decltype(std::declval<Stack>().emplace(std::declval<value_type &>())) stack_return_type; + +#if TEST_STD_VER > 14 + typedef decltype(std::declval<Container>().emplace_back(std::declval<value_type>())) container_return_type; + static_assert(std::is_same<stack_return_type, container_return_type>::value, ""); +#else + static_assert(std::is_same<stack_return_type, void>::value, ""); +#endif +} + int main() { + test_return_type<std::stack<int> > (); + test_return_type<std::stack<int, std::vector<int> > > (); + typedef Emplaceable T; std::stack<Emplaceable> q; #if TEST_STD_VER > 14 diff --git a/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp b/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp new file mode 100644 index 0000000000000..81f4ad8934d8f --- /dev/null +++ b/test/std/containers/container.requirements/container.requirements.general/allocator_move.pass.cpp @@ -0,0 +1,106 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// C++2a[container.requirements.general]p8 +// Move constructors obtain an allocator by move construction from the allocator +// belonging to the container being moved. Such move construction of the +// allocator shall not exit via an exception. + +#include <vector> +#include <deque> +#include <list> +#include <forward_list> +#include <set> +#include <map> +#include <unordered_map> +#include <unordered_set> + +#include "test_macros.h" +#include "test_allocator.h" + +template <class C> +void test(int expected_num_allocs = 1) { + { + test_alloc_base::clear(); + using AllocT = typename C::allocator_type; + C v(AllocT(42, 101)); + + assert(test_alloc_base::count == expected_num_allocs); + + const int num_stored_allocs = test_alloc_base::count; + { + const AllocT& a = v.get_allocator(); + assert(test_alloc_base::count == 1 + num_stored_allocs); + assert(a.get_data() == 42); + assert(a.get_id() == 101); + } + assert(test_alloc_base::count == num_stored_allocs); + test_alloc_base::clear_ctor_counters(); + + C v2 = std::move(v); + assert(test_alloc_base::count == num_stored_allocs * 2); + assert(test_alloc_base::copied == 0); + assert(test_alloc_base::moved == num_stored_allocs); + { + const AllocT& a = v.get_allocator(); + assert(a.get_id() == test_alloc_base::moved_value); + assert(a.get_data() == test_alloc_base::moved_value); + } + { + const AllocT& a = v2.get_allocator(); + assert(a.get_id() == 101); + assert(a.get_data() == 42); + } + } +} + +int main() { + { // test sequence containers + test<std::vector<int, test_allocator<int> > >(); + test<std::vector<bool, test_allocator<bool> > >(); + test<std::list<int, test_allocator<int> > >(); + test<std::forward_list<int, test_allocator<int> > >(); + + // libc++ stores two allocators in deque +#ifdef _LIBCPP_VERSION + int stored_allocators = 2; +#else + int stored_allocators = 1; +#endif + test<std::deque<int, test_allocator<int> > >(stored_allocators); + } + { // test associative containers + test<std::set<int, std::less<int>, test_allocator<int> > >(); + test<std::multiset<int, std::less<int>, test_allocator<int> > >(); + + using KV = std::pair<const int, int>; + test<std::map<int, int, std::less<int>, test_allocator<KV> > >(); + test<std::multimap<int, int, std::less<int>, test_allocator<KV> > >(); + } + { // test unordered containers + // libc++ stores two allocators in the unordered containers. +#ifdef _LIBCPP_VERSION + int stored_allocators = 2; +#else + int stored_allocators = 1; +#endif + test<std::unordered_set<int, std::hash<int>, std::equal_to<int>, + test_allocator<int> > >(stored_allocators); + test<std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, + test_allocator<int> > >(stored_allocators); + + using KV = std::pair<const int, int>; + test<std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, + test_allocator<KV> > >(stored_allocators); + test<std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, + test_allocator<KV> > >(stored_allocators); + } +} diff --git a/test/std/containers/sequences/array/array.cons/deduct.fail.cpp b/test/std/containers/sequences/array/array.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..c04c9b60786d3 --- /dev/null +++ b/test/std/containers/sequences/array/array.cons/deduct.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class T, class... U> +// array(T, U...) -> array<T, 1 + sizeof...(U)>; +// +// Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed. + + +#include <array> +#include <cassert> +#include <cstddef> + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + + +#include "test_macros.h" + +int main() +{ + { + std::array arr{1,2,3L}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'array'}} + } +} diff --git a/test/std/containers/sequences/array/array.cons/deduct.pass.cpp b/test/std/containers/sequences/array/array.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..bfa0bb79189d2 --- /dev/null +++ b/test/std/containers/sequences/array/array.cons/deduct.pass.cpp @@ -0,0 +1,65 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5, apple-clang-9 +// UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +// Specifically, for the copy constructor. + + +// template <class T, class... U> +// array(T, U...) -> array<T, 1 + sizeof...(U)>; +// +// Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed. + + +#include <array> +#include <cassert> +#include <cstddef> + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +#include "test_macros.h" + +int main() +{ +// Test the explicit deduction guides + { + std::array arr{1,2,3}; // array(T, U...) + static_assert(std::is_same_v<decltype(arr), std::array<int, 3>>, ""); + assert(arr[0] == 1); + assert(arr[1] == 2); + assert(arr[2] == 3); + } + + { + const long l1 = 42; + std::array arr{1L, 4L, 9L, l1}; // array(T, U...) + static_assert(std::is_same_v<decltype(arr)::value_type, long>, ""); + static_assert(arr.size() == 4, ""); + assert(arr[0] == 1); + assert(arr[1] == 4); + assert(arr[2] == 9); + assert(arr[3] == l1); + } + +// Test the implicit deduction guides + { + std::array<double, 2> source = {4.0, 5.0}; + std::array arr(source); // array(array) + static_assert(std::is_same_v<decltype(arr), decltype(source)>, ""); + static_assert(std::is_same_v<decltype(arr), std::array<double, 2>>, ""); + assert(arr[0] == 4.0); + assert(arr[1] == 5.0); + } +} diff --git a/test/std/containers/sequences/array/array.cons/default.pass.cpp b/test/std/containers/sequences/array/array.cons/default.pass.cpp index 7bc62b759c356..9a2a6eaa30701 100644 --- a/test/std/containers/sequences/array/array.cons/default.pass.cpp +++ b/test/std/containers/sequences/array/array.cons/default.pass.cpp @@ -14,6 +14,14 @@ #include <array> #include <cassert> +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +struct NoDefault { + NoDefault(int) {} +}; + int main() { { @@ -28,4 +36,13 @@ int main() C c; assert(c.size() == 0); } + { + typedef std::array<NoDefault, 0> C; + C c; + assert(c.size() == 0); + C c1 = {}; + assert(c1.size() == 0); + C c2 = {{}}; + assert(c2.size() == 0); + } } diff --git a/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp b/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp new file mode 100644 index 0000000000000..7814085e8a7df --- /dev/null +++ b/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// implicitly generated array constructors / assignment operators + +#include <array> +#include <type_traits> +#include <cassert> +#include "test_macros.h" + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +// In C++03 the copy assignment operator is not deleted when the implicitly +// generated operator would be ill-formed; like in the case of a struct with a +// const member. +#if TEST_STD_VER < 11 +#define TEST_NOT_COPY_ASSIGNABLE(T) ((void)0) +#else +#define TEST_NOT_COPY_ASSIGNABLE(T) static_assert(!std::is_copy_assignable<T>::value, "") +#endif + +struct NoDefault { + NoDefault(int) {} +}; + +int main() { + { + typedef double T; + typedef std::array<T, 3> C; + C c = {1.1, 2.2, 3.3}; + C c2 = c; + c2 = c; + static_assert(std::is_copy_constructible<C>::value, ""); + static_assert(std::is_copy_assignable<C>::value, ""); + } + { + typedef double T; + typedef std::array<const T, 3> C; + C c = {1.1, 2.2, 3.3}; + C c2 = c; + ((void)c2); + static_assert(std::is_copy_constructible<C>::value, ""); + TEST_NOT_COPY_ASSIGNABLE(C); + } + { + typedef double T; + typedef std::array<T, 0> C; + C c = {}; + C c2 = c; + c2 = c; + static_assert(std::is_copy_constructible<C>::value, ""); + static_assert(std::is_copy_assignable<C>::value, ""); + } + { + // const arrays of size 0 should disable the implicit copy assignment operator. + typedef double T; + typedef std::array<const T, 0> C; + C c = {{}}; + C c2 = c; + ((void)c2); + static_assert(std::is_copy_constructible<C>::value, ""); + TEST_NOT_COPY_ASSIGNABLE(C); + } + { + typedef NoDefault T; + typedef std::array<T, 0> C; + C c = {}; + C c2 = c; + c2 = c; + static_assert(std::is_copy_constructible<C>::value, ""); + static_assert(std::is_copy_assignable<C>::value, ""); + } + { + typedef NoDefault T; + typedef std::array<const T, 0> C; + C c = {{}}; + C c2 = c; + ((void)c2); + static_assert(std::is_copy_constructible<C>::value, ""); + TEST_NOT_COPY_ASSIGNABLE(C); + } + +} diff --git a/test/std/containers/sequences/array/array.data/data.pass.cpp b/test/std/containers/sequences/array/array.data/data.pass.cpp index d7aed70c98ad6..714894308f00a 100644 --- a/test/std/containers/sequences/array/array.data/data.pass.cpp +++ b/test/std/containers/sequences/array/array.data/data.pass.cpp @@ -13,6 +13,7 @@ #include <array> #include <cassert> +#include "test_macros.h" // std::array is explicitly allowed to be initialized with A a = { init-list };. // Disable the missing braces warning for this reason. @@ -34,6 +35,33 @@ int main() typedef std::array<T, 0> C; C c = {}; T* p = c.data(); - (void)p; // to placate scan-build + assert(p != nullptr); + } + { + typedef double T; + typedef std::array<const T, 0> C; + C c = {{}}; + const T* p = c.data(); + static_assert((std::is_same<decltype(c.data()), const T*>::value), ""); + assert(p != nullptr); + } + { + typedef std::max_align_t T; + typedef std::array<T, 0> C; + const C c = {}; + const T* p = c.data(); + assert(p != nullptr); + std::uintptr_t pint = reinterpret_cast<std::uintptr_t>(p); + assert(pint % TEST_ALIGNOF(std::max_align_t) == 0); + } + { + struct NoDefault { + NoDefault(int) {} + }; + typedef NoDefault T; + typedef std::array<T, 0> C; + C c = {}; + T* p = c.data(); + assert(p != nullptr); } } diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp index 5be082eeb8431..b99bf6af8627e 100644 --- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp +++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp @@ -38,6 +38,25 @@ int main() const T* p = c.data(); (void)p; // to placate scan-build } + { + struct NoDefault { + NoDefault(int) {} + }; + typedef NoDefault T; + typedef std::array<T, 0> C; + const C c = {}; + const T* p = c.data(); + assert(p != nullptr); + } + { + typedef std::max_align_t T; + typedef std::array<T, 0> C; + const C c = {}; + const T* p = c.data(); + assert(p != nullptr); + std::uintptr_t pint = reinterpret_cast<std::uintptr_t>(p); + assert(pint % TEST_ALIGNOF(std::max_align_t) == 0); + } #if TEST_STD_VER > 14 { typedef std::array<int, 5> C; diff --git a/test/std/containers/sequences/array/array.fill/fill.fail.cpp b/test/std/containers/sequences/array/array.fill/fill.fail.cpp new file mode 100644 index 0000000000000..4cd8e60ac13d1 --- /dev/null +++ b/test/std/containers/sequences/array/array.fill/fill.fail.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// void fill(const T& u); + +#include <array> +#include <cassert> + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +int main() { + { + typedef double T; + typedef std::array<const T, 0> C; + C c = {}; + // expected-error-re@array:* {{static_assert failed {{.*}}"cannot fill zero-sized array of type 'const T'"}} + c.fill(5.5); // expected-note {{requested here}} + } +} diff --git a/test/std/containers/sequences/array/array.swap/swap.fail.cpp b/test/std/containers/sequences/array/array.swap/swap.fail.cpp new file mode 100644 index 0000000000000..638c5b3212f1a --- /dev/null +++ b/test/std/containers/sequences/array/array.swap/swap.fail.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// void swap(array& a); + +#include <array> +#include <cassert> + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +int main() { + { + typedef double T; + typedef std::array<const T, 0> C; + C c = {}; + C c2 = {}; + // expected-error-re@array:* {{static_assert failed {{.*}}"cannot swap zero-sized array of type 'const T'"}} + c.swap(c2); // expected-note {{requested here}} + } +} diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp index 27b326fa7ce40..84a8d6f9d18e0 100644 --- a/test/std/containers/sequences/array/at.pass.cpp +++ b/test/std/containers/sequences/array/at.pass.cpp @@ -56,6 +56,26 @@ int main() catch (const std::out_of_range &) {} #endif } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + typedef double T; + typedef std::array<T, 0> C; + C c = {}; + C const& cc = c; + try + { + TEST_IGNORE_NODISCARD c.at(0); + assert(false); + } + catch (const std::out_of_range &) {} + try + { + TEST_IGNORE_NODISCARD cc.at(0); + assert(false); + } + catch (const std::out_of_range &) {} + } +#endif { typedef double T; typedef std::array<T, 3> C; diff --git a/test/std/containers/sequences/array/begin.pass.cpp b/test/std/containers/sequences/array/begin.pass.cpp index b12ffc851b841..282a947fefeca 100644 --- a/test/std/containers/sequences/array/begin.pass.cpp +++ b/test/std/containers/sequences/array/begin.pass.cpp @@ -18,6 +18,7 @@ // Disable the missing braces warning for this reason. #include "disable_missing_braces_warning.h" + int main() { { @@ -31,4 +32,13 @@ int main() *i = 5.5; assert(c[0] == 5.5); } + { + struct NoDefault { + NoDefault(int) {} + }; + typedef NoDefault T; + typedef std::array<T, 0> C; + C c = {}; + assert(c.begin() == c.end()); + } } diff --git a/test/std/containers/sequences/array/compare.fail.cpp b/test/std/containers/sequences/array/compare.fail.cpp new file mode 100644 index 0000000000000..2aa7cd896d9e4 --- /dev/null +++ b/test/std/containers/sequences/array/compare.fail.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// bool operator==(array<T, N> const&, array<T, N> const&); +// bool operator!=(array<T, N> const&, array<T, N> const&); +// bool operator<(array<T, N> const&, array<T, N> const&); +// bool operator<=(array<T, N> const&, array<T, N> const&); +// bool operator>(array<T, N> const&, array<T, N> const&); +// bool operator>=(array<T, N> const&, array<T, N> const&); + + +#include <array> +#include <vector> +#include <cassert> + +#include "test_macros.h" + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +template <class Array> +void test_compare(const Array& LHS, const Array& RHS) { + typedef std::vector<typename Array::value_type> Vector; + const Vector LHSV(LHS.begin(), LHS.end()); + const Vector RHSV(RHS.begin(), RHS.end()); + assert((LHS == RHS) == (LHSV == RHSV)); + assert((LHS != RHS) == (LHSV != RHSV)); + assert((LHS < RHS) == (LHSV < RHSV)); + assert((LHS <= RHS) == (LHSV <= RHSV)); + assert((LHS > RHS) == (LHSV > RHSV)); + assert((LHS >= RHS) == (LHSV >= RHSV)); +} + +template <int Dummy> struct NoCompare {}; + +int main() +{ + { + typedef NoCompare<0> T; + typedef std::array<T, 3> C; + C c1 = {{}}; + // expected-error@algorithm:* 2 {{invalid operands to binary expression}} + TEST_IGNORE_NODISCARD (c1 == c1); + TEST_IGNORE_NODISCARD (c1 < c1); + } + { + typedef NoCompare<1> T; + typedef std::array<T, 3> C; + C c1 = {{}}; + // expected-error@algorithm:* 2 {{invalid operands to binary expression}} + TEST_IGNORE_NODISCARD (c1 != c1); + TEST_IGNORE_NODISCARD (c1 > c1); + } + { + typedef NoCompare<2> T; + typedef std::array<T, 0> C; + C c1 = {{}}; + // expected-error@algorithm:* 2 {{invalid operands to binary expression}} + TEST_IGNORE_NODISCARD (c1 == c1); + TEST_IGNORE_NODISCARD (c1 < c1); + } +} diff --git a/test/std/containers/sequences/array/compare.pass.cpp b/test/std/containers/sequences/array/compare.pass.cpp new file mode 100644 index 0000000000000..c8bcf75a0934a --- /dev/null +++ b/test/std/containers/sequences/array/compare.pass.cpp @@ -0,0 +1,63 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// bool operator==(array<T, N> const&, array<T, N> const&); +// bool operator!=(array<T, N> const&, array<T, N> const&); +// bool operator<(array<T, N> const&, array<T, N> const&); +// bool operator<=(array<T, N> const&, array<T, N> const&); +// bool operator>(array<T, N> const&, array<T, N> const&); +// bool operator>=(array<T, N> const&, array<T, N> const&); + + +#include <array> +#include <vector> +#include <cassert> + +#include "test_macros.h" + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +template <class Array> +void test_compare(const Array& LHS, const Array& RHS) { + typedef std::vector<typename Array::value_type> Vector; + const Vector LHSV(LHS.begin(), LHS.end()); + const Vector RHSV(RHS.begin(), RHS.end()); + assert((LHS == RHS) == (LHSV == RHSV)); + assert((LHS != RHS) == (LHSV != RHSV)); + assert((LHS < RHS) == (LHSV < RHSV)); + assert((LHS <= RHS) == (LHSV <= RHSV)); + assert((LHS > RHS) == (LHSV > RHSV)); + assert((LHS >= RHS) == (LHSV >= RHSV)); +} + +int main() +{ + { + typedef int T; + typedef std::array<T, 3> C; + C c1 = {1, 2, 3}; + C c2 = {1, 2, 3}; + C c3 = {3, 2, 1}; + C c4 = {1, 2, 1}; + test_compare(c1, c2); + test_compare(c1, c3); + test_compare(c1, c4); + } + { + typedef int T; + typedef std::array<T, 0> C; + C c1 = {}; + C c2 = {}; + test_compare(c1, c2); + } +} diff --git a/test/std/containers/sequences/array/empty.fail.cpp b/test/std/containers/sequences/array/empty.fail.cpp index 85bf5a7c9dab7..fe118c5f19b5b 100644 --- a/test/std/containers/sequences/array/empty.fail.cpp +++ b/test/std/containers/sequences/array/empty.fail.cpp @@ -23,6 +23,9 @@ int main () { + std::array<int, 1> c; - c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} + c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} + std::array<int, 0> c0; + c0.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} } diff --git a/test/std/containers/sequences/array/front_back.pass.cpp b/test/std/containers/sequences/array/front_back.pass.cpp index 0591ca7fac318..443f28ddf5179 100644 --- a/test/std/containers/sequences/array/front_back.pass.cpp +++ b/test/std/containers/sequences/array/front_back.pass.cpp @@ -64,7 +64,38 @@ int main() C::const_reference r2 = c.back(); assert(r2 == 3.5); } - + { + typedef double T; + typedef std::array<T, 0> C; + C c = {}; + C const& cc = c; + static_assert((std::is_same<decltype(c.front()), T &>::value), ""); + static_assert((std::is_same<decltype(cc.front()), const T &>::value), ""); + static_assert((std::is_same<decltype(c.back()), T &>::value), ""); + static_assert((std::is_same<decltype(cc.back()), const T &>::value), ""); + if (c.size() > (0)) { // always false + TEST_IGNORE_NODISCARD c.front(); + TEST_IGNORE_NODISCARD c.back(); + TEST_IGNORE_NODISCARD cc.front(); + TEST_IGNORE_NODISCARD cc.back(); + } + } + { + typedef double T; + typedef std::array<const T, 0> C; + C c = {{}}; + C const& cc = c; + static_assert((std::is_same<decltype(c.front()), const T &>::value), ""); + static_assert((std::is_same<decltype(cc.front()), const T &>::value), ""); + static_assert((std::is_same<decltype(c.back()), const T &>::value), ""); + static_assert((std::is_same<decltype(cc.back()), const T &>::value), ""); + if (c.size() > (0)) { + TEST_IGNORE_NODISCARD c.front(); + TEST_IGNORE_NODISCARD c.back(); + TEST_IGNORE_NODISCARD cc.front(); + TEST_IGNORE_NODISCARD cc.back(); + } + } #if TEST_STD_VER > 11 { typedef double T; diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp index 43c494777a9df..7718b92f989e5 100644 --- a/test/std/containers/sequences/array/indexing.pass.cpp +++ b/test/std/containers/sequences/array/indexing.pass.cpp @@ -56,7 +56,34 @@ int main() C::const_reference r2 = c[2]; assert(r2 == 3.5); } - + { // Test operator[] "works" on zero sized arrays + typedef double T; + typedef std::array<T, 0> C; + C c = {}; + C const& cc = c; + static_assert((std::is_same<decltype(c[0]), T &>::value), ""); + static_assert((std::is_same<decltype(cc[0]), const T &>::value), ""); + if (c.size() > (0)) { // always false + C::reference r1 = c[0]; + C::const_reference r2 = cc[0]; + ((void)r1); + ((void)r2); + } + } + { // Test operator[] "works" on zero sized arrays + typedef double T; + typedef std::array<const T, 0> C; + C c = {{}}; + C const& cc = c; + static_assert((std::is_same<decltype(c[0]), const T &>::value), ""); + static_assert((std::is_same<decltype(cc[0]), const T &>::value), ""); + if (c.size() > (0)) { // always false + C::reference r1 = c[0]; + C::const_reference r2 = cc[0]; + ((void)r1); + ((void)r2); + } + } #if TEST_STD_VER > 11 { typedef double T; diff --git a/test/std/containers/sequences/array/size_and_alignment.pass.cpp b/test/std/containers/sequences/array/size_and_alignment.pass.cpp new file mode 100644 index 0000000000000..966d063fe17a6 --- /dev/null +++ b/test/std/containers/sequences/array/size_and_alignment.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> + +// template <class T, size_t N > +// struct array + +// Test the size and alignment matches that of an array of a given type. + +#include <array> +#include <iterator> +#include <type_traits> +#include <cstddef> + +#include "test_macros.h" + + +template <class T, size_t Size> +struct MyArray { + T elems[Size]; +}; + +template <class T, size_t Size> +void test() { + typedef T CArrayT[Size == 0 ? 1 : Size]; + typedef std::array<T, Size> ArrayT; + typedef MyArray<T, Size == 0 ? 1 : Size> MyArrayT; + static_assert(sizeof(ArrayT) == sizeof(CArrayT), ""); + static_assert(sizeof(ArrayT) == sizeof(MyArrayT), ""); + static_assert(TEST_ALIGNOF(ArrayT) == TEST_ALIGNOF(MyArrayT), ""); +#if defined(_LIBCPP_VERSION) + ArrayT a; + ((void)a); + static_assert(sizeof(ArrayT) == sizeof(a.__elems_), ""); + static_assert(TEST_ALIGNOF(ArrayT) == __alignof__(a.__elems_), ""); +#endif +} + +template <class T> +void test_type() { + test<T, 1>(); + test<T, 42>(); + test<T, 0>(); +} + +struct TEST_ALIGNAS(TEST_ALIGNOF(std::max_align_t) * 2) TestType1 { + +}; + +struct TEST_ALIGNAS(TEST_ALIGNOF(std::max_align_t) * 2) TestType2 { + char data[1000]; +}; + +//static_assert(sizeof(void*) == 4, ""); + +int main() { + test_type<char>(); + test_type<int>(); + test_type<double>(); + test_type<long double>(); + test_type<std::max_align_t>(); + test_type<TestType1>(); + test_type<TestType2>(); +} diff --git a/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp b/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..61ab9c8421bb9 --- /dev/null +++ b/test/std/containers/sequences/deque/deque.cons/deduct.fail.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// deque(InputIterator, InputIterator, Allocator = Allocator()) +// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <deque> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides + { +// deque (allocator &) + std::deque deq((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'deque'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// deque<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp b/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..a2ec262f15832 --- /dev/null +++ b/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp @@ -0,0 +1,98 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <array> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// deque(InputIterator, InputIterator, Allocator = Allocator()) +// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <deque> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::deque deq(std::begin(arr), std::end(arr)); + + static_assert(std::is_same_v<decltype(deq), std::deque<int>>, ""); + assert(std::equal(deq.begin(), deq.end(), std::begin(arr), std::end(arr))); + } + + { + const long arr[] = {INT_MAX, 1L, 2L, 3L }; + std::deque deq(std::begin(arr), std::end(arr), std::allocator<long>()); + static_assert(std::is_same_v<decltype(deq)::value_type, long>, ""); + assert(deq.size() == 4); + assert(deq[0] == INT_MAX); + assert(deq[1] == 1L); + assert(deq[2] == 2L); + } + +// Test the implicit deduction guides + + { +// We don't expect this one to work. +// std::deque deq(std::allocator<int>()); // deque (allocator &) + } + + { + std::deque deq(1, A{}); // deque (size_type, T) + static_assert(std::is_same_v<decltype(deq)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(deq)::allocator_type, std::allocator<A>>, ""); + assert(deq.size() == 1); + } + + { + std::deque deq(1, A{}, test_allocator<A>()); // deque (size_type, T, allocator) + static_assert(std::is_same_v<decltype(deq)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(deq)::allocator_type, test_allocator<A>>, ""); + assert(deq.size() == 1); + } + + { + std::deque deq{1U, 2U, 3U, 4U, 5U}; // deque(initializer-list) + static_assert(std::is_same_v<decltype(deq)::value_type, unsigned>, ""); + assert(deq.size() == 5); + assert(deq[2] == 3U); + } + + { + std::deque deq({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // deque(initializer-list, allocator) + static_assert(std::is_same_v<decltype(deq)::value_type, double>, ""); + static_assert(std::is_same_v<decltype(deq)::allocator_type, test_allocator<double>>, ""); + assert(deq.size() == 4); + assert(deq[3] == 4.0); + } + + { + std::deque<long double> source; + std::deque deq(source); // deque(deque &) + static_assert(std::is_same_v<decltype(deq)::value_type, long double>, ""); + static_assert(std::is_same_v<decltype(deq)::allocator_type, std::allocator<long double>>, ""); + assert(deq.size() == 0); + } +} diff --git a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp index 6e935a52bb24c..a7264a55633c3 100644 --- a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp +++ b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp @@ -32,10 +32,12 @@ int main() std::deque<MoveOnly, A> c2(A(2)); for (int* p = ab; p < an; ++p) c2.push_back(MoveOnly(*p)); + A old_a = c1.get_allocator(); std::deque<MoveOnly, A> c3 = std::move(c1); assert(c2 == c3); assert(c1.size() == 0); - assert(c3.get_allocator() == c1.get_allocator()); + assert(c3.get_allocator() == old_a); + assert(c1.get_allocator() == A(test_alloc_base::moved_value)); } { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..ef5b20ee7b0c9 --- /dev/null +++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.fail.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <forward_list> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// forward_list(InputIterator, InputIterator, Allocator = Allocator()) +// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <forward_list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides + { +// forward_list (allocator &) + std::forward_list fwl((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'forward_list'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// forward_list<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..c3969a4623e53 --- /dev/null +++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp @@ -0,0 +1,103 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <forward_list> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// deque(InputIterator, InputIterator, Allocator = Allocator()) +// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <forward_list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::forward_list fwl(std::begin(arr), std::end(arr)); + + static_assert(std::is_same_v<decltype(fwl), std::forward_list<int>>, ""); + assert(std::equal(fwl.begin(), fwl.end(), std::begin(arr), std::end(arr))); + } + + { + const long arr[] = {INT_MAX, 1L, 2L, 3L }; + std::forward_list fwl(std::begin(arr), std::end(arr), std::allocator<long>()); + static_assert(std::is_same_v<decltype(fwl)::value_type, long>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 4); // no size for forward_list + auto it = fwl.begin(); + assert(*it++ == INT_MAX); + assert(*it++ == 1L); + assert(*it++ == 2L); + } + +// Test the implicit deduction guides + + { +// We don't expect this one to work. +// std::forward_list fwl(std::allocator<int>()); // deque (allocator &) + } + + { + std::forward_list fwl(1, A{}); // deque (size_type, T) + static_assert(std::is_same_v<decltype(fwl)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(fwl)::allocator_type, std::allocator<A>>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 1); // no size for forward_list + } + + { + std::forward_list fwl(1, A{}, test_allocator<A>()); // deque (size_type, T, allocator) + static_assert(std::is_same_v<decltype(fwl)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(fwl)::allocator_type, test_allocator<A>>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 1); // no size for forward_list + } + + { + std::forward_list fwl{1U, 2U, 3U, 4U, 5U}; // deque(initializer-list) + static_assert(std::is_same_v<decltype(fwl)::value_type, unsigned>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 5); // no size for forward_list + auto it = fwl.begin(); + std::advance(it, 2); + assert(*it == 3U); + } + + { + std::forward_list fwl({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // deque(initializer-list, allocator) + static_assert(std::is_same_v<decltype(fwl)::value_type, double>, ""); + static_assert(std::is_same_v<decltype(fwl)::allocator_type, test_allocator<double>>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 4); // no size for forward_list + auto it = fwl.begin(); + std::advance(it, 3); + assert(*it == 4.0); + } + + { + std::forward_list<long double> source; + std::forward_list fwl(source); // deque(deque &) + static_assert(std::is_same_v<decltype(fwl)::value_type, long double>, ""); + static_assert(std::is_same_v<decltype(fwl)::allocator_type, std::allocator<long double>>, ""); + assert(std::distance(fwl.begin(), fwl.end()) == 0); // no size for forward_list + } +} diff --git a/test/std/containers/sequences/list/list.cons/deduct.fail.cpp b/test/std/containers/sequences/list/list.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..5708d73734e64 --- /dev/null +++ b/test/std/containers/sequences/list/list.cons/deduct.fail.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <list> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// list(InputIterator, InputIterator, Allocator = Allocator()) +// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides + { +// list (allocator &) + std::list lst((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'list'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// deque<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/sequences/list/list.cons/deduct.pass.cpp b/test/std/containers/sequences/list/list.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..b8021ef980c48 --- /dev/null +++ b/test/std/containers/sequences/list/list.cons/deduct.pass.cpp @@ -0,0 +1,103 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <list> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// list(InputIterator, InputIterator, Allocator = Allocator()) +// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <list> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::list lst(std::begin(arr), std::end(arr)); + + static_assert(std::is_same_v<decltype(lst), std::list<int>>, ""); + assert(std::equal(lst.begin(), lst.end(), std::begin(arr), std::end(arr))); + } + + { + const long arr[] = {INT_MAX, 1L, 2L, 3L }; + std::list lst(std::begin(arr), std::end(arr), std::allocator<long>()); + static_assert(std::is_same_v<decltype(lst)::value_type, long>, ""); + assert(lst.size() == 4); + auto it = lst.begin(); + assert(*it++ == INT_MAX); + assert(*it++ == 1L); + assert(*it++ == 2L); + } + +// Test the implicit deduction guides + + { +// We don't expect this one to work. +// std::list lst(std::allocator<int>()); // list (allocator &) + } + + { + std::list lst(1, A{}); // list (size_type, T) + static_assert(std::is_same_v<decltype(lst)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(lst)::allocator_type, std::allocator<A>>, ""); + assert(lst.size() == 1); + } + + { + std::list lst(1, A{}, test_allocator<A>()); // list (size_type, T, allocator) + static_assert(std::is_same_v<decltype(lst)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(lst)::allocator_type, test_allocator<A>>, ""); + assert(lst.size() == 1); + } + + { + std::list lst{1U, 2U, 3U, 4U, 5U}; // list(initializer-list) + static_assert(std::is_same_v<decltype(lst)::value_type, unsigned>, ""); + assert(lst.size() == 5); + auto it = lst.begin(); + std::advance(it, 2); + assert(*it == 3U); + } + + { + std::list lst({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // list(initializer-list, allocator) + static_assert(std::is_same_v<decltype(lst)::value_type, double>, ""); + static_assert(std::is_same_v<decltype(lst)::allocator_type, test_allocator<double>>, ""); + assert(lst.size() == 4); + auto it = lst.begin(); + std::advance(it, 3); + assert(*it == 4.0); + } + + { + std::list<long double> source; + std::list lst(source); // list(list &) + static_assert(std::is_same_v<decltype(lst)::value_type, long double>, ""); + static_assert(std::is_same_v<decltype(lst)::allocator_type, std::allocator<long double>>, ""); + assert(lst.size() == 0); + } +} diff --git a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp index 517eb62ccae25..33f2fab0d8a40 100644 --- a/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp +++ b/test/std/containers/sequences/list/list.ops/sort_comp.pass.cpp @@ -13,10 +13,29 @@ #include <list> #include <functional> +#include <algorithm> // for is_permutation #include <cassert> #include "min_allocator.h" + +#ifndef TEST_HAS_NO_EXCEPTIONS +template <typename T> +struct throwingLess { + throwingLess() : num_(1) {} + throwingLess(int num) : num_(num) {} + + bool operator() (const T& lhs, const T& rhs) const + { + if ( --num_ == 0) throw 1; + return lhs < rhs; + } + + mutable int num_; + }; +#endif + + int main() { { @@ -26,6 +45,28 @@ int main() c1.sort(std::greater<int>()); assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0]))); } + +// Test with throwing comparison; make sure that nothing is lost. +// This is (sort of) LWG #2824 +#ifndef TEST_HAS_NO_EXCEPTIONS + { + int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9}; + const int sz = sizeof(a1)/sizeof(a1[0]); + for (int i = 0; i < 10; ++i) + { + std::list<int> c1(a1, a1 + sz); + try + { + throwingLess<int> comp(i); + c1.sort(std::cref(comp)); + } + catch (int) {} + assert((c1.size() == sz)); + assert((std::is_permutation(c1.begin(), c1.end(), a1))); + } + } +#endif + #if TEST_STD_VER >= 11 { int a1[] = {4, 8, 1, 0, 5, 7, 2, 3, 6, 11, 10, 9}; diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp index f189e2b97092b..ab2b7ce6d3164 100644 --- a/test/std/containers/sequences/vector.bool/move.pass.cpp +++ b/test/std/containers/sequences/vector.bool/move.pass.cpp @@ -15,6 +15,7 @@ #include <vector> #include <cassert> +#include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" @@ -59,4 +60,34 @@ int main() assert(l.empty()); assert(l2.get_allocator() == lo.get_allocator()); } + { + test_alloc_base::clear(); + using Vect = std::vector<bool, test_allocator<bool> >; + using AllocT = Vect::allocator_type; + Vect v(test_allocator<bool>(42, 101)); + assert(test_alloc_base::count == 1); + { + const AllocT& a = v.get_allocator(); + assert(test_alloc_base::count == 2); + assert(a.get_data() == 42); + assert(a.get_id() == 101); + } + assert(test_alloc_base::count == 1); + test_alloc_base::clear_ctor_counters(); + + Vect v2 = std::move(v); + assert(test_alloc_base::count == 2); + assert(test_alloc_base::copied == 0); + assert(test_alloc_base::moved == 1); + { + const AllocT& a = v.get_allocator(); + assert(a.get_id() == test_alloc_base::moved_value); + assert(a.get_data() == test_alloc_base::moved_value); + } + { + const AllocT& a = v2.get_allocator(); + assert(a.get_id() == 101); + assert(a.get_data() == 42); + } + } } diff --git a/test/std/containers/sequences/vector/iterators.pass.cpp b/test/std/containers/sequences/vector/iterators.pass.cpp index a1ce2be327181..33093e151aa2f 100644 --- a/test/std/containers/sequences/vector/iterators.pass.cpp +++ b/test/std/containers/sequences/vector/iterators.pass.cpp @@ -77,6 +77,8 @@ int main() typedef std::vector<T> C; C::iterator i; C::const_iterator j; + (void) i; + (void) j; } #if TEST_STD_VER >= 11 { @@ -125,6 +127,8 @@ int main() typedef std::vector<T, min_allocator<T>> C; C::iterator i; C::const_iterator j; + (void) i; + (void) j; } { typedef A T; diff --git a/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp b/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp new file mode 100644 index 0000000000000..d479800120fcd --- /dev/null +++ b/test/std/containers/sequences/vector/vector.cons/deduct.fail.cpp @@ -0,0 +1,40 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <vector> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// vector(InputIterator, InputIterator, Allocator = Allocator()) +// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <deque> +#include <iterator> +#include <cassert> +#include <cstddef> + + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides + { +// vector (allocator &) + std::vector vec((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'vector'}} +// Note: The extra parens are necessary, since otherwise clang decides it is a function declaration. +// Also, we can't use {} instead of parens, because that constructs a +// deque<allocator<int>, allocator<allocator<int>>> + } + +} diff --git a/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp b/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..175fede781931 --- /dev/null +++ b/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp @@ -0,0 +1,116 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <vector> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// deque(InputIterator, InputIterator, Allocator = Allocator()) +// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <vector> +#include <iterator> +#include <cassert> +#include <cstddef> +#include <climits> // INT_MAX + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { + const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + std::vector vec(std::begin(arr), std::end(arr)); + + static_assert(std::is_same_v<decltype(vec), std::vector<int>>, ""); + assert(std::equal(vec.begin(), vec.end(), std::begin(arr), std::end(arr))); + } + + { + const long arr[] = {INT_MAX, 1L, 2L, 3L }; + std::vector vec(std::begin(arr), std::end(arr), std::allocator<long>()); + static_assert(std::is_same_v<decltype(vec)::value_type, long>, ""); + assert(vec.size() == 4); + assert(vec[0] == INT_MAX); + assert(vec[1] == 1L); + assert(vec[2] == 2L); + } + +// Test the implicit deduction guides + + { +// We don't expect this one to work. +// std::vector vec(std::allocator<int>()); // vector (allocator &) + } + + { + std::vector vec(1, A{}); // vector (size_type, T) + static_assert(std::is_same_v<decltype(vec)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<A>>, ""); + assert(vec.size() == 1); + } + + { + std::vector vec(1, A{}, test_allocator<A>()); // vector (size_type, T, allocator) + static_assert(std::is_same_v<decltype(vec)::value_type, A>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, test_allocator<A>>, ""); + assert(vec.size() == 1); + } + + { + std::vector vec{1U, 2U, 3U, 4U, 5U}; // vector(initializer-list) + static_assert(std::is_same_v<decltype(vec)::value_type, unsigned>, ""); + assert(vec.size() == 5); + assert(vec[2] == 3U); + } + + { + std::vector vec({1.0, 2.0, 3.0, 4.0}, test_allocator<double>()); // vector(initializer-list, allocator) + static_assert(std::is_same_v<decltype(vec)::value_type, double>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, test_allocator<double>>, ""); + assert(vec.size() == 4); + assert(vec[3] == 4.0); + } + + { + std::vector<long double> source; + std::vector vec(source); // vector(vector &) + static_assert(std::is_same_v<decltype(vec)::value_type, long double>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<long double>>, ""); + assert(vec.size() == 0); + } + + +// A couple of vector<bool> tests, too! + { + std::vector vec(3, true); // vector(initializer-list) + static_assert(std::is_same_v<decltype(vec)::value_type, bool>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<bool>>, ""); + assert(vec.size() == 3); + assert(vec[0] && vec[1] && vec[2]); + } + + { + std::vector<bool> source; + std::vector vec(source); // vector(vector &) + static_assert(std::is_same_v<decltype(vec)::value_type, bool>, ""); + static_assert(std::is_same_v<decltype(vec)::allocator_type, std::allocator<bool>>, ""); + assert(vec.size() == 0); + } +} diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp index cd50d54323490..6938aa679eba9 100644 --- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp @@ -15,10 +15,13 @@ #include <vector> #include <cassert> + +#include "test_macros.h" #include "MoveOnly.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" +#include "verbose_assert.h" int main() { @@ -98,4 +101,34 @@ int main() assert(*j == 3); assert(is_contiguous_container_asan_correct(c2)); } + { + test_alloc_base::clear(); + using Vect = std::vector<int, test_allocator<int> >; + Vect v(test_allocator<int>(42, 101)); + assert(test_alloc_base::count == 1); + assert(test_alloc_base::copied == 1); + assert(test_alloc_base::moved == 0); + { + const test_allocator<int>& a = v.get_allocator(); + assert(a.get_data() == 42); + assert(a.get_id() == 101); + } + assert(test_alloc_base::count == 1); + test_alloc_base::clear_ctor_counters(); + + Vect v2 = std::move(v); + assert(test_alloc_base::count == 2); + assert(test_alloc_base::copied == 0); + assert(test_alloc_base::moved == 1); + { + const test_allocator<int>& a = v.get_allocator(); + assert(a.get_id() == test_alloc_base::moved_value); + assert(a.get_data() == test_alloc_base::moved_value); + } + { + const test_allocator<int>& a = v2.get_allocator(); + assert(a.get_id() == 101); + assert(a.get_data() == 42); + } + } } diff --git a/test/std/containers/test_compare.h b/test/std/containers/test_compare.h index 35f4640f1cad6..32d831d40f4a4 100644 --- a/test/std/containers/test_compare.h +++ b/test/std/containers/test_compare.h @@ -37,8 +37,8 @@ public: template <class C> class non_const_compare { -// operator() deliberately not marked as 'const' - bool operator()(const C& x,const C&y) { return x < y; } +// operator() deliberately not marked as 'const' + bool operator()(const C& x, const C& y) { return x < y; } }; diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp index fe2b24707fb33..a191ad7036cc7 100644 --- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_const_lvalue.pass.cpp @@ -37,28 +37,29 @@ void do_insert_cv_test() assert(r.first->first == 2.5); assert(r.first->second == 2); - r = m.insert(VT(2.5, 3)); // test rvalue insertion works in C++03 + const VT v2(2.5, 3); + r = m.insert(v2); assert(!r.second); assert(m.size() == 1); assert(r.first->first == 2.5); assert(r.first->second == 2); - const VT v2(1.5, 1); - r = m.insert(v2); + const VT v3(1.5, 1); + r = m.insert(v3); assert(r.second); assert(m.size() == 2); assert(r.first->first == 1.5); assert(r.first->second == 1); - const VT v3(3.5, 3); - r = m.insert(v3); + const VT v4(3.5, 3); + r = m.insert(v4); assert(r.second); assert(m.size() == 3); assert(r.first->first == 3.5); assert(r.first->second == 3); - const VT v4(3.5, 4); - r = m.insert(v4); + const VT v5(3.5, 4); + r = m.insert(v5); assert(!r.second); assert(m.size() == 3); assert(r.first->first == 3.5); diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp index d40a8a61a3d42..5c653ee8fb344 100644 --- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.pass.cpp @@ -24,61 +24,48 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_hint_const_lvalue_test() { - { - typedef std::unordered_map<double, int> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + typename C::const_iterator e = c.end(); + const VT v1(3.5, 3); + R r = c.insert(e, v1); + assert(c.size() == 1); + assert(r->first == 3.5); + assert(r->second == 3); - r = c.insert(c.end(), P(3.5, 4)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); + const VT v2(3.5, 4); + r = c.insert(c.end(), v2); + assert(c.size() == 1); + assert(r->first == 3.5); + assert(r->second == 3); - r = c.insert(c.end(), P(4.5, 4)); - assert(c.size() == 2); - assert(r->first == 4.5); - assert(r->second == 4); + const VT v3(4.5, 4); + r = c.insert(c.end(), v3); + assert(c.size() == 2); + assert(r->first == 4.5); + assert(r->second == 4); - r = c.insert(c.end(), P(5.5, 4)); - assert(c.size() == 3); - assert(r->first == 5.5); - assert(r->second == 4); - } + const VT v4(5.5, 4); + r = c.insert(c.end(), v4); + assert(c.size() == 3); + assert(r->first == 5.5); + assert(r->second == 4); +} + +int main() +{ + do_insert_hint_const_lvalue_test<std::unordered_map<double, int> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_map<double, int, std::hash<double>, std::equal_to<double>, min_allocator<std::pair<const double, int>>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); - - r = c.insert(c.end(), P(3.5, 4)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); - - r = c.insert(c.end(), P(4.5, 4)); - assert(c.size() == 2); - assert(r->first == 4.5); - assert(r->second == 4); - r = c.insert(c.end(), P(5.5, 4)); - assert(c.size() == 3); - assert(r->first == 5.5); - assert(r->second == 4); + do_insert_hint_const_lvalue_test<C>(); } #endif #if _LIBCPP_DEBUG >= 1 diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp index 320fbc8fe2eaf..b87b7e372ff0c 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_const_lvalue.pass.cpp @@ -20,59 +20,46 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_const_lvalue_test() { - { - typedef std::unordered_multimap<double, int> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + const VT v1(3.5, 3); + R r = c.insert(v1); + assert(c.size() == 1); + assert(r->first == 3.5); + assert(r->second == 3); - r = c.insert(P(3.5, 4)); - assert(c.size() == 2); - assert(r->first == 3.5); - assert(r->second == 4); + const VT v2(3.5, 4); + r = c.insert(v2); + assert(c.size() == 2); + assert(r->first == 3.5); + assert(r->second == 4); - r = c.insert(P(4.5, 4)); - assert(c.size() == 3); - assert(r->first == 4.5); - assert(r->second == 4); + const VT v3(4.5, 4); + r = c.insert(v3); + assert(c.size() == 3); + assert(r->first == 4.5); + assert(r->second == 4); - r = c.insert(P(5.5, 4)); - assert(c.size() == 4); - assert(r->first == 5.5); - assert(r->second == 4); - } + const VT v4(5.5, 4); + r = c.insert(v4); + assert(c.size() == 4); + assert(r->first == 5.5); + assert(r->second == 4); +} + +int main() +{ + do_insert_const_lvalue_test<std::unordered_multimap<double, int> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>, min_allocator<std::pair<const double, int>>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); - - r = c.insert(P(3.5, 4)); - assert(c.size() == 2); - assert(r->first == 3.5); - assert(r->second == 4); - - r = c.insert(P(4.5, 4)); - assert(c.size() == 3); - assert(r->first == 4.5); - assert(r->second == 4); - - r = c.insert(P(5.5, 4)); - assert(c.size() == 4); - assert(r->first == 5.5); - assert(r->second == 4); + do_insert_const_lvalue_test<C>(); } #endif } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp index c920ae93553fc..34cb1b293c8e6 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_hint_const_lvalue.pass.cpp @@ -24,61 +24,47 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_const_lvalue_test() { - { - typedef std::unordered_multimap<double, int> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + typename C::const_iterator e = c.end(); + const VT v1(3.5, 3); + R r = c.insert(e, v1); + assert(c.size() == 1); + assert(r->first == 3.5); + assert(r->second == 3); - r = c.insert(c.end(), P(3.5, 4)); - assert(c.size() == 2); - assert(r->first == 3.5); - assert(r->second == 4); + const VT v2(3.5, 4); + r = c.insert(c.end(), v2); + assert(c.size() == 2); + assert(r->first == 3.5); + assert(r->second == 4); - r = c.insert(c.end(), P(4.5, 4)); - assert(c.size() == 3); - assert(r->first == 4.5); - assert(r->second == 4); + const VT v3(4.5, 4); + r = c.insert(c.end(), v3); + assert(c.size() == 3); + assert(r->first == 4.5); + assert(r->second == 4); - r = c.insert(c.end(), P(5.5, 4)); - assert(c.size() == 4); - assert(r->first == 5.5); - assert(r->second == 4); - } + const VT v4(5.5, 4); + r = c.insert(c.end(), v4); + assert(c.size() == 4); + assert(r->first == 5.5); + assert(r->second == 4); +} + +int main() +{ + do_insert_const_lvalue_test<std::unordered_multimap<double, int> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_multimap<double, int, std::hash<double>, std::equal_to<double>, min_allocator<std::pair<const double, int>>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5, 3)); - assert(c.size() == 1); - assert(r->first == 3.5); - assert(r->second == 3); - - r = c.insert(c.end(), P(3.5, 4)); - assert(c.size() == 2); - assert(r->first == 3.5); - assert(r->second == 4); - - r = c.insert(c.end(), P(4.5, 4)); - assert(c.size() == 3); - assert(r->first == 4.5); - assert(r->second == 4); - - r = c.insert(c.end(), P(5.5, 4)); - assert(c.size() == 4); - assert(r->first == 5.5); - assert(r->second == 4); + do_insert_const_lvalue_test<C>(); } #endif #if _LIBCPP_DEBUG >= 1 diff --git a/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp index 946858ea53dc7..414e8fa48781b 100644 --- a/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.multiset/insert_const_lvalue.pass.cpp @@ -20,51 +20,41 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_const_lvalue_test() { - { - typedef std::unordered_multiset<double> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(P(3.5)); - assert(c.size() == 2); - assert(*r == 3.5); - - r = c.insert(P(4.5)); - assert(c.size() == 3); - assert(*r == 4.5); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + const VT v1(3.5); + R r = c.insert(v1); + assert(c.size() == 1); + assert(*r == 3.5); + + r = c.insert(v1); + assert(c.size() == 2); + assert(*r == 3.5); + + const VT v2(4.5); + r = c.insert(v2); + assert(c.size() == 3); + assert(*r == 4.5); + + const VT v3(5.5); + r = c.insert(v3); + assert(c.size() == 4); + assert(*r == 5.5); +} - r = c.insert(P(5.5)); - assert(c.size() == 4); - assert(*r == 5.5); - } +int main() +{ + do_insert_const_lvalue_test<std::unordered_multiset<double> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_multiset<double, std::hash<double>, - std::equal_to<double>, min_allocator<double>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(P(3.5)); - assert(c.size() == 2); - assert(*r == 3.5); - - r = c.insert(P(4.5)); - assert(c.size() == 3); - assert(*r == 4.5); - - r = c.insert(P(5.5)); - assert(c.size() == 4); - assert(*r == 5.5); + std::equal_to<double>, min_allocator<double>> C; + do_insert_const_lvalue_test<C>(); } #endif } diff --git a/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp index a6ab26659b556..8ce6a5efbc1e4 100644 --- a/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.multiset/insert_hint_const_lvalue.pass.cpp @@ -24,53 +24,42 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_hint_const_lvalue_test() { - { - typedef std::unordered_multiset<double> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + typename C::const_iterator e = c.end(); + const VT v1(3.5); + R r = c.insert(e, v1); + assert(c.size() == 1); + assert(*r == 3.5); - r = c.insert(c.end(), P(3.5)); - assert(c.size() == 2); - assert(*r == 3.5); + r = c.insert(c.end(), v1); + assert(c.size() == 2); + assert(*r == 3.5); - r = c.insert(c.end(), P(4.5)); - assert(c.size() == 3); - assert(*r == 4.5); + const VT v2(4.5); + r = c.insert(c.end(), v2); + assert(c.size() == 3); + assert(*r == 4.5); - r = c.insert(c.end(), P(5.5)); - assert(c.size() == 4); - assert(*r == 5.5); - } + const VT v3(5.5); + r = c.insert(c.end(), v3); + assert(c.size() == 4); + assert(*r == 5.5); +} + +int main() +{ + do_insert_hint_const_lvalue_test<std::unordered_multiset<double> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_multiset<double, std::hash<double>, - std::equal_to<double>, min_allocator<double>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(c.end(), P(3.5)); - assert(c.size() == 2); - assert(*r == 3.5); - - r = c.insert(c.end(), P(4.5)); - assert(c.size() == 3); - assert(*r == 4.5); - - r = c.insert(c.end(), P(5.5)); - assert(c.size() == 4); - assert(*r == 5.5); + std::equal_to<double>, min_allocator<double>> C; + do_insert_hint_const_lvalue_test<C>(); } #endif #if _LIBCPP_DEBUG >= 1 diff --git a/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp index fe45b98a33a61..712176ede592d 100644 --- a/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.set/insert_const_lvalue.pass.cpp @@ -20,59 +20,45 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_const_lvalue_test() { - { - typedef std::unordered_set<double> C; - typedef std::pair<C::iterator, bool> R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r.first == 3.5); - assert(r.second); + typedef Container C; + typedef std::pair<typename C::iterator, bool> R; + typedef typename C::value_type VT; + C c; + const VT v1(3.5); + R r = c.insert(v1); + assert(c.size() == 1); + assert(*r.first == 3.5); + assert(r.second); - r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r.first == 3.5); - assert(!r.second); + r = c.insert(v1); + assert(c.size() == 1); + assert(*r.first == 3.5); + assert(!r.second); - r = c.insert(P(4.5)); - assert(c.size() == 2); - assert(*r.first == 4.5); - assert(r.second); + const VT v2(4.5); + r = c.insert(v2); + assert(c.size() == 2); + assert(*r.first == 4.5); + assert(r.second); - r = c.insert(P(5.5)); - assert(c.size() == 3); - assert(*r.first == 5.5); - assert(r.second); - } + const VT v3(5.5); + r = c.insert(v3); + assert(c.size() == 3); + assert(*r.first == 5.5); + assert(r.second); +} + +int main() +{ + do_insert_const_lvalue_test<std::unordered_set<double> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_set<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; - typedef std::pair<C::iterator, bool> R; - typedef C::value_type P; - C c; - R r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r.first == 3.5); - assert(r.second); - - r = c.insert(P(3.5)); - assert(c.size() == 1); - assert(*r.first == 3.5); - assert(!r.second); - - r = c.insert(P(4.5)); - assert(c.size() == 2); - assert(*r.first == 4.5); - assert(r.second); - - r = c.insert(P(5.5)); - assert(c.size() == 3); - assert(*r.first == 5.5); - assert(r.second); + do_insert_const_lvalue_test<C>(); } #endif } diff --git a/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp index d3bbecc95ad77..50f0f6bc8477a 100644 --- a/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp +++ b/test/std/containers/unord/unord.set/insert_hint_const_lvalue.pass.cpp @@ -24,53 +24,42 @@ #include "min_allocator.h" -int main() +template<class Container> +void do_insert_hint_const_lvalue_test() { - { - typedef std::unordered_set<double> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); + typedef Container C; + typedef typename C::iterator R; + typedef typename C::value_type VT; + C c; + typename C::const_iterator e = c.end(); + const VT v1(3.5); + R r = c.insert(e, v1); + assert(c.size() == 1); + assert(*r == 3.5); - r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); + r = c.insert(e, v1); + assert(c.size() == 1); + assert(*r == 3.5); - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); + const VT v2(4.5); + r = c.insert(e, v2); + assert(c.size() == 2); + assert(*r == 4.5); - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); - } + const VT v3(5.5); + r = c.insert(e, v3); + assert(c.size() == 3); + assert(*r == 5.5); +} + +int main() +{ + do_insert_hint_const_lvalue_test<std::unordered_set<double> >(); #if TEST_STD_VER >= 11 { typedef std::unordered_set<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C::const_iterator e = c.end(); - R r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(3.5)); - assert(c.size() == 1); - assert(*r == 3.5); - - r = c.insert(e, P(4.5)); - assert(c.size() == 2); - assert(*r == 4.5); - - r = c.insert(e, P(5.5)); - assert(c.size() == 3); - assert(*r == 5.5); + do_insert_hint_const_lvalue_test<C>(); } #endif #if _LIBCPP_DEBUG >= 1 diff --git a/test/std/containers/views/span.comparison/op.eq.pass.cpp b/test/std/containers/views/span.comparison/op.eq.pass.cpp new file mode 100644 index 0000000000000..963054580466a --- /dev/null +++ b/test/std/containers/views/span.comparison/op.eq.pass.cpp @@ -0,0 +1,168 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator==(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: return equal(l.begin(), l.end(), r.begin(), r.end()); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert( (csp0d == csp0d), ""); + static_assert( (csp0s == csp0s), ""); + static_assert( (csp0s == csp0d), ""); + static_assert( (csp0d == csp0s), ""); + + static_assert(!(csp0d == csp1d), ""); + static_assert(!(csp0s == csp1s), ""); + static_assert(!(csp0s == csp1d), ""); + static_assert(!(csp0d == csp1s), ""); + + static_assert( (csp1d == csp1s), ""); + static_assert( (csp1s == csp1d), ""); + + static_assert( (csp2d == csp3d), ""); + static_assert( (csp2s == csp3s), ""); + static_assert( (csp2d == csp3s), ""); + static_assert( (csp2s == csp3d), ""); + + static_assert( (csp2d == csp3d), ""); + static_assert( (csp2s == csp3s), ""); + static_assert( (csp2d == csp3s), ""); + static_assert( (csp2s == csp3d), ""); + + static_assert(!(csp2d == csp4d), ""); + static_assert(!(csp2s == csp4s), ""); + static_assert(!(csp2d == csp4s), ""); + static_assert(!(csp2s == csp4d), ""); + + static_assert(!(csp4d == csp2d), ""); + static_assert(!(csp4s == csp2s), ""); + static_assert(!(csp4d == csp2s), ""); + static_assert(!(csp4s == csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert( (sp0d == sp0d)); + assert( (sp0s == sp0s)); + assert( (sp0s == sp0d)); + assert( (sp0d == sp0s)); + + assert(!(sp0d == sp1d)); + assert(!(sp0s == sp1s)); + assert(!(sp0s == sp1d)); + assert(!(sp0d == sp1s)); + + assert( (sp1d == sp1s)); + assert( (sp1s == sp1d)); + + assert( (sp2d == sp3d)); + assert( (sp2s == sp3s)); + assert( (sp2d == sp3s)); + assert( (sp2s == sp3d)); + + assert( (sp2d == sp3d)); + assert( (sp2s == sp3s)); + assert( (sp2d == sp3s)); + assert( (sp2s == sp3d)); + + assert(!(sp2d == sp4d)); + assert(!(sp2s == sp4s)); + assert(!(sp2d == sp4s)); + assert(!(sp2s == sp4d)); + + assert(!(sp4d == sp2d)); + assert(!(sp4s == sp2s)); + assert(!(sp4d == sp2s)); + assert(!(sp4s == sp2d)); + +// cross type comparisons + assert( (csp0d == sp0d)); + assert( (csp0s == sp0s)); + assert( (csp0s == sp0d)); + assert( (csp0d == sp0s)); + + assert(!(csp0d == sp1d)); + assert(!(csp0s == sp1s)); + assert(!(csp0s == sp1d)); + assert(!(csp0d == sp1s)); + + assert( (csp1d == sp1s)); + assert( (csp1s == sp1d)); + + assert( (csp2d == sp3d)); + assert( (csp2s == sp3s)); + assert( (csp2d == sp3s)); + assert( (csp2s == sp3d)); + + assert( (csp2d == sp3d)); + assert( (csp2s == sp3s)); + assert( (csp2d == sp3s)); + assert( (csp2s == sp3d)); + + assert(!(csp2d == sp4d)); + assert(!(csp2s == sp4s)); + assert(!(csp2d == sp4s)); + assert(!(csp2s == sp4d)); + + assert(!(csp4d == sp2d)); + assert(!(csp4s == sp2s)); + assert(!(csp4d == sp2s)); + assert(!(csp4s == sp2d)); + +// More cross-type comparisons (int vs float) + static_assert(std::span<const float>{fArr1} == std::span<const int>{iArr1}, ""); + static_assert(std::span<const int>{iArr1} == std::span<const float>{fArr1}, ""); + assert(std::span<float>{fArr2} == std::span<int>{iArr2}); + assert(std::span<int>{iArr2} == std::span<float>{fArr2}); + + static_assert(!(std::span<const int>{iArr1, 9} == std::span<const float>{fArr1, 8}), ""); +}
\ No newline at end of file diff --git a/test/std/containers/views/span.comparison/op.ge.pass.cpp b/test/std/containers/views/span.comparison/op.ge.pass.cpp new file mode 100644 index 0000000000000..8ec1b9a590eba --- /dev/null +++ b/test/std/containers/views/span.comparison/op.ge.pass.cpp @@ -0,0 +1,153 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator>=(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: return !(l < r); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert( (csp0d >= csp0d), ""); + static_assert( (csp0s >= csp0s), ""); + static_assert( (csp0s >= csp0d), ""); + static_assert( (csp0d >= csp0s), ""); + + static_assert(!(csp0d >= csp1d), ""); + static_assert(!(csp0s >= csp1s), ""); + static_assert(!(csp0s >= csp1d), ""); + static_assert(!(csp0d >= csp1s), ""); + + static_assert( (csp1d >= csp1s), ""); + static_assert( (csp1s >= csp1d), ""); + + static_assert( (csp2d >= csp3d), ""); + static_assert( (csp2s >= csp3s), ""); + static_assert( (csp2d >= csp3s), ""); + static_assert( (csp2s >= csp3d), ""); + + static_assert(!(csp2d >= csp4d), ""); + static_assert(!(csp2s >= csp4s), ""); + static_assert(!(csp2d >= csp4s), ""); + static_assert(!(csp2s >= csp4d), ""); + + static_assert( (csp4d >= csp2d), ""); + static_assert( (csp4s >= csp2s), ""); + static_assert( (csp4d >= csp2s), ""); + static_assert( (csp4s >= csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert( (sp0d >= sp0d)); + assert( (sp0s >= sp0s)); + assert( (sp0s >= sp0d)); + assert( (sp0d >= sp0s)); + + assert(!(sp0d >= sp1d)); + assert(!(sp0s >= sp1s)); + assert(!(sp0s >= sp1d)); + assert(!(sp0d >= sp1s)); + + assert( (sp1d >= sp1s)); + assert( (sp1s >= sp1d)); + + assert( (sp2d >= sp3d)); + assert( (sp2s >= sp3s)); + assert( (sp2d >= sp3s)); + assert( (sp2s >= sp3d)); + + assert(!(sp2d >= sp4d)); + assert(!(sp2s >= sp4s)); + assert(!(sp2d >= sp4s)); + assert(!(sp2s >= sp4d)); + + assert( (sp4d > sp2d)); + assert( (sp4s > sp2s)); + assert( (sp4d > sp2s)); + assert( (sp4s > sp2d)); + +// cross type comparisons + assert( (csp0d >= sp0d)); + assert( (csp0s >= sp0s)); + assert( (csp0s >= sp0d)); + assert( (csp0d >= sp0s)); + + assert(!(csp0d >= sp1d)); + assert(!(csp0s >= sp1s)); + assert(!(csp0s >= sp1d)); + assert(!(csp0d >= sp1s)); + + assert( (csp1d >= sp1s)); + assert( (csp1s >= sp1d)); + + assert( (csp2d >= sp3d)); + assert( (csp2s >= sp3s)); + assert( (csp2d >= sp3s)); + assert( (csp2s >= sp3d)); + + assert(!(csp2d >= sp4d)); + assert(!(csp2s >= sp4s)); + assert(!(csp2d >= sp4s)); + assert(!(csp2s >= sp4d)); + + assert( (csp4d > sp2d)); + assert( (csp4s > sp2s)); + assert( (csp4d > sp2s)); + assert( (csp4s > sp2d)); + +// More cross-type comparisons (int vs float) + static_assert(!(std::span<const float>{fArr1, 8} >= std::span<const int>{iArr1, 9}), ""); + static_assert(!(std::span<const int>{iArr1, 8} >= std::span<const float>{fArr1, 9}), ""); + assert( (std::span<float>{fArr2} >= std::span<int>{iArr2})); + assert( (std::span<int>{iArr2} >= std::span<float>{fArr2})); + + static_assert( (std::span<const int>{iArr1, 9} >= std::span<const float>{fArr1, 8}), ""); +} diff --git a/test/std/containers/views/span.comparison/op.gt.pass.cpp b/test/std/containers/views/span.comparison/op.gt.pass.cpp new file mode 100644 index 0000000000000..345a291a62b32 --- /dev/null +++ b/test/std/containers/views/span.comparison/op.gt.pass.cpp @@ -0,0 +1,154 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator>(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: return (r < l); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert(!(csp0d > csp0d), ""); + static_assert(!(csp0s > csp0s), ""); + static_assert(!(csp0s > csp0d), ""); + static_assert(!(csp0d > csp0s), ""); + + static_assert(!(csp0d > csp1d), ""); + static_assert(!(csp0s > csp1s), ""); + static_assert(!(csp0s > csp1d), ""); + static_assert(!(csp0d > csp1s), ""); + + static_assert(!(csp1d > csp1s), ""); + static_assert(!(csp1s > csp1d), ""); + + static_assert(!(csp2d > csp3d), ""); + static_assert(!(csp2s > csp3s), ""); + static_assert(!(csp2d > csp3s), ""); + static_assert(!(csp2s > csp3d), ""); + + static_assert(!(csp2d > csp4d), ""); + static_assert(!(csp2s > csp4s), ""); + static_assert(!(csp2d > csp4s), ""); + static_assert(!(csp2s > csp4d), ""); + + static_assert( (csp4d > csp2d), ""); + static_assert( (csp4s > csp2s), ""); + static_assert( (csp4d > csp2s), ""); + static_assert( (csp4s > csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert(!(sp0d > sp0d)); + assert(!(sp0s > sp0s)); + assert(!(sp0s > sp0d)); + assert(!(sp0d > sp0s)); + + assert(!(sp0d > sp1d)); + assert(!(sp0s > sp1s)); + assert(!(sp0s > sp1d)); + assert(!(sp0d > sp1s)); + + assert(!(sp1d > sp1s)); + assert(!(sp1s > sp1d)); + + assert(!(sp2d > sp3d)); + assert(!(sp2s > sp3s)); + assert(!(sp2d > sp3s)); + assert(!(sp2s > sp3d)); + + assert(!(sp2d > sp4d)); + assert(!(sp2s > sp4s)); + assert(!(sp2d > sp4s)); + assert(!(sp2s > sp4d)); + + assert( (sp4d > sp2d)); + assert( (sp4s > sp2s)); + assert( (sp4d > sp2s)); + assert( (sp4s > sp2d)); + +// cross type comparisons + assert(!(csp0d > sp0d)); + assert(!(csp0s > sp0s)); + assert(!(csp0s > sp0d)); + assert(!(csp0d > sp0s)); + + assert(!(csp0d > sp1d)); + assert(!(csp0s > sp1s)); + assert(!(csp0s > sp1d)); + assert(!(csp0d > sp1s)); + + assert(!(csp1d > sp1s)); + assert(!(csp1s > sp1d)); + + assert(!(csp2d > sp3d)); + assert(!(csp2s > sp3s)); + assert(!(csp2d > sp3s)); + assert(!(csp2s > sp3d)); + + assert(!(csp2d > sp4d)); + assert(!(csp2s > sp4s)); + assert(!(csp2d > sp4s)); + assert(!(csp2s > sp4d)); + + assert( (csp4d > sp2d)); + assert( (csp4s > sp2s)); + assert( (csp4d > sp2s)); + assert( (csp4s > sp2d)); + + +// More cross-type comparisons (int vs float) + static_assert(!(std::span<const float>{fArr1, 8} > std::span<const int>{iArr1, 9}), ""); + static_assert(!(std::span<const int>{iArr1, 8} > std::span<const float>{fArr1, 9}), ""); + assert(!(std::span<float>{fArr2} > std::span<int>{iArr2})); + assert(!(std::span<int>{iArr2} > std::span<float>{fArr2})); + + static_assert( (std::span<const int>{iArr1, 9} > std::span<const float>{fArr1, 8}), ""); +}
\ No newline at end of file diff --git a/test/std/containers/views/span.comparison/op.le.pass.cpp b/test/std/containers/views/span.comparison/op.le.pass.cpp new file mode 100644 index 0000000000000..f2fbc86090829 --- /dev/null +++ b/test/std/containers/views/span.comparison/op.le.pass.cpp @@ -0,0 +1,153 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator<=(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: return !(r < l); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert( (csp0d <= csp0d), ""); + static_assert( (csp0s <= csp0s), ""); + static_assert( (csp0s <= csp0d), ""); + static_assert( (csp0d <= csp0s), ""); + + static_assert( (csp0d <= csp1d), ""); + static_assert( (csp0s <= csp1s), ""); + static_assert( (csp0s <= csp1d), ""); + static_assert( (csp0d <= csp1s), ""); + + static_assert( (csp1d <= csp1s), ""); + static_assert( (csp1s <= csp1d), ""); + + static_assert( (csp2d <= csp3d), ""); + static_assert( (csp2s <= csp3s), ""); + static_assert( (csp2d <= csp3s), ""); + static_assert( (csp2s <= csp3d), ""); + + static_assert( (csp2d <= csp4d), ""); + static_assert( (csp2s <= csp4s), ""); + static_assert( (csp2d <= csp4s), ""); + static_assert( (csp2s <= csp4d), ""); + + static_assert(!(csp4d <= csp2d), ""); + static_assert(!(csp4s <= csp2s), ""); + static_assert(!(csp4d <= csp2s), ""); + static_assert(!(csp4s <= csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert( (sp0d <= sp0d)); + assert( (sp0s <= sp0s)); + assert( (sp0s <= sp0d)); + assert( (sp0d <= sp0s)); + + assert( (sp0d <= sp1d)); + assert( (sp0s <= sp1s)); + assert( (sp0s <= sp1d)); + assert( (sp0d <= sp1s)); + + assert( (sp1d <= sp1s)); + assert( (sp1s <= sp1d)); + + assert( (sp2d <= sp3d)); + assert( (sp2s <= sp3s)); + assert( (sp2d <= sp3s)); + assert( (sp2s <= sp3d)); + + assert( (sp2d <= sp4d)); + assert( (sp2s <= sp4s)); + assert( (sp2d <= sp4s)); + assert( (sp2s <= sp4d)); + + assert(!(sp4d <= sp2d)); + assert(!(sp4s <= sp2s)); + assert(!(sp4d <= sp2s)); + assert(!(sp4s <= sp2d)); + +// cross type comparisons + assert( (csp0d <= sp0d)); + assert( (csp0s <= sp0s)); + assert( (csp0s <= sp0d)); + assert( (csp0d <= sp0s)); + + assert( (csp0d <= sp1d)); + assert( (csp0s <= sp1s)); + assert( (csp0s <= sp1d)); + assert( (csp0d <= sp1s)); + + assert( (csp1d <= sp1s)); + assert( (csp1s <= sp1d)); + + assert( (csp2d <= sp3d)); + assert( (csp2s <= sp3s)); + assert( (csp2d <= sp3s)); + assert( (csp2s <= sp3d)); + + assert( (csp2d <= sp4d)); + assert( (csp2s <= sp4s)); + assert( (csp2d <= sp4s)); + assert( (csp2s <= sp4d)); + + assert(!(csp4d <= sp2d)); + assert(!(csp4s <= sp2s)); + assert(!(csp4d <= sp2s)); + assert(!(csp4s <= sp2d)); + +// More cross-type comparisons (int vs float) + static_assert(std::span<const float>{fArr1, 8} <= std::span<const int>{iArr1, 9}, ""); + static_assert(std::span<const int>{iArr1, 8} <= std::span<const float>{fArr1, 9}, ""); + assert( (std::span<float>{fArr2} <= std::span<int>{iArr2})); + assert( (std::span<int>{iArr2} <= std::span<float>{fArr2})); + + static_assert(!(std::span<const int>{iArr1, 9} <= std::span<const float>{fArr1, 8}), ""); +}
\ No newline at end of file diff --git a/test/std/containers/views/span.comparison/op.lt.pass.cpp b/test/std/containers/views/span.comparison/op.lt.pass.cpp new file mode 100644 index 0000000000000..1a7de292e9011 --- /dev/null +++ b/test/std/containers/views/span.comparison/op.lt.pass.cpp @@ -0,0 +1,154 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator<(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: +// return lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert(!(csp0d < csp0d), ""); + static_assert(!(csp0s < csp0s), ""); + static_assert(!(csp0s < csp0d), ""); + static_assert(!(csp0d < csp0s), ""); + + static_assert( (csp0d < csp1d), ""); + static_assert( (csp0s < csp1s), ""); + static_assert( (csp0s < csp1d), ""); + static_assert( (csp0d < csp1s), ""); + + static_assert(!(csp1d < csp1s), ""); + static_assert(!(csp1s < csp1d), ""); + + static_assert(!(csp2d < csp3d), ""); + static_assert(!(csp2s < csp3s), ""); + static_assert(!(csp2d < csp3s), ""); + static_assert(!(csp2s < csp3d), ""); + + static_assert( (csp2d < csp4d), ""); + static_assert( (csp2s < csp4s), ""); + static_assert( (csp2d < csp4s), ""); + static_assert( (csp2s < csp4d), ""); + + static_assert(!(csp4d < csp2d), ""); + static_assert(!(csp4s < csp2s), ""); + static_assert(!(csp4d < csp2s), ""); + static_assert(!(csp4s < csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert(!(sp0d < sp0d)); + assert(!(sp0s < sp0s)); + assert(!(sp0s < sp0d)); + assert(!(sp0d < sp0s)); + + assert( (sp0d < sp1d)); + assert( (sp0s < sp1s)); + assert( (sp0s < sp1d)); + assert( (sp0d < sp1s)); + + assert(!(sp1d < sp1s)); + assert(!(sp1s < sp1d)); + + assert(!(sp2d < sp3d)); + assert(!(sp2s < sp3s)); + assert(!(sp2d < sp3s)); + assert(!(sp2s < sp3d)); + + assert( (sp2d < sp4d)); + assert( (sp2s < sp4s)); + assert( (sp2d < sp4s)); + assert( (sp2s < sp4d)); + + assert(!(sp4d < sp2d)); + assert(!(sp4s < sp2s)); + assert(!(sp4d < sp2s)); + assert(!(sp4s < sp2d)); + +// cross type comparisons + assert(!(csp0d < sp0d)); + assert(!(csp0s < sp0s)); + assert(!(csp0s < sp0d)); + assert(!(csp0d < sp0s)); + + assert( (csp0d < sp1d)); + assert( (csp0s < sp1s)); + assert( (csp0s < sp1d)); + assert( (csp0d < sp1s)); + + assert(!(csp1d < sp1s)); + assert(!(csp1s < sp1d)); + + assert(!(csp2d < sp3d)); + assert(!(csp2s < sp3s)); + assert(!(csp2d < sp3s)); + assert(!(csp2s < sp3d)); + + assert( (csp2d < sp4d)); + assert( (csp2s < sp4s)); + assert( (csp2d < sp4s)); + assert( (csp2s < sp4d)); + + assert(!(csp4d < sp2d)); + assert(!(csp4s < sp2s)); + assert(!(csp4d < sp2s)); + assert(!(csp4s < sp2d)); + +// More cross-type comparisons (int vs float) + static_assert(std::span<const float>{fArr1, 8} < std::span<const int>{iArr1, 9}, ""); + static_assert(std::span<const int>{iArr1, 8} < std::span<const float>{fArr1, 9}, ""); + assert(!(std::span<float>{fArr2} < std::span<int>{iArr2})); + assert(!(std::span<int>{iArr2} < std::span<float>{fArr2})); + + static_assert(!(std::span<const int>{iArr1, 9} < std::span<const float>{fArr1, 8}), ""); +}
\ No newline at end of file diff --git a/test/std/containers/views/span.comparison/op.ne.pass.cpp b/test/std/containers/views/span.comparison/op.ne.pass.cpp new file mode 100644 index 0000000000000..ecf05b3174912 --- /dev/null +++ b/test/std/containers/views/span.comparison/op.ne.pass.cpp @@ -0,0 +1,168 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, ptrdiff_t X, class U, ptrdiff_t Y> +// constexpr bool operator!=(span<T, X> l, span<U, Y> r); +// +// +// Effects: Equivalent to: return !(l == r); +// + +#include <span> +#include <cassert> + +#include "test_macros.h" + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; + int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9}; +constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.}; + + +int main () { + + constexpr std::span<const int> csp0d{}; + constexpr std::span<const int> csp1d{iArr1, 10}; + constexpr std::span<const int> csp2d{iArr1 + 3, 2}; + constexpr std::span<const int> csp3d{iArr1 + 1, 2}; + constexpr std::span<const int> csp4d{iArr1 + 6, 2}; + + constexpr std::span<const int, 0> csp0s{}; + constexpr std::span<const int, 10> csp1s{iArr1, 10}; + constexpr std::span<const int, 2> csp2s{iArr1 + 3, 2}; + constexpr std::span<const int, 2> csp3s{iArr1 + 1, 2}; + constexpr std::span<const int, 2> csp4s{iArr1 + 6, 2}; + + static_assert(!(csp0d != csp0d), ""); + static_assert(!(csp0s != csp0s), ""); + static_assert(!(csp0s != csp0d), ""); + static_assert(!(csp0d != csp0s), ""); + + static_assert( (csp0d != csp1d), ""); + static_assert( (csp0s != csp1s), ""); + static_assert( (csp0s != csp1d), ""); + static_assert( (csp0d != csp1s), ""); + + static_assert(!(csp1d != csp1s), ""); + static_assert(!(csp1s != csp1d), ""); + + static_assert(!(csp2d != csp3d), ""); + static_assert(!(csp2s != csp3s), ""); + static_assert(!(csp2d != csp3s), ""); + static_assert(!(csp2s != csp3d), ""); + + static_assert(!(csp2d != csp3d), ""); + static_assert(!(csp2s != csp3s), ""); + static_assert(!(csp2d != csp3s), ""); + static_assert(!(csp2s != csp3d), ""); + + static_assert( (csp2d != csp4d), ""); + static_assert( (csp2s != csp4s), ""); + static_assert( (csp2d != csp4s), ""); + static_assert( (csp2s != csp4d), ""); + + static_assert( (csp4d != csp2d), ""); + static_assert( (csp4s != csp2s), ""); + static_assert( (csp4d != csp2s), ""); + static_assert( (csp4s != csp2d), ""); + + std::span<int> sp0d{}; + std::span<int> sp1d{iArr2, 10}; + std::span<int> sp2d{iArr2 + 3, 2}; + std::span<int> sp3d{iArr2 + 1, 2}; + std::span<int> sp4d{iArr2 + 6, 2}; + + std::span<int, 0> sp0s{}; + std::span<int, 10> sp1s{iArr2, 10}; + std::span<int, 2> sp2s{iArr2 + 3, 2}; + std::span<int, 2> sp3s{iArr2 + 1, 2}; + std::span<int, 2> sp4s{iArr2 + 6, 2}; + + assert(!(sp0d != sp0d)); + assert(!(sp0s != sp0s)); + assert(!(sp0s != sp0d)); + assert(!(sp0d != sp0s)); + + assert( (sp0d != sp1d)); + assert( (sp0s != sp1s)); + assert( (sp0s != sp1d)); + assert( (sp0d != sp1s)); + + assert(!(sp1d != sp1s)); + assert(!(sp1s != sp1d)); + + assert(!(sp2d != sp3d)); + assert(!(sp2s != sp3s)); + assert(!(sp2d != sp3s)); + assert(!(sp2s != sp3d)); + + assert(!(sp2d != sp3d)); + assert(!(sp2s != sp3s)); + assert(!(sp2d != sp3s)); + assert(!(sp2s != sp3d)); + + assert( (sp2d != sp4d)); + assert( (sp2s != sp4s)); + assert( (sp2d != sp4s)); + assert( (sp2s != sp4d)); + + assert( (sp4d != sp2d)); + assert( (sp4s != sp2s)); + assert( (sp4d != sp2s)); + assert( (sp4s != sp2d)); + +// cross type comparisons + assert(!(csp0d != sp0d)); + assert(!(csp0s != sp0s)); + assert(!(csp0s != sp0d)); + assert(!(csp0d != sp0s)); + + assert( (csp0d != sp1d)); + assert( (csp0s != sp1s)); + assert( (csp0s != sp1d)); + assert( (csp0d != sp1s)); + + assert(!(csp1d != sp1s)); + assert(!(csp1s != sp1d)); + + assert(!(csp2d != sp3d)); + assert(!(csp2s != sp3s)); + assert(!(csp2d != sp3s)); + assert(!(csp2s != sp3d)); + + assert(!(csp2d != sp3d)); + assert(!(csp2s != sp3s)); + assert(!(csp2d != sp3s)); + assert(!(csp2s != sp3d)); + + assert( (csp2d != sp4d)); + assert( (csp2s != sp4s)); + assert( (csp2d != sp4s)); + assert( (csp2s != sp4d)); + + assert( (csp4d != sp2d)); + assert( (csp4s != sp2s)); + assert( (csp4d != sp2s)); + assert( (csp4s != sp2d)); + +// More cross-type comparisons (int vs float) + static_assert(!(std::span<const float>{fArr1} != std::span<const int>{iArr1}), ""); + static_assert(!(std::span<const int>{iArr1} != std::span<const float>{fArr1}), ""); + assert(!(std::span<float>{fArr2} != std::span<int>{iArr2})); + assert(!(std::span<int>{iArr2} != std::span<float>{fArr2})); + + static_assert( (std::span<const int>{iArr1, 9} != std::span<const float>{fArr1, 8}), ""); +}
\ No newline at end of file diff --git a/test/std/containers/views/span.cons/array.fail.cpp b/test/std/containers/views/span.cons/array.fail.cpp new file mode 100644 index 0000000000000..7ef49fc470891 --- /dev/null +++ b/test/std/containers/views/span.cons/array.fail.cpp @@ -0,0 +1,72 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<size_t N> +// constexpr span(element_type (&arr)[N]) noexcept; +// template<size_t N> +// constexpr span(array<value_type, N>& arr) noexcept; +// template<size_t N> +// constexpr span(const array<value_type, N>& arr) noexcept; +// +// Remarks: These constructors shall not participate in overload resolution unless: +// — extent == dynamic_extent || N == extent is true, and +// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[]. +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + int arr[] = {1,2,3}; +const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; +const volatile int cvarr[] = {1,3,5}; + +int main () +{ +// Size wrong + { + std::span<int, 2> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}} + } + +// Type wrong + { + std::span<float> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float, 3> s2(arr); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}} + } + +// CV wrong (dynamically sized) + { + std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<const int> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span< volatile int> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// CV wrong (statically sized) + { + std::span< int,3> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span<const int,3> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span<const int,3> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span< volatile int,3> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + std::span< volatile int,3> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + } +} diff --git a/test/std/containers/views/span.cons/array.pass.cpp b/test/std/containers/views/span.cons/array.pass.cpp new file mode 100644 index 0000000000000..80a0f07f62522 --- /dev/null +++ b/test/std/containers/views/span.cons/array.pass.cpp @@ -0,0 +1,123 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<size_t N> +// constexpr span(element_type (&arr)[N]) noexcept; +// +// Remarks: These constructors shall not participate in overload resolution unless: +// — extent == dynamic_extent || N == extent is true, and +// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[]. +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + +void checkCV() +{ + int arr[] = {1,2,3}; + const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; + const volatile int cvarr[] = {1,3,5}; + +// Types the same (dynamic sized) + { + std::span< int> s1{ arr}; // a span< int> pointing at int. + std::span<const int> s2{ carr}; // a span<const int> pointing at const int. + std::span< volatile int> s3{ varr}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int> s4{cvarr}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + +// Types the same (static sized) + { + std::span< int,3> s1{ arr}; // a span< int> pointing at int. + std::span<const int,3> s2{ carr}; // a span<const int> pointing at const int. + std::span< volatile int,3> s3{ varr}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int,3> s4{cvarr}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + + +// types different (dynamic sized) + { + std::span<const int> s1{ arr}; // a span<const int> pointing at int. + std::span< volatile int> s2{ arr}; // a span< volatile int> pointing at int. + std::span< volatile int> s3{ arr}; // a span< volatile int> pointing at const int. + std::span<const volatile int> s4{ arr}; // a span<const volatile int> pointing at int. + std::span<const volatile int> s5{carr}; // a span<const volatile int> pointing at const int. + std::span<const volatile int> s6{varr}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } + +// types different (static sized) + { + std::span<const int,3> s1{ arr}; // a span<const int> pointing at int. + std::span< volatile int,3> s2{ arr}; // a span< volatile int> pointing at int. + std::span< volatile int,3> s3{ arr}; // a span< volatile int> pointing at const int. + std::span<const volatile int,3> s4{ arr}; // a span<const volatile int> pointing at int. + std::span<const volatile int,3> s5{carr}; // a span<const volatile int> pointing at const int. + std::span<const volatile int,3> s6{varr}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + constexpr T val[2] = {}; + + ASSERT_NOEXCEPT(std::span<const T> {val}); + ASSERT_NOEXCEPT(std::span<const T, 2>{val}); + std::span<const T> s1{val}; + std::span<const T, 2> s2{val}; + return + s1.data() == &val[0] && s1.size() == 2 + && s2.data() == &val[0] && s2.size() == 2; +} + + +template <typename T> +void testRuntimeSpan() +{ + T val[2] = {}; + ASSERT_NOEXCEPT(std::span<T> {val}); + ASSERT_NOEXCEPT(std::span<T, 2>{val}); + std::span<T> s1{val}; + std::span<T, 2> s2{val}; + assert(s1.data() == &val[0] && s1.size() == 2); + assert(s2.data() == &val[0] && s2.size() == 2); +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/assign.pass.cpp b/test/std/containers/views/span.cons/assign.pass.cpp new file mode 100644 index 0000000000000..b5bd7ae00dfcb --- /dev/null +++ b/test/std/containers/views/span.cons/assign.pass.cpp @@ -0,0 +1,293 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span& operator=(const span& other) noexcept = default; + +#include <span> +#include <cassert> +#include <string> +#include <utility> + +#include "test_macros.h" + +template <typename T> +constexpr bool doAssign(T lhs, T rhs) +{ + ASSERT_NOEXCEPT(std::declval<T&>() = rhs); + lhs = rhs; + return lhs.data() == rhs.data() + && lhs.size() == rhs.size(); +} + +struct A{}; + +constexpr int carr1[] = {1,2,3,4}; +constexpr int carr2[] = {3,4,5}; +constexpr int carr3[] = {7,8}; + int arr[] = {5,6,7,9}; +std::string strs[] = {"ABC", "DEF", "GHI"}; + + +int main () +{ + +// constexpr dynamically sized assignment + { +// On systems where 'ptrdiff_t' is a synonym for 'int', +// the call span(ptr, 0) selects the (pointer, index_type) constructor. +// On systems where 'ptrdiff_t' is NOT a synonym for 'int', +// it is ambiguous, because of 0 also being convertible to a null pointer +// and so the compiler can't choose between: +// span(pointer, index_type) +// and span(pointer, pointer) +// We cast zero to std::ptrdiff_t to remove that ambiguity. +// Example: +// On darwin x86_64, ptrdiff_t is the same as long int. +// On darwin i386, ptrdiff_t is the same as int. + constexpr std::span<const int> spans[] = { + {}, + {carr1, static_cast<std::ptrdiff_t>(0)}, + {carr1, 1}, + {carr1, 2}, + {carr1, 3}, + {carr1, 4}, + {carr2, static_cast<std::ptrdiff_t>(0)}, + {carr2, 1}, + {carr2, 2}, + {carr2, 3}, + {carr3, static_cast<std::ptrdiff_t>(0)}, + {carr3, 1}, + {carr3, 2} + }; + + static_assert(std::size(spans) == 13, "" ); + +// No for loops in constexpr land :-( + static_assert(doAssign(spans[0], spans[0]), ""); + static_assert(doAssign(spans[0], spans[1]), ""); + static_assert(doAssign(spans[0], spans[2]), ""); + static_assert(doAssign(spans[0], spans[3]), ""); + static_assert(doAssign(spans[0], spans[4]), ""); + static_assert(doAssign(spans[0], spans[5]), ""); + static_assert(doAssign(spans[0], spans[6]), ""); + static_assert(doAssign(spans[0], spans[7]), ""); + static_assert(doAssign(spans[0], spans[8]), ""); + static_assert(doAssign(spans[0], spans[9]), ""); + static_assert(doAssign(spans[0], spans[10]), ""); + static_assert(doAssign(spans[0], spans[11]), ""); + static_assert(doAssign(spans[0], spans[12]), ""); + + static_assert(doAssign(spans[1], spans[1]), ""); + static_assert(doAssign(spans[1], spans[2]), ""); + static_assert(doAssign(spans[1], spans[3]), ""); + static_assert(doAssign(spans[1], spans[4]), ""); + static_assert(doAssign(spans[1], spans[5]), ""); + static_assert(doAssign(spans[1], spans[6]), ""); + static_assert(doAssign(spans[1], spans[7]), ""); + static_assert(doAssign(spans[1], spans[8]), ""); + static_assert(doAssign(spans[1], spans[9]), ""); + static_assert(doAssign(spans[1], spans[10]), ""); + static_assert(doAssign(spans[1], spans[11]), ""); + static_assert(doAssign(spans[1], spans[12]), ""); + + static_assert(doAssign(spans[2], spans[2]), ""); + static_assert(doAssign(spans[2], spans[3]), ""); + static_assert(doAssign(spans[2], spans[4]), ""); + static_assert(doAssign(spans[2], spans[5]), ""); + static_assert(doAssign(spans[2], spans[6]), ""); + static_assert(doAssign(spans[2], spans[7]), ""); + static_assert(doAssign(spans[2], spans[8]), ""); + static_assert(doAssign(spans[2], spans[9]), ""); + static_assert(doAssign(spans[2], spans[10]), ""); + static_assert(doAssign(spans[2], spans[11]), ""); + static_assert(doAssign(spans[2], spans[12]), ""); + + static_assert(doAssign(spans[3], spans[3]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[10]), ""); + static_assert(doAssign(spans[3], spans[11]), ""); + static_assert(doAssign(spans[3], spans[12]), ""); + + static_assert(doAssign(spans[4], spans[4]), ""); + static_assert(doAssign(spans[4], spans[5]), ""); + static_assert(doAssign(spans[4], spans[6]), ""); + static_assert(doAssign(spans[4], spans[7]), ""); + static_assert(doAssign(spans[4], spans[8]), ""); + static_assert(doAssign(spans[4], spans[9]), ""); + static_assert(doAssign(spans[4], spans[10]), ""); + static_assert(doAssign(spans[4], spans[11]), ""); + static_assert(doAssign(spans[4], spans[12]), ""); + + static_assert(doAssign(spans[5], spans[5]), ""); + static_assert(doAssign(spans[5], spans[6]), ""); + static_assert(doAssign(spans[5], spans[7]), ""); + static_assert(doAssign(spans[5], spans[8]), ""); + static_assert(doAssign(spans[5], spans[9]), ""); + static_assert(doAssign(spans[5], spans[10]), ""); + static_assert(doAssign(spans[5], spans[11]), ""); + static_assert(doAssign(spans[5], spans[12]), ""); + + static_assert(doAssign(spans[6], spans[6]), ""); + static_assert(doAssign(spans[6], spans[7]), ""); + static_assert(doAssign(spans[6], spans[8]), ""); + static_assert(doAssign(spans[6], spans[9]), ""); + static_assert(doAssign(spans[6], spans[10]), ""); + static_assert(doAssign(spans[6], spans[11]), ""); + static_assert(doAssign(spans[6], spans[12]), ""); + + static_assert(doAssign(spans[7], spans[7]), ""); + static_assert(doAssign(spans[7], spans[8]), ""); + static_assert(doAssign(spans[7], spans[9]), ""); + static_assert(doAssign(spans[7], spans[10]), ""); + static_assert(doAssign(spans[7], spans[11]), ""); + static_assert(doAssign(spans[7], spans[12]), ""); + + static_assert(doAssign(spans[8], spans[8]), ""); + static_assert(doAssign(spans[8], spans[9]), ""); + static_assert(doAssign(spans[8], spans[10]), ""); + static_assert(doAssign(spans[8], spans[11]), ""); + static_assert(doAssign(spans[8], spans[12]), ""); + + static_assert(doAssign(spans[9], spans[9]), ""); + static_assert(doAssign(spans[9], spans[10]), ""); + static_assert(doAssign(spans[9], spans[11]), ""); + static_assert(doAssign(spans[9], spans[12]), ""); + + static_assert(doAssign(spans[10], spans[10]), ""); + static_assert(doAssign(spans[10], spans[11]), ""); + static_assert(doAssign(spans[10], spans[12]), ""); + + static_assert(doAssign(spans[11], spans[11]), ""); + static_assert(doAssign(spans[11], spans[12]), ""); + + static_assert(doAssign(spans[12], spans[12]), ""); + +// for (size_t i = 0; i < std::size(spans); ++i) +// for (size_t j = i; j < std::size(spans); ++j) +// static_assert(doAssign(spans[i], spans[j]), ""); + } + +// constexpr statically sized assignment + { + constexpr std::span<const int,2> spans[] = { + {carr1, 2}, + {carr1 + 1, 2}, + {carr1 + 2, 2}, + {carr2, 2}, + {carr2 + 1, 2}, + {carr3, 2} + }; + + static_assert(std::size(spans) == 6, "" ); + +// No for loops in constexpr land :-( + static_assert(doAssign(spans[0], spans[0]), ""); + static_assert(doAssign(spans[0], spans[1]), ""); + static_assert(doAssign(spans[0], spans[2]), ""); + static_assert(doAssign(spans[0], spans[3]), ""); + static_assert(doAssign(spans[0], spans[4]), ""); + static_assert(doAssign(spans[0], spans[5]), ""); + + static_assert(doAssign(spans[1], spans[1]), ""); + static_assert(doAssign(spans[1], spans[2]), ""); + static_assert(doAssign(spans[1], spans[3]), ""); + static_assert(doAssign(spans[1], spans[4]), ""); + static_assert(doAssign(spans[1], spans[5]), ""); + + static_assert(doAssign(spans[2], spans[2]), ""); + static_assert(doAssign(spans[2], spans[3]), ""); + static_assert(doAssign(spans[2], spans[4]), ""); + static_assert(doAssign(spans[2], spans[5]), ""); + + static_assert(doAssign(spans[3], spans[3]), ""); + static_assert(doAssign(spans[3], spans[4]), ""); + static_assert(doAssign(spans[3], spans[5]), ""); + + static_assert(doAssign(spans[4], spans[4]), ""); + static_assert(doAssign(spans[4], spans[5]), ""); + + static_assert(doAssign(spans[5], spans[5]), ""); + +// for (size_t i = 0; i < std::size(spans); ++i) +// for (size_t j = i; j < std::size(spans); ++j) +// static_assert(doAssign(spans[i], spans[j]), ""); + } + + +// dynamically sized assignment + { + std::span<int> spans[] = { + {}, + {arr, arr + 1}, + {arr, arr + 2}, + {arr, arr + 3}, + {arr + 1, arr + 3} // same size as s2 + }; + + for (size_t i = 0; i < std::size(spans); ++i) + for (size_t j = i; j < std::size(spans); ++j) + assert((doAssign(spans[i], spans[j]))); + } + +// statically sized assignment + { + std::span<int,2> spans[] = { + {arr, arr + 2}, + {arr + 1, arr + 3}, + {arr + 2, arr + 4} + }; + + for (size_t i = 0; i < std::size(spans); ++i) + for (size_t j = i; j < std::size(spans); ++j) + assert((doAssign(spans[i], spans[j]))); + } + +// dynamically sized assignment + { + std::span<std::string> spans[] = { + {strs, strs}, + {strs, strs + 1}, + {strs, strs + 2}, + {strs, strs + 3}, + {strs + 1, strs + 1}, + {strs + 1, strs + 2}, + {strs + 1, strs + 3}, + {strs + 2, strs + 2}, + {strs + 2, strs + 3}, + {strs + 3, strs + 3} + }; + + for (size_t i = 0; i < std::size(spans); ++i) + for (size_t j = i; j < std::size(spans); ++j) + assert((doAssign(spans[i], spans[j]))); + } + + { + std::span<std::string, 1> spans[] = { + {strs, strs + 1}, + {strs + 1, strs + 2}, + {strs + 2, strs + 3} + }; + + for (size_t i = 0; i < std::size(spans); ++i) + for (size_t j = i; j < std::size(spans); ++j) + assert((doAssign(spans[i], spans[j]))); + } +} diff --git a/test/std/containers/views/span.cons/container.fail.cpp b/test/std/containers/views/span.cons/container.fail.cpp new file mode 100644 index 0000000000000..ecd7fcb91b835 --- /dev/null +++ b/test/std/containers/views/span.cons/container.fail.cpp @@ -0,0 +1,117 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class Container> +// constexpr span(Container& cont); +// template<class Container> +// constexpr span(const Container& cont); +// +// Remarks: These constructors shall not participate in overload resolution unless: +// — Container is not a specialization of span, +// — Container is not a specialization of array, +// — is_array_v<Container> is false, +// — data(cont) and size(cont) are both well-formed, and +// — remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[]. +// + + +#include <span> +#include <cassert> +#include <list> +#include <forward_list> +#include <deque> + +#include "test_macros.h" + +// Look ma - I'm a container! +template <typename T> +struct IsAContainer { + constexpr IsAContainer() : v_{} {} + constexpr size_t size() const {return 1;} + constexpr T *data() {return &v_;} + constexpr const T *data() const {return &v_;} + + constexpr const T *getV() const {return &v_;} // for checking + T v_; +}; + +template <typename T> +struct NotAContainerNoData { + size_t size() const {return 0;} +}; + +template <typename T> +struct NotAContainerNoSize { + const T *data() const {return nullptr;} +}; + +template <typename T> +struct NotAContainerPrivate { +private: + size_t size() const {return 0;} + const T *data() const {return nullptr;} +}; + + +int main () +{ + +// Missing size and/or data + { + std::span<int> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span<int> s3{NotAContainerNoData<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s4{NotAContainerNoData<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span<int> s5{NotAContainerNoSize<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s6{NotAContainerNoSize<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span<int> s7{NotAContainerPrivate<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s8{NotAContainerPrivate<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + +// Again with the standard containers + std::span<int> s11{std::deque<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s12{std::deque<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span<int> s13{std::list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s14{std::list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span<int> s15{std::forward_list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<int, 0> s16{std::forward_list<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + } + +// Not the same type + { + std::span<float> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}} + } + +// CV wrong (dynamically sized) + { + std::span< int> s1{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<const int> s4{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span< volatile int> s6{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// CV wrong (statically sized) + { + std::span< int,1> s1{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}} + std::span< int,1> s2{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}} + std::span< int,1> s3{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<int, 1>'}} + std::span<const int,1> s4{IsAContainer< volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 1>'}} + std::span<const int,1> s5{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 1>'}} + std::span< volatile int,1> s6{IsAContainer<const int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 1>'}} + std::span< volatile int,1> s7{IsAContainer<const volatile int>()}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 1>'}} + } + +} diff --git a/test/std/containers/views/span.cons/container.pass.cpp b/test/std/containers/views/span.cons/container.pass.cpp new file mode 100644 index 0000000000000..478a3dac5db7c --- /dev/null +++ b/test/std/containers/views/span.cons/container.pass.cpp @@ -0,0 +1,118 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class Container> +// constexpr span(Container& cont); +// template<class Container> +// constexpr span(const Container& cont); +// +// Remarks: These constructors shall not participate in overload resolution unless: +// — Container is not a specialization of span, +// — Container is not a specialization of array, +// — is_array_v<Container> is false, +// — data(cont) and size(cont) are both well-formed, and +// — remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[]. +// + + +#include <span> +#include <cassert> +#include <string> +#include <vector> + +#include "test_macros.h" + +// Look ma - I'm a container! +template <typename T> +struct IsAContainer { + constexpr IsAContainer() : v_{} {} + constexpr size_t size() const {return 1;} + constexpr T *data() {return &v_;} + constexpr const T *data() const {return &v_;} + + constexpr T const *getV() const {return &v_;} // for checking + T v_; +}; + + +void checkCV() +{ + std::vector<int> v = {1,2,3}; + +// Types the same (dynamic sized) + { + std::span< int> s1{v}; // a span< int> pointing at int. + } + +// Types the same (static sized) + { + std::span< int,3> s1{v}; // a span< int> pointing at int. + } + +// types different (dynamic sized) + { + std::span<const int> s1{v}; // a span<const int> pointing at int. + std::span< volatile int> s2{v}; // a span< volatile int> pointing at int. + std::span< volatile int> s3{v}; // a span< volatile int> pointing at const int. + std::span<const volatile int> s4{v}; // a span<const volatile int> pointing at int. + } + +// types different (static sized) + { + std::span<const int,3> s1{v}; // a span<const int> pointing at int. + std::span< volatile int,3> s2{v}; // a span< volatile int> pointing at int. + std::span< volatile int,3> s3{v}; // a span< volatile int> pointing at const int. + std::span<const volatile int,3> s4{v}; // a span<const volatile int> pointing at int. + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + constexpr IsAContainer<const T> val{}; + std::span<const T> s1{val}; + std::span<const T, 1> s2{val}; + return + s1.data() == val.getV() && s1.size() == 1 + && s2.data() == val.getV() && s2.size() == 1; +} + + +template <typename T> +void testRuntimeSpan() +{ + IsAContainer<T> val{}; + std::span<const T> s1{val}; + std::span<const T, 1> s2{val}; + assert(s1.data() == val.getV() && s1.size() == 1); + assert(s2.data() == val.getV() && s2.size() == 1); +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/copy.pass.cpp b/test/std/containers/views/span.cons/copy.pass.cpp new file mode 100644 index 0000000000000..2cfffbbd4496e --- /dev/null +++ b/test/std/containers/views/span.cons/copy.pass.cpp @@ -0,0 +1,71 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span(const span& other) noexcept = default; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template <typename T> +constexpr bool doCopy(const T &rhs) +{ + ASSERT_NOEXCEPT(T{rhs}); + T lhs{rhs}; + return lhs.data() == rhs.data() + && lhs.size() == rhs.size(); +} + +struct A{}; + +template <typename T> +void testCV () +{ + int arr[] = {1,2,3}; + assert((doCopy(std::span<T> () ))); + assert((doCopy(std::span<T,0>() ))); + assert((doCopy(std::span<T> (&arr[0], 1)))); + assert((doCopy(std::span<T,1>(&arr[0], 1)))); + assert((doCopy(std::span<T> (&arr[0], 2)))); + assert((doCopy(std::span<T,2>(&arr[0], 2)))); +} + + +int main () +{ + constexpr int carr[] = {1,2,3}; + + static_assert(doCopy(std::span< int> ()), ""); + static_assert(doCopy(std::span< int,0>()), ""); + static_assert(doCopy(std::span<const int> (&carr[0], 1)), ""); + static_assert(doCopy(std::span<const int,1>(&carr[0], 1)), ""); + static_assert(doCopy(std::span<const int> (&carr[0], 2)), ""); + static_assert(doCopy(std::span<const int,2>(&carr[0], 2)), ""); + + static_assert(doCopy(std::span<long>()), ""); + static_assert(doCopy(std::span<double>()), ""); + static_assert(doCopy(std::span<A>()), ""); + + std::string s; + assert(doCopy(std::span<std::string> () )); + assert(doCopy(std::span<std::string, 0>() )); + assert(doCopy(std::span<std::string> (&s, 1))); + assert(doCopy(std::span<std::string, 1>(&s, 1))); + + testCV< int>(); + testCV<const int>(); + testCV< volatile int>(); + testCV<const volatile int>(); +} diff --git a/test/std/containers/views/span.cons/deduct.pass.cpp b/test/std/containers/views/span.cons/deduct.pass.cpp new file mode 100644 index 0000000000000..e72c09149f036 --- /dev/null +++ b/test/std/containers/views/span.cons/deduct.pass.cpp @@ -0,0 +1,87 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class T, size_t N> +// span(T (&)[N]) -> span<T, N>; +// +// template<class T, size_t N> +// span(array<T, N>&) -> span<T, N>; +// +// template<class T, size_t N> +// span(const array<T, N>&) -> span<const T, N>; +// +// template<class Container> +// span(Container&) -> span<typename Container::value_type>; +// +// template<class Container> +// span(const Container&) -> span<const typename Container::value_type>; + + + +#include <span> +#include <algorithm> +#include <array> +#include <cassert> +#include <string> +#include <type_traits> + +#include "test_macros.h" + +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + +int main () +{ + { + int arr[] = {1,2,3}; + std::span s{arr}; + using S = decltype(s); + ASSERT_SAME_TYPE(S, std::span<int, 3>); + assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end()))); + } + + { + std::array<double, 4> arr = {1.0, 2.0, 3.0, 4.0}; + std::span s{arr}; + using S = decltype(s); + ASSERT_SAME_TYPE(S, std::span<double, 4>); + assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end()))); + } + + { + const std::array<long, 5> arr = {4, 5, 6, 7, 8}; + std::span s{arr}; + using S = decltype(s); + ASSERT_SAME_TYPE(S, std::span<const long, 5>); + assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end()))); + } + + { + std::string str{"ABCDE"}; + std::span s{str}; + using S = decltype(s); + ASSERT_SAME_TYPE(S, std::span<char>); + assert((size_t)s.size() == str.size()); + assert((std::equal(s.begin(), s.end(), std::begin(s), std::end(s)))); + } + + { + const std::string str{"QWERTYUIOP"}; + std::span s{str}; + using S = decltype(s); + ASSERT_SAME_TYPE(S, std::span<const char>); + assert((size_t)s.size() == str.size()); + assert((std::equal(s.begin(), s.end(), std::begin(s), std::end(s)))); + } +} diff --git a/test/std/containers/views/span.cons/default.fail.cpp b/test/std/containers/views/span.cons/default.fail.cpp new file mode 100644 index 0000000000000..d1fefe5b38cae --- /dev/null +++ b/test/std/containers/views/span.cons/default.fail.cpp @@ -0,0 +1,32 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span() noexcept; +// +// Remarks: This constructor shall not participate in overload resolution +// unless Extent <= 0 is true. + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +int main () +{ + std::span<int, 2> s; // expected-error@span:* {{static_assert failed "Can't default construct a statically sized span with size > 0"}} + +// TODO: This is what I want: +// eXpected-error {{no matching constructor for initialization of 'std::span<int, 2>'}} +} diff --git a/test/std/containers/views/span.cons/default.pass.cpp b/test/std/containers/views/span.cons/default.pass.cpp new file mode 100644 index 0000000000000..f7e496696e991 --- /dev/null +++ b/test/std/containers/views/span.cons/default.pass.cpp @@ -0,0 +1,82 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span() noexcept; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +void checkCV() +{ +// Types the same (dynamic sized) + { + std::span< int> s1; + std::span<const int> s2; + std::span< volatile int> s3; + std::span<const volatile int> s4; + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } + +// Types the same (static sized) + { + std::span< int,0> s1; + std::span<const int,0> s2; + std::span< volatile int,0> s3; + std::span<const volatile int,0> s4; + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + std::span<const T> s1; + std::span<const T, 0> s2; + return + s1.data() == nullptr && s1.size() == 0 + && s2.data() == nullptr && s2.size() == 0; +} + + +template <typename T> +void testRuntimeSpan() +{ + ASSERT_NOEXCEPT(T{}); + std::span<const T> s1; + std::span<const T, 0> s2; + assert(s1.data() == nullptr && s1.size() == 0); + assert(s2.data() == nullptr && s2.size() == 0); +} + + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/ptr_len.fail.cpp b/test/std/containers/views/span.cons/ptr_len.fail.cpp new file mode 100644 index 0000000000000..db24e3d26884e --- /dev/null +++ b/test/std/containers/views/span.cons/ptr_len.fail.cpp @@ -0,0 +1,63 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span(pointer ptr, index_type count); +// Requires: [ptr, ptr + count) shall be a valid range. +// If extent is not equal to dynamic_extent, then count shall be equal to extent. +// + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + + int arr[] = {1,2,3}; +const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; +const volatile int cvarr[] = {1,3,5}; + +int main () +{ +// We can't check that the size doesn't match - because that's a runtime property +// std::span<int, 2> s1(arr, 3); + +// Type wrong + { + std::span<float> s1(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float, 3> s2(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}} + } + +// CV wrong (dynamically sized) + { + std::span< int> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<const int> s4{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span< volatile int> s6{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// CV wrong (statically sized) + { + std::span< int,3> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s2{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s3{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span<const int,3> s4{ varr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span<const int,3> s5{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span< volatile int,3> s6{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + std::span< volatile int,3> s7{cvarr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + } +} diff --git a/test/std/containers/views/span.cons/ptr_len.pass.cpp b/test/std/containers/views/span.cons/ptr_len.pass.cpp new file mode 100644 index 0000000000000..7302759bcc641 --- /dev/null +++ b/test/std/containers/views/span.cons/ptr_len.pass.cpp @@ -0,0 +1,113 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span(pointer ptr, index_type count); +// Requires: [ptr, ptr + count) shall be a valid range. +// If extent is not equal to dynamic_extent, then count shall be equal to extent. +// + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +void checkCV() +{ + int arr[] = {1,2,3}; + const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; + const volatile int cvarr[] = {1,3,5}; + +// Types the same (dynamic sized) + { + std::span< int> s1{ arr, 3}; // a span< int> pointing at int. + std::span<const int> s2{ carr, 3}; // a span<const int> pointing at const int. + std::span< volatile int> s3{ varr, 3}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int> s4{cvarr, 3}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + +// Types the same (static sized) + { + std::span< int,3> s1{ arr, 3}; // a span< int> pointing at int. + std::span<const int,3> s2{ carr, 3}; // a span<const int> pointing at const int. + std::span< volatile int,3> s3{ varr, 3}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int,3> s4{cvarr, 3}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + + +// types different (dynamic sized) + { + std::span<const int> s1{ arr, 3}; // a span<const int> pointing at int. + std::span< volatile int> s2{ arr, 3}; // a span< volatile int> pointing at int. + std::span< volatile int> s3{ arr, 3}; // a span< volatile int> pointing at const int. + std::span<const volatile int> s4{ arr, 3}; // a span<const volatile int> pointing at int. + std::span<const volatile int> s5{carr, 3}; // a span<const volatile int> pointing at const int. + std::span<const volatile int> s6{varr, 3}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } + +// types different (static sized) + { + std::span<const int,3> s1{ arr, 3}; // a span<const int> pointing at int. + std::span< volatile int,3> s2{ arr, 3}; // a span< volatile int> pointing at int. + std::span< volatile int,3> s3{ arr, 3}; // a span< volatile int> pointing at const int. + std::span<const volatile int,3> s4{ arr, 3}; // a span<const volatile int> pointing at int. + std::span<const volatile int,3> s5{carr, 3}; // a span<const volatile int> pointing at const int. + std::span<const volatile int,3> s6{varr, 3}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + constexpr T val[2] = {}; + std::span<const T> s1{val, 2}; + std::span<const T,2> s2{val, 2}; + return + s1.data() == &val[0] && s1.size() == 2 + && s2.data() == &val[0] && s2.size() == 2; +} + + +template <typename T> +void testRuntimeSpan() +{ + T val[2] = {}; + std::span<T> s1{val, 2}; + std::span<T,2> s2{val, 2}; + assert(s1.data() == &val[0] && s1.size() == 2); + assert(s2.data() == &val[0] && s2.size() == 2); +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/ptr_ptr.fail.cpp b/test/std/containers/views/span.cons/ptr_ptr.fail.cpp new file mode 100644 index 0000000000000..a55f0592a082f --- /dev/null +++ b/test/std/containers/views/span.cons/ptr_ptr.fail.cpp @@ -0,0 +1,63 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span(pointer first, pointer last); +// Requires: [first, last) shall be a valid range. +// If extent is not equal to dynamic_extent, then last - first shall be equal to extent. +// + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + + int arr[] = {1,2,3}; +const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; +const volatile int cvarr[] = {1,3,5}; + +int main () +{ +// We can't check that the size doesn't match - because that's a runtime property +// std::span<int, 2> s1(arr, arr + 3); + +// Type wrong + { + std::span<float> s1(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float, 3> s2(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}} + } + +// CV wrong (dynamically sized) + { + std::span< int> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span<const int> s4{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span< volatile int> s6{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// CV wrong (statically sized) + { + std::span< int,3> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s2{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span< int,3> s3{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}} + std::span<const int,3> s4{ varr, varr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span<const int,3> s5{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}} + std::span< volatile int,3> s6{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + std::span< volatile int,3> s7{cvarr, cvarr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}} + } +} diff --git a/test/std/containers/views/span.cons/ptr_ptr.pass.cpp b/test/std/containers/views/span.cons/ptr_ptr.pass.cpp new file mode 100644 index 0000000000000..afb525e73687f --- /dev/null +++ b/test/std/containers/views/span.cons/ptr_ptr.pass.cpp @@ -0,0 +1,113 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr span(pointer first, pointer last); +// Requires: [first, last) shall be a valid range. +// If extent is not equal to dynamic_extent, then last - first shall be equal to extent. +// + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +void checkCV() +{ + int arr[] = {1,2,3}; + const int carr[] = {4,5,6}; + volatile int varr[] = {7,8,9}; + const volatile int cvarr[] = {1,3,5}; + +// Types the same (dynamic sized) + { + std::span< int> s1{ arr, arr + 3}; // a span< int> pointing at int. + std::span<const int> s2{ carr, carr + 3}; // a span<const int> pointing at const int. + std::span< volatile int> s3{ varr, varr + 3}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int> s4{cvarr, cvarr + 3}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + +// Types the same (static sized) + { + std::span< int,3> s1{ arr, arr + 3}; // a span< int> pointing at int. + std::span<const int,3> s2{ carr, carr + 3}; // a span<const int> pointing at const int. + std::span< volatile int,3> s3{ varr, varr + 3}; // a span< volatile int> pointing at volatile int. + std::span<const volatile int,3> s4{cvarr, cvarr + 3}; // a span<const volatile int> pointing at const volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 12); + } + + +// types different (dynamic sized) + { + std::span<const int> s1{ arr, arr + 3}; // a span<const int> pointing at int. + std::span< volatile int> s2{ arr, arr + 3}; // a span< volatile int> pointing at int. + std::span< volatile int> s3{ arr, arr + 3}; // a span< volatile int> pointing at const int. + std::span<const volatile int> s4{ arr, arr + 3}; // a span<const volatile int> pointing at int. + std::span<const volatile int> s5{carr, carr + 3}; // a span<const volatile int> pointing at const int. + std::span<const volatile int> s6{varr, varr + 3}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } + +// types different (static sized) + { + std::span<const int,3> s1{ arr, arr + 3}; // a span<const int> pointing at int. + std::span< volatile int,3> s2{ arr, arr + 3}; // a span< volatile int> pointing at int. + std::span< volatile int,3> s3{ arr, arr + 3}; // a span< volatile int> pointing at const int. + std::span<const volatile int,3> s4{ arr, arr + 3}; // a span<const volatile int> pointing at int. + std::span<const volatile int,3> s5{carr, carr + 3}; // a span<const volatile int> pointing at const int. + std::span<const volatile int,3> s6{varr, varr + 3}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() + s5.size() + s6.size() == 18); + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + constexpr T val[2] = {}; + std::span<const T> s1{val, val+2}; + std::span<const T,2> s2{val, val+2}; + return + s1.data() == &val[0] && s1.size() == 2 + && s2.data() == &val[0] && s2.size() == 2; +} + + +template <typename T> +void testRuntimeSpan() +{ + T val[2] = {}; + std::span<T> s1{val, val+2}; + std::span<T,2> s2{val, val+2}; + assert(s1.data() == &val[0] && s1.size() == 2); + assert(s2.data() == &val[0] && s2.size() == 2); +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/span.fail.cpp b/test/std/containers/views/span.cons/span.fail.cpp new file mode 100644 index 0000000000000..1fa71551b4932 --- /dev/null +++ b/test/std/containers/views/span.cons/span.fail.cpp @@ -0,0 +1,104 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class OtherElementType, ptrdiff_t OtherExtent> +// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept; +// +// Remarks: This constructor shall not participate in overload resolution unless: +// Extent == dynamic_extent || Extent == OtherExtent is true, and +// OtherElementType(*)[] is convertible to ElementType(*)[]. + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +void checkCV () +{ +// std::span< int> sp; + std::span<const int> csp; + std::span< volatile int> vsp; + std::span<const volatile int> cvsp; + +// std::span< int, 0> sp0; + std::span<const int, 0> csp0; + std::span< volatile int, 0> vsp0; + std::span<const volatile int, 0> cvsp0; + +// Try to remove const and/or volatile (dynamic -> dynamic) + { + std::span< int> s1{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + + std::span<const int> s4{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + + std::span< volatile int> s6{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// Try to remove const and/or volatile (static -> static) + { + std::span< int, 0> s1{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span< int, 0> s2{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span< int, 0> s3{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + + std::span<const int, 0> s4{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}} + std::span<const int, 0> s5{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}} + + std::span< volatile int, 0> s6{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}} + std::span< volatile int, 0> s7{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}} + } + +// Try to remove const and/or volatile (static -> dynamic) + { + std::span< int> s1{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s2{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + std::span< int> s3{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}} + + std::span<const int> s4{ vsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + std::span<const int> s5{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}} + + std::span< volatile int> s6{ csp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + std::span< volatile int> s7{cvsp0}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}} + } + +// Try to remove const and/or volatile (static -> static) + { + std::span< int, 0> s1{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span< int, 0> s2{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + std::span< int, 0> s3{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<int, 0>'}} + + std::span<const int, 0> s4{ vsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}} + std::span<const int, 0> s5{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 0>'}} + + std::span< volatile int, 0> s6{ csp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}} + std::span< volatile int, 0> s7{cvsp}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 0>'}} + } +} + +int main () +{ + std::span<int> sp; + std::span<int, 0> sp0; + + std::span<float> s1{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float> s2{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}} + std::span<float, 0> s3{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}} + std::span<float, 0> s4{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}} + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/span.pass.cpp b/test/std/containers/views/span.cons/span.pass.cpp new file mode 100644 index 0000000000000..b2024ce123cd8 --- /dev/null +++ b/test/std/containers/views/span.cons/span.pass.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class OtherElementType, ptrdiff_t OtherExtent> +// constexpr span(const span<OtherElementType, OtherExtent>& s) noexcept; +// +// Remarks: This constructor shall not participate in overload resolution unless: +// Extent == dynamic_extent || Extent == OtherExtent is true, and +// OtherElementType(*)[] is convertible to ElementType(*)[]. + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +void checkCV() +{ + std::span< int> sp; +// std::span<const int> csp; + std::span< volatile int> vsp; +// std::span<const volatile int> cvsp; + + std::span< int, 0> sp0; +// std::span<const int, 0> csp0; + std::span< volatile int, 0> vsp0; +// std::span<const volatile int, 0> cvsp0; + +// dynamic -> dynamic + { + std::span<const int> s1{ sp}; // a span<const int> pointing at int. + std::span< volatile int> s2{ sp}; // a span< volatile int> pointing at int. + std::span<const volatile int> s3{ sp}; // a span<const volatile int> pointing at int. + std::span<const volatile int> s4{ vsp}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } + +// static -> static + { + std::span<const int, 0> s1{ sp0}; // a span<const int> pointing at int. + std::span< volatile int, 0> s2{ sp0}; // a span< volatile int> pointing at int. + std::span<const volatile int, 0> s3{ sp0}; // a span<const volatile int> pointing at int. + std::span<const volatile int, 0> s4{ vsp0}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } + +// static -> dynamic + { + std::span<const int> s1{ sp0}; // a span<const int> pointing at int. + std::span< volatile int> s2{ sp0}; // a span< volatile int> pointing at int. + std::span<const volatile int> s3{ sp0}; // a span<const volatile int> pointing at int. + std::span<const volatile int> s4{ vsp0}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } + +// dynamic -> static + { + std::span<const int, 0> s1{ sp}; // a span<const int> pointing at int. + std::span< volatile int, 0> s2{ sp}; // a span< volatile int> pointing at int. + std::span<const volatile int, 0> s3{ sp}; // a span<const volatile int> pointing at int. + std::span<const volatile int, 0> s4{ vsp}; // a span<const volatile int> pointing at volatile int. + assert(s1.size() + s2.size() + s3.size() + s4.size() == 0); + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + std::span<T> s0{}; + std::span<T, 0> s1(s0); // dynamic -> static + std::span<T> s2(s1); // static -> dynamic + ASSERT_NOEXCEPT(std::span<T> {s0}); + ASSERT_NOEXCEPT(std::span<T, 0>{s1}); + ASSERT_NOEXCEPT(std::span<T> {s1}); + ASSERT_NOEXCEPT(std::span<T, 0>{s0}); + + return + s1.data() == nullptr && s1.size() == 0 + && s2.data() == nullptr && s2.size() == 0; +} + + +template <typename T> +void testRuntimeSpan() +{ + std::span<T> s0{}; + std::span<T, 0> s1(s0); // dynamic -> static + std::span<T> s2(s1); // static -> dynamic + ASSERT_NOEXCEPT(std::span<T> {s0}); + ASSERT_NOEXCEPT(std::span<T, 0>{s1}); + ASSERT_NOEXCEPT(std::span<T> {s1}); + ASSERT_NOEXCEPT(std::span<T, 0>{s0}); + + assert(s1.data() == nullptr && s1.size() == 0); + assert(s2.data() == nullptr && s2.size() == 0); +} + + +template <typename Dest, typename Src> +bool testConversionSpan() +{ + static_assert(std::is_convertible_v<Src(*)[], Dest(*)[]>, "Bad input types to 'testConversionSpan"); + std::span<Src> s0d{}; + std::span<Src> s0s{}; + std::span<Dest, 0> s1(s0d); // dynamic -> static + std::span<Dest> s2(s0s); // static -> dynamic + s1.data() == nullptr && s1.size() == 0 + && s2.data() == nullptr && s2.size() == 0; +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + +// TODO: Add some conversion tests here that aren't "X --> const X" +// assert((testConversionSpan<unsigned char, char>())); + + checkCV(); +} diff --git a/test/std/containers/views/span.cons/stdarray.pass.cpp b/test/std/containers/views/span.cons/stdarray.pass.cpp new file mode 100644 index 0000000000000..1832ac2ba4976 --- /dev/null +++ b/test/std/containers/views/span.cons/stdarray.pass.cpp @@ -0,0 +1,114 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<size_t N> +// constexpr span(array<value_type, N>& arr) noexcept; +// template<size_t N> +// constexpr span(const array<value_type, N>& arr) noexcept; +// +// Remarks: These constructors shall not participate in overload resolution unless: +// — extent == dynamic_extent || N == extent is true, and +// — remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[]. +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" +// std::array is explicitly allowed to be initialized with A a = { init-list };. +// Disable the missing braces warning for this reason. +#include "disable_missing_braces_warning.h" + + +void checkCV() +{ + std::array<int, 3> arr = {1,2,3}; +// STL says these are not cromulent +// std::array<const int,3> carr = {4,5,6}; +// std::array<volatile int, 3> varr = {7,8,9}; +// std::array<const volatile int, 3> cvarr = {1,3,5}; + +// Types the same (dynamic sized) + { + std::span< int> s1{ arr}; // a span< int> pointing at int. + } + +// Types the same (static sized) + { + std::span< int,3> s1{ arr}; // a span< int> pointing at int. + } + + +// types different (dynamic sized) + { + std::span<const int> s1{ arr}; // a span<const int> pointing at int. + std::span< volatile int> s2{ arr}; // a span< volatile int> pointing at int. + std::span< volatile int> s3{ arr}; // a span< volatile int> pointing at const int. + std::span<const volatile int> s4{ arr}; // a span<const volatile int> pointing at int. + } + +// types different (static sized) + { + std::span<const int,3> s1{ arr}; // a span<const int> pointing at int. + std::span< volatile int,3> s2{ arr}; // a span< volatile int> pointing at int. + std::span< volatile int,3> s3{ arr}; // a span< volatile int> pointing at const int. + std::span<const volatile int,3> s4{ arr}; // a span<const volatile int> pointing at int. + } +} + + +template <typename T> +constexpr bool testConstexprSpan() +{ + constexpr std::array<T,2> val = { T(), T() }; + ASSERT_NOEXCEPT(std::span<const T> {val}); + ASSERT_NOEXCEPT(std::span<const T, 2>{val}); + std::span<const T> s1{val}; + std::span<const T, 2> s2{val}; + return + s1.data() == &val[0] && s1.size() == 2 + && s2.data() == &val[0] && s2.size() == 2; +} + + +template <typename T> +void testRuntimeSpan() +{ + std::array<T,2> val; + ASSERT_NOEXCEPT(std::span<T> {val}); + ASSERT_NOEXCEPT(std::span<T, 2>{val}); + std::span<T> s1{val}; + std::span<T, 2> s2{val}; + assert(s1.data() == &val[0] && s1.size() == 2); + assert(s2.data() == &val[0] && s2.size() == 2); +} + +struct A{}; + +int main () +{ + static_assert(testConstexprSpan<int>(), ""); + static_assert(testConstexprSpan<long>(), ""); + static_assert(testConstexprSpan<double>(), ""); + static_assert(testConstexprSpan<A>(), ""); + + testRuntimeSpan<int>(); + testRuntimeSpan<long>(); + testRuntimeSpan<double>(); + testRuntimeSpan<std::string>(); + testRuntimeSpan<A>(); + + checkCV(); +} diff --git a/test/std/containers/views/span.elem/data.pass.cpp b/test/std/containers/views/span.elem/data.pass.cpp new file mode 100644 index 0000000000000..3bc6fbbe57683 --- /dev/null +++ b/test/std/containers/views/span.elem/data.pass.cpp @@ -0,0 +1,121 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr pointer data() const noexcept; +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + +template <typename Span> +constexpr bool testConstexprSpan(Span sp, typename Span::pointer ptr) +{ + ASSERT_NOEXCEPT(sp.data()); + return sp.data() == ptr; +} + + +template <typename Span> +void testRuntimeSpan(Span sp, typename Span::pointer ptr) +{ + ASSERT_NOEXCEPT(sp.data()); + assert(sp.data() == ptr); +} + +struct A{}; +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + +int main () +{ + +// dynamic size + static_assert(testConstexprSpan(std::span<int>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<long>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<double>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<A>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<std::string>(), nullptr), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), iArr1), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1 + 1, 1), iArr1 + 1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1 + 2, 2), iArr1 + 2), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1 + 3, 3), iArr1 + 3), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1 + 4, 4), iArr1 + 4), ""); + +// static size + static_assert(testConstexprSpan(std::span<int, 0>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<long, 0>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<double, 0>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<A, 0>(), nullptr), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>(), nullptr), ""); + + static_assert(testConstexprSpan(std::span<const int, 1>(iArr1, 1), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), iArr1), ""); + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), iArr1), ""); + + static_assert(testConstexprSpan(std::span<const int, 1>(iArr1 + 1, 1), iArr1 + 1), ""); + static_assert(testConstexprSpan(std::span<const int, 2>(iArr1 + 2, 2), iArr1 + 2), ""); + static_assert(testConstexprSpan(std::span<const int, 3>(iArr1 + 3, 3), iArr1 + 3), ""); + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1 + 4, 4), iArr1 + 4), ""); + + +// dynamic size + testRuntimeSpan(std::span<int>(), nullptr); + testRuntimeSpan(std::span<long>(), nullptr); + testRuntimeSpan(std::span<double>(), nullptr); + testRuntimeSpan(std::span<A>(), nullptr); + testRuntimeSpan(std::span<std::string>(), nullptr); + + testRuntimeSpan(std::span<int>(iArr2, 1), iArr2); + testRuntimeSpan(std::span<int>(iArr2, 2), iArr2); + testRuntimeSpan(std::span<int>(iArr2, 3), iArr2); + testRuntimeSpan(std::span<int>(iArr2, 4), iArr2); + + testRuntimeSpan(std::span<int>(iArr2 + 1, 1), iArr2 + 1); + testRuntimeSpan(std::span<int>(iArr2 + 2, 2), iArr2 + 2); + testRuntimeSpan(std::span<int>(iArr2 + 3, 3), iArr2 + 3); + testRuntimeSpan(std::span<int>(iArr2 + 4, 4), iArr2 + 4); + +// static size + testRuntimeSpan(std::span<int, 0>(), nullptr); + testRuntimeSpan(std::span<long, 0>(), nullptr); + testRuntimeSpan(std::span<double, 0>(), nullptr); + testRuntimeSpan(std::span<A, 0>(), nullptr); + testRuntimeSpan(std::span<std::string, 0>(), nullptr); + + testRuntimeSpan(std::span<int, 1>(iArr2, 1), iArr2); + testRuntimeSpan(std::span<int, 2>(iArr2, 2), iArr2); + testRuntimeSpan(std::span<int, 3>(iArr2, 3), iArr2); + testRuntimeSpan(std::span<int, 4>(iArr2, 4), iArr2); + + testRuntimeSpan(std::span<int, 1>(iArr2 + 1, 1), iArr2 + 1); + testRuntimeSpan(std::span<int, 2>(iArr2 + 2, 2), iArr2 + 2); + testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), iArr2 + 3); + testRuntimeSpan(std::span<int, 4>(iArr2 + 4, 4), iArr2 + 4); + + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, 1), &s); + testRuntimeSpan(std::span<std::string, 1>(&s, 1), &s); + +} diff --git a/test/std/containers/views/span.elem/op_idx.pass.cpp b/test/std/containers/views/span.elem/op_idx.pass.cpp new file mode 100644 index 0000000000000..a88f4410427a2 --- /dev/null +++ b/test/std/containers/views/span.elem/op_idx.pass.cpp @@ -0,0 +1,119 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr reference operator[](index_type idx) const; +// constexpr reference operator()(index_type idx) const; +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + +template <typename Span> +constexpr bool testConstexprSpan(Span sp, ptrdiff_t idx) +{ + _LIBCPP_ASSERT(noexcept(sp[idx]), ""); + _LIBCPP_ASSERT(noexcept(sp(idx)), ""); + + typename Span::reference r1 = sp[idx]; + typename Span::reference r2 = sp(idx); + typename Span::reference r3 = *(sp.data() + idx); + return r1 == r2 && r2 == r3; +} + + +template <typename Span> +void testRuntimeSpan(Span sp, ptrdiff_t idx) +{ + _LIBCPP_ASSERT(noexcept(sp[idx]), ""); + _LIBCPP_ASSERT(noexcept(sp(idx)), ""); + + typename Span::reference r1 = sp[idx]; + typename Span::reference r2 = sp(idx); + typename Span::reference r3 = *(sp.data() + idx); + assert(r1 == r2 && r2 == r3); +} + +struct A{}; +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + +int main () +{ + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 0), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 0), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 1), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 0), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 2), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 0), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 2), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 3), ""); + + + static_assert(testConstexprSpan(std::span<const int, 1>(iArr1, 1), 0), ""); + + static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), 0), ""); + static_assert(testConstexprSpan(std::span<const int, 2>(iArr1, 2), 1), ""); + + static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 0), ""); + static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 1), ""); + static_assert(testConstexprSpan(std::span<const int, 3>(iArr1, 3), 2), ""); + + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 0), ""); + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 1), ""); + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 2), ""); + static_assert(testConstexprSpan(std::span<const int, 4>(iArr1, 4), 3), ""); + + + testRuntimeSpan(std::span<int>(iArr2, 1), 0); + + testRuntimeSpan(std::span<int>(iArr2, 2), 0); + testRuntimeSpan(std::span<int>(iArr2, 2), 1); + + testRuntimeSpan(std::span<int>(iArr2, 3), 0); + testRuntimeSpan(std::span<int>(iArr2, 3), 1); + testRuntimeSpan(std::span<int>(iArr2, 3), 2); + + testRuntimeSpan(std::span<int>(iArr2, 4), 0); + testRuntimeSpan(std::span<int>(iArr2, 4), 1); + testRuntimeSpan(std::span<int>(iArr2, 4), 2); + testRuntimeSpan(std::span<int>(iArr2, 4), 3); + + + testRuntimeSpan(std::span<int, 1>(iArr2, 1), 0); + + testRuntimeSpan(std::span<int, 2>(iArr2, 2), 0); + testRuntimeSpan(std::span<int, 2>(iArr2, 2), 1); + + testRuntimeSpan(std::span<int, 3>(iArr2, 3), 0); + testRuntimeSpan(std::span<int, 3>(iArr2, 3), 1); + testRuntimeSpan(std::span<int, 3>(iArr2, 3), 2); + + testRuntimeSpan(std::span<int, 4>(iArr2, 4), 0); + testRuntimeSpan(std::span<int, 4>(iArr2, 4), 1); + testRuntimeSpan(std::span<int, 4>(iArr2, 4), 2); + testRuntimeSpan(std::span<int, 4>(iArr2, 4), 3); + + std::string s; + testRuntimeSpan(std::span<std::string> (&s, 1), 0); + testRuntimeSpan(std::span<std::string, 1>(&s, 1), 0); +} diff --git a/test/std/containers/views/span.iterators/begin.pass.cpp b/test/std/containers/views/span.iterators/begin.pass.cpp new file mode 100644 index 0000000000000..c8b9900bc151b --- /dev/null +++ b/test/std/containers/views/span.iterators/begin.pass.cpp @@ -0,0 +1,116 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr iterator begin() const noexcept; +// constexpr const_iterator cbegin() const noexcept; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template <class Span> +constexpr bool testConstexprSpan(Span s) +{ + bool ret = true; + typename Span::iterator b = s. begin(); + typename Span::const_iterator cb = s.cbegin(); + + if (s.empty()) + { + ret = ret && ( b == s.end()); + ret = ret && (cb == s.cend()); + } + else + { + ret = ret && ( *b == s[0]); + ret = ret && ( &*b == &s[0]); + ret = ret && ( *cb == s[0]); + ret = ret && (&*cb == &s[0]); + } + ret = ret && (b == cb); + return ret; +} + + +template <class Span> +void testRuntimeSpan(Span s) +{ + typename Span::iterator b = s. begin(); + typename Span::const_iterator cb = s.cbegin(); + + if (s.empty()) + { + assert( b == s.end()); + assert(cb == s.cend()); + } + else + { + assert( *b == s[0]); + assert( &*b == &s[0]); + assert( *cb == s[0]); + assert(&*cb == &s[0]); + } + assert(b == cb); +} + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + + +int main() +{ + static_assert(testConstexprSpan(std::span<int>()), ""); + static_assert(testConstexprSpan(std::span<long>()), ""); + static_assert(testConstexprSpan(std::span<double>()), ""); + static_assert(testConstexprSpan(std::span<A>()), ""); + static_assert(testConstexprSpan(std::span<std::string>()), ""); + + static_assert(testConstexprSpan(std::span<int, 0>()), ""); + static_assert(testConstexprSpan(std::span<long, 0>()), ""); + static_assert(testConstexprSpan(std::span<double, 0>()), ""); + static_assert(testConstexprSpan(std::span<A, 0>()), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>()), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), ""); + + + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0)); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.iterators/end.pass.cpp b/test/std/containers/views/span.iterators/end.pass.cpp new file mode 100644 index 0000000000000..2b64b0f4b5413 --- /dev/null +++ b/test/std/containers/views/span.iterators/end.pass.cpp @@ -0,0 +1,118 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr iterator end() const noexcept; +// constexpr const_iterator cend() const noexcept; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template <class Span> +constexpr bool testConstexprSpan(Span s) +{ + bool ret = true; + typename Span::iterator e = s. end(); + typename Span::const_iterator ce = s.cend(); + if (s.empty()) + { + ret = ret && ( e == s.begin()); + ret = ret && (ce == s.cbegin()); + } + else + { + ret = ret && ( e != s.begin()); + ret = ret && (ce != s.cbegin()); + } + + ret = ret && (( e - s.begin()) == s.size()); + ret = ret && ((ce - s.cbegin()) == s.size()); + + ret = ret && (e == ce); + return ret; +} + +template <class Span> +void testRuntimeSpan(Span s) +{ + typename Span::iterator e = s. end(); + typename Span::const_iterator ce = s.cend(); + if (s.empty()) + { + assert( e == s.begin()); + assert(ce == s.cbegin()); + } + else + { + assert( e != s.begin()); + assert(ce != s.cbegin()); + } + + assert(( e - s.begin()) == s.size()); + assert((ce - s.cbegin()) == s.size()); + + assert(e == ce); +} + + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + + +int main() +{ + static_assert(testConstexprSpan(std::span<int>()), ""); + static_assert(testConstexprSpan(std::span<long>()), ""); + static_assert(testConstexprSpan(std::span<double>()), ""); + static_assert(testConstexprSpan(std::span<A>()), ""); + static_assert(testConstexprSpan(std::span<std::string>()), ""); + + static_assert(testConstexprSpan(std::span<int, 0>()), ""); + static_assert(testConstexprSpan(std::span<long, 0>()), ""); + static_assert(testConstexprSpan(std::span<double, 0>()), ""); + static_assert(testConstexprSpan(std::span<A, 0>()), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>()), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), ""); + + + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0)); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.iterators/rbegin.pass.cpp b/test/std/containers/views/span.iterators/rbegin.pass.cpp new file mode 100644 index 0000000000000..c0776c00a81bb --- /dev/null +++ b/test/std/containers/views/span.iterators/rbegin.pass.cpp @@ -0,0 +1,117 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr reverse_iterator rbegin() const noexcept; +// constexpr const_reverse_iterator crbegin() const noexcept; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template <class Span> +constexpr bool testConstexprSpan(Span s) +{ + bool ret = true; + typename Span::reverse_iterator b = s. rbegin(); + typename Span::const_reverse_iterator cb = s.crbegin(); + if (s.empty()) + { + ret = ret && ( b == s.rend()); + ret = ret && (cb == s.crend()); + } + else + { + const typename Span::index_type last = s.size() - 1; + ret = ret && ( *b == s[last]); + ret = ret && ( &*b == &s[last]); + ret = ret && ( *cb == s[last]); + ret = ret && (&*cb == &s[last]); + } + ret = ret && (b == cb); + return ret; +} + + +template <class Span> +void testRuntimeSpan(Span s) +{ + typename Span::reverse_iterator b = s. rbegin(); + typename Span::const_reverse_iterator cb = s.crbegin(); + if (s.empty()) + { + assert( b == s.rend()); + assert(cb == s.crend()); + } + else + { + const typename Span::index_type last = s.size() - 1; + assert( *b == s[last]); + assert( &*b == &s[last]); + assert( *cb == s[last]); + assert(&*cb == &s[last]); + } + assert(b == cb); +} + + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + + +int main() +{ + static_assert(testConstexprSpan(std::span<int>()), ""); + static_assert(testConstexprSpan(std::span<long>()), ""); + static_assert(testConstexprSpan(std::span<double>()), ""); + static_assert(testConstexprSpan(std::span<A>()), ""); + static_assert(testConstexprSpan(std::span<std::string>()), ""); + + static_assert(testConstexprSpan(std::span<int, 0>()), ""); + static_assert(testConstexprSpan(std::span<long, 0>()), ""); + static_assert(testConstexprSpan(std::span<double, 0>()), ""); + static_assert(testConstexprSpan(std::span<A, 0>()), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>()), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), ""); + + + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, static_cast<std::ptrdiff_t>(0))); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.iterators/rend.pass.cpp b/test/std/containers/views/span.iterators/rend.pass.cpp new file mode 100644 index 0000000000000..abcead445e1dd --- /dev/null +++ b/test/std/containers/views/span.iterators/rend.pass.cpp @@ -0,0 +1,118 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr reverse_iterator rend() const noexcept; +// constexpr const_reverse_iterator crend() const noexcept; + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template <class Span> +constexpr bool testConstexprSpan(Span s) +{ + bool ret = true; + typename Span::reverse_iterator e = s. rend(); + typename Span::const_reverse_iterator ce = s.crend(); + if (s.empty()) + { + ret = ret && ( e == s.rbegin()); + ret = ret && (ce == s.crbegin()); + } + else + { + ret = ret && ( e != s.rbegin()); + ret = ret && (ce != s.crbegin()); + } + + ret = ret && (( e - s.rbegin()) == s.size()); + ret = ret && ((ce - s.crbegin()) == s.size()); + + ret = ret && (e == ce); + return ret; +} + +template <class Span> +void testRuntimeSpan(Span s) +{ + typename Span::reverse_iterator e = s. rend(); + typename Span::const_reverse_iterator ce = s.crend(); + if (s.empty()) + { + assert( e == s.rbegin()); + assert(ce == s.crbegin()); + } + else + { + assert( e != s.rbegin()); + assert(ce != s.crbegin()); + } + + assert(( e - s.rbegin()) == s.size()); + assert((ce - s.crbegin()) == s.size()); + + assert(e == ce); +} + + +struct A{}; +bool operator==(A, A) {return true;} + +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + + +int main() +{ + static_assert(testConstexprSpan(std::span<int>()), ""); + static_assert(testConstexprSpan(std::span<long>()), ""); + static_assert(testConstexprSpan(std::span<double>()), ""); + static_assert(testConstexprSpan(std::span<A>()), ""); + static_assert(testConstexprSpan(std::span<std::string>()), ""); + + static_assert(testConstexprSpan(std::span<int, 0>()), ""); + static_assert(testConstexprSpan(std::span<long, 0>()), ""); + static_assert(testConstexprSpan(std::span<double, 0>()), ""); + static_assert(testConstexprSpan(std::span<A, 0>()), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>()), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4)), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5)), ""); + + + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0)); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.objectrep/as_bytes.pass.cpp b/test/std/containers/views/span.objectrep/as_bytes.pass.cpp new file mode 100644 index 0000000000000..b081b95c373ed --- /dev/null +++ b/test/std/containers/views/span.objectrep/as_bytes.pass.cpp @@ -0,0 +1,78 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template <class ElementType, ptrdiff_t Extent> +// span<const byte, +// Extent == dynamic_extent +// ? dynamic_extent +// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent> +// as_bytes(span<ElementType, Extent> s) noexcept; + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template<typename Span> +void testRuntimeSpan(Span sp) +{ + ASSERT_NOEXCEPT(std::as_bytes(sp)); + + auto spBytes = std::as_bytes(sp); + using SB = decltype(spBytes); + ASSERT_SAME_TYPE(const std::byte, typename SB::element_type); + + if (sp.extent == std::dynamic_extent) + assert(spBytes.extent == std::dynamic_extent); + else + assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent); + + assert((void *) spBytes.data() == (void *) sp.data()); + assert(spBytes.size() == sp.size_bytes()); +} + +struct A{}; +int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + +int main () +{ + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1)); + testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2)); + testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3)); + testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4)); + testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0)); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp b/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp new file mode 100644 index 0000000000000..28a4c45d2477b --- /dev/null +++ b/test/std/containers/views/span.objectrep/as_writeable_bytes.fail.cpp @@ -0,0 +1,48 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template <class ElementType, ptrdiff_t Extent> +// span<byte, +// Extent == dynamic_extent +// ? dynamic_extent +// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent> +// as_writeable_bytes(span<ElementType, Extent> s) noexcept; + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +const int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + +struct A {}; + +int main () +{ + std::as_writeable_bytes(std::span<const int>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const long>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const double>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const A>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const std::string>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + + std::as_writeable_bytes(std::span<const int, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const long, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const double, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const A, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const std::string, 0>()); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + + std::as_writeable_bytes(std::span<const int> (iArr2, 1)); // expected-error {{no matching function for call to 'as_writeable_bytes'}} + std::as_writeable_bytes(std::span<const int, 1>(iArr2 + 5, 1)); // expected-error {{no matching function for call to 'as_writeable_bytes'}} +} diff --git a/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp b/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp new file mode 100644 index 0000000000000..24e3fb2734993 --- /dev/null +++ b/test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp @@ -0,0 +1,78 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template <class ElementType, ptrdiff_t Extent> +// span<byte, +// Extent == dynamic_extent +// ? dynamic_extent +// : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent> +// as_writeable_bytes(span<ElementType, Extent> s) noexcept; + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +template<typename Span> +void testRuntimeSpan(Span sp) +{ + ASSERT_NOEXCEPT(std::as_writeable_bytes(sp)); + + auto spBytes = std::as_writeable_bytes(sp); + using SB = decltype(spBytes); + ASSERT_SAME_TYPE(std::byte, typename SB::element_type); + + if (sp.extent == std::dynamic_extent) + assert(spBytes.extent == std::dynamic_extent); + else + assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent); + + assert(static_cast<void*>(spBytes.data()) == static_cast<void*>(sp.data())); + assert(spBytes.size() == sp.size_bytes()); +} + +struct A{}; +int iArr2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + +int main () +{ + testRuntimeSpan(std::span<int> ()); + testRuntimeSpan(std::span<long> ()); + testRuntimeSpan(std::span<double> ()); + testRuntimeSpan(std::span<A> ()); + testRuntimeSpan(std::span<std::string>()); + + testRuntimeSpan(std::span<int, 0> ()); + testRuntimeSpan(std::span<long, 0> ()); + testRuntimeSpan(std::span<double, 0> ()); + testRuntimeSpan(std::span<A, 0> ()); + testRuntimeSpan(std::span<std::string, 0>()); + + testRuntimeSpan(std::span<int>(iArr2, 1)); + testRuntimeSpan(std::span<int>(iArr2, 2)); + testRuntimeSpan(std::span<int>(iArr2, 3)); + testRuntimeSpan(std::span<int>(iArr2, 4)); + testRuntimeSpan(std::span<int>(iArr2, 5)); + + testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1)); + testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2)); + testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3)); + testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4)); + testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5)); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0)); + testRuntimeSpan(std::span<std::string>(&s, 1)); +} diff --git a/test/std/containers/views/span.obs/empty.pass.cpp b/test/std/containers/views/span.obs/empty.pass.cpp new file mode 100644 index 0000000000000..a48c0d02494bb --- /dev/null +++ b/test/std/containers/views/span.obs/empty.pass.cpp @@ -0,0 +1,73 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr bool empty() const noexcept; +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + +struct A{}; +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + +int main () +{ + static_assert( noexcept(std::span<int> ().empty()), ""); + static_assert( noexcept(std::span<int, 0>().empty()), ""); + + + static_assert( std::span<int>().empty(), ""); + static_assert( std::span<long>().empty(), ""); + static_assert( std::span<double>().empty(), ""); + static_assert( std::span<A>().empty(), ""); + static_assert( std::span<std::string>().empty(), ""); + + static_assert( std::span<int, 0>().empty(), ""); + static_assert( std::span<long, 0>().empty(), ""); + static_assert( std::span<double, 0>().empty(), ""); + static_assert( std::span<A, 0>().empty(), ""); + static_assert( std::span<std::string, 0>().empty(), ""); + + static_assert(!std::span<const int>(iArr1, 1).empty(), ""); + static_assert(!std::span<const int>(iArr1, 2).empty(), ""); + static_assert(!std::span<const int>(iArr1, 3).empty(), ""); + static_assert(!std::span<const int>(iArr1, 4).empty(), ""); + static_assert(!std::span<const int>(iArr1, 5).empty(), ""); + + assert( (std::span<int>().empty() )); + assert( (std::span<long>().empty() )); + assert( (std::span<double>().empty() )); + assert( (std::span<A>().empty() )); + assert( (std::span<std::string>().empty() )); + + assert( (std::span<int, 0>().empty() )); + assert( (std::span<long, 0>().empty() )); + assert( (std::span<double, 0>().empty() )); + assert( (std::span<A, 0>().empty() )); + assert( (std::span<std::string, 0>().empty())); + + assert(!(std::span<int, 1>(iArr2, 1).empty())); + assert(!(std::span<int, 2>(iArr2, 2).empty())); + assert(!(std::span<int, 3>(iArr2, 3).empty())); + assert(!(std::span<int, 4>(iArr2, 4).empty())); + assert(!(std::span<int, 5>(iArr2, 5).empty())); + + std::string s; + assert( ((std::span<std::string>(&s, (std::ptrdiff_t) 0)).empty())); + assert(!((std::span<std::string>(&s, 1).empty()))); +} diff --git a/test/std/containers/views/span.obs/size.pass.cpp b/test/std/containers/views/span.obs/size.pass.cpp new file mode 100644 index 0000000000000..c33fd3f6c61ba --- /dev/null +++ b/test/std/containers/views/span.obs/size.pass.cpp @@ -0,0 +1,91 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr index_type size() const noexcept; +// + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + +template <typename Span> +constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz) +{ + ASSERT_NOEXCEPT(sp.size()); + return sp.size() == sz; +} + + +template <typename Span> +void testRuntimeSpan(Span sp, ptrdiff_t sz) +{ + ASSERT_NOEXCEPT(sp.size()); + assert(sp.size() == sz); +} + +struct A{}; +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + +int main () +{ + static_assert(testConstexprSpan(std::span<int>(), 0), ""); + static_assert(testConstexprSpan(std::span<long>(), 0), ""); + static_assert(testConstexprSpan(std::span<double>(), 0), ""); + static_assert(testConstexprSpan(std::span<A>(), 0), ""); + static_assert(testConstexprSpan(std::span<std::string>(), 0), ""); + + static_assert(testConstexprSpan(std::span<int, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<long, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<double, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<A, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>(), 0), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 2), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 3), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 4), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5), 5), ""); + + testRuntimeSpan(std::span<int> (), 0); + testRuntimeSpan(std::span<long> (), 0); + testRuntimeSpan(std::span<double> (), 0); + testRuntimeSpan(std::span<A> (), 0); + testRuntimeSpan(std::span<std::string>(), 0); + + testRuntimeSpan(std::span<int, 0> (), 0); + testRuntimeSpan(std::span<long, 0> (), 0); + testRuntimeSpan(std::span<double, 0> (), 0); + testRuntimeSpan(std::span<A, 0> (), 0); + testRuntimeSpan(std::span<std::string, 0>(), 0); + + testRuntimeSpan(std::span<int>(iArr2, 1), 1); + testRuntimeSpan(std::span<int>(iArr2, 2), 2); + testRuntimeSpan(std::span<int>(iArr2, 3), 3); + testRuntimeSpan(std::span<int>(iArr2, 4), 4); + testRuntimeSpan(std::span<int>(iArr2, 5), 5); + + testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1), 1); + testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2), 2); + testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), 3); + testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4), 4); + testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5), 5); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0), 0); + testRuntimeSpan(std::span<std::string>(&s, 1), 1); +} diff --git a/test/std/containers/views/span.obs/size_bytes.pass.cpp b/test/std/containers/views/span.obs/size_bytes.pass.cpp new file mode 100644 index 0000000000000..1ee75d9fcb798 --- /dev/null +++ b/test/std/containers/views/span.obs/size_bytes.pass.cpp @@ -0,0 +1,92 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// constexpr index_type size_bytes() const noexcept; +// +// Effects: Equivalent to: return size() * sizeof(element_type); + + +#include <span> +#include <cassert> +#include <string> + +#include "test_macros.h" + + +template <typename Span> +constexpr bool testConstexprSpan(Span sp, ptrdiff_t sz) +{ + ASSERT_NOEXCEPT(sp.size_bytes()); + return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type); +} + + +template <typename Span> +void testRuntimeSpan(Span sp, ptrdiff_t sz) +{ + ASSERT_NOEXCEPT(sp.size_bytes()); + assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type)); +} + +struct A{}; +constexpr int iArr1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + int iArr2[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}; + +int main () +{ + static_assert(testConstexprSpan(std::span<int>(), 0), ""); + static_assert(testConstexprSpan(std::span<long>(), 0), ""); + static_assert(testConstexprSpan(std::span<double>(), 0), ""); + static_assert(testConstexprSpan(std::span<A>(), 0), ""); + static_assert(testConstexprSpan(std::span<std::string>(), 0), ""); + + static_assert(testConstexprSpan(std::span<int, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<long, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<double, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<A, 0>(), 0), ""); + static_assert(testConstexprSpan(std::span<std::string, 0>(), 0), ""); + + static_assert(testConstexprSpan(std::span<const int>(iArr1, 1), 1), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 2), 2), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 3), 3), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 4), 4), ""); + static_assert(testConstexprSpan(std::span<const int>(iArr1, 5), 5), ""); + + testRuntimeSpan(std::span<int> (), 0); + testRuntimeSpan(std::span<long> (), 0); + testRuntimeSpan(std::span<double> (), 0); + testRuntimeSpan(std::span<A> (), 0); + testRuntimeSpan(std::span<std::string>(), 0); + + testRuntimeSpan(std::span<int, 0> (), 0); + testRuntimeSpan(std::span<long, 0> (), 0); + testRuntimeSpan(std::span<double, 0> (), 0); + testRuntimeSpan(std::span<A, 0> (), 0); + testRuntimeSpan(std::span<std::string, 0>(), 0); + + testRuntimeSpan(std::span<int>(iArr2, 1), 1); + testRuntimeSpan(std::span<int>(iArr2, 2), 2); + testRuntimeSpan(std::span<int>(iArr2, 3), 3); + testRuntimeSpan(std::span<int>(iArr2, 4), 4); + testRuntimeSpan(std::span<int>(iArr2, 5), 5); + + testRuntimeSpan(std::span<int, 1>(iArr2 + 5, 1), 1); + testRuntimeSpan(std::span<int, 2>(iArr2 + 4, 2), 2); + testRuntimeSpan(std::span<int, 3>(iArr2 + 3, 3), 3); + testRuntimeSpan(std::span<int, 4>(iArr2 + 2, 4), 4); + testRuntimeSpan(std::span<int, 5>(iArr2 + 1, 5), 5); + + std::string s; + testRuntimeSpan(std::span<std::string>(&s, (std::ptrdiff_t) 0), 0); + testRuntimeSpan(std::span<std::string>(&s, 1), 1); +} diff --git a/test/std/containers/views/span.sub/first.pass.cpp b/test/std/containers/views/span.sub/first.pass.cpp new file mode 100644 index 0000000000000..3bfdab9f8a55a --- /dev/null +++ b/test/std/containers/views/span.sub/first.pass.cpp @@ -0,0 +1,136 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<ptrdiff_t Count> +// constexpr span<element_type, Count> first() const; +// +// constexpr span<element_type, dynamic_extent> first(index_type count) const; +// +// Requires: 0 <= Count && Count <= size(). + + +#include <span> +#include <cassert> +#include <algorithm> +#include <string> + +#include "test_macros.h" + +template <typename Span, ptrdiff_t Count> +constexpr bool testConstexprSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template first<Count>()))); + LIBCPP_ASSERT((noexcept(sp.first(Count)))); + auto s1 = sp.template first<Count>(); + auto s2 = sp.first(Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == Count, ""); + static_assert(S2::extent == std::dynamic_extent, ""); + return + s1.data() == s2.data() + && s1.size() == s2.size() + && std::equal(s1.begin(), s1.end(), sp.begin()); +} + + +template <typename Span, ptrdiff_t Count> +void testRuntimeSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template first<Count>()))); + LIBCPP_ASSERT((noexcept(sp.first(Count)))); + auto s1 = sp.template first<Count>(); + auto s2 = sp.first(Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == Count, ""); + static_assert(S2::extent == std::dynamic_extent, ""); + assert(s1.data() == s2.data()); + assert(s1.size() == s2.size()); + assert(std::equal(s1.begin(), s1.end(), sp.begin())); +} + + +constexpr int carr1[] = {1,2,3,4}; + int arr[] = {5,6,7}; +std::string sarr [] = { "ABC", "DEF", "GHI", "JKL", "MNO"}; + +int main () +{ + { + using Sp = std::span<const int>; + static_assert(testConstexprSpan<Sp, 0>(Sp{}), ""); + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<const int, 4>; + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<int>; + testRuntimeSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0>(Sp{arr}); + testRuntimeSpan<Sp, 1>(Sp{arr}); + testRuntimeSpan<Sp, 2>(Sp{arr}); + testRuntimeSpan<Sp, 3>(Sp{arr}); + } + + { + using Sp = std::span<int, 3>; + + testRuntimeSpan<Sp, 0>(Sp{arr}); + testRuntimeSpan<Sp, 1>(Sp{arr}); + testRuntimeSpan<Sp, 2>(Sp{arr}); + testRuntimeSpan<Sp, 3>(Sp{arr}); + } + + { + using Sp = std::span<std::string>; + testConstexprSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0>(Sp{sarr}); + testRuntimeSpan<Sp, 1>(Sp{sarr}); + testRuntimeSpan<Sp, 2>(Sp{sarr}); + testRuntimeSpan<Sp, 3>(Sp{sarr}); + testRuntimeSpan<Sp, 4>(Sp{sarr}); + testRuntimeSpan<Sp, 5>(Sp{sarr}); + } + + { + using Sp = std::span<std::string, 5>; + + testRuntimeSpan<Sp, 0>(Sp{sarr}); + testRuntimeSpan<Sp, 1>(Sp{sarr}); + testRuntimeSpan<Sp, 2>(Sp{sarr}); + testRuntimeSpan<Sp, 3>(Sp{sarr}); + testRuntimeSpan<Sp, 4>(Sp{sarr}); + testRuntimeSpan<Sp, 5>(Sp{sarr}); + } +} diff --git a/test/std/containers/views/span.sub/last.pass.cpp b/test/std/containers/views/span.sub/last.pass.cpp new file mode 100644 index 0000000000000..4e378fe549edb --- /dev/null +++ b/test/std/containers/views/span.sub/last.pass.cpp @@ -0,0 +1,136 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<ptrdiff_t Count> +// constexpr span<element_type, Count> last() const; +// +// constexpr span<element_type, dynamic_extent> last(index_type count) const; +// +// Requires: 0 <= Count && Count <= size(). + + +#include <span> +#include <cassert> +#include <algorithm> +#include <string> + +#include "test_macros.h" + +template <typename Span, ptrdiff_t Count> +constexpr bool testConstexprSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template last<Count>()))); + LIBCPP_ASSERT((noexcept(sp.last(Count)))); + auto s1 = sp.template last<Count>(); + auto s2 = sp.last(Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == Count, ""); + static_assert(S2::extent == std::dynamic_extent, ""); + return + s1.data() == s2.data() + && s1.size() == s2.size() + && std::equal(s1.begin(), s1.end(), sp.end() - Count); +} + + +template <typename Span, ptrdiff_t Count> +void testRuntimeSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template last<Count>()))); + LIBCPP_ASSERT((noexcept(sp.last(Count)))); + auto s1 = sp.template last<Count>(); + auto s2 = sp.last(Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == Count, ""); + static_assert(S2::extent == std::dynamic_extent, ""); + assert(s1.data() == s2.data()); + assert(s1.size() == s2.size()); + assert(std::equal(s1.begin(), s1.end(), sp.end() - Count)); +} + + +constexpr int carr1[] = {1,2,3,4}; + int arr[] = {5,6,7}; +std::string sarr [] = { "ABC", "DEF", "GHI", "JKL", "MNO"}; + +int main () +{ + { + using Sp = std::span<const int>; + static_assert(testConstexprSpan<Sp, 0>(Sp{}), ""); + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<const int, 4>; + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<int>; + testRuntimeSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0>(Sp{arr}); + testRuntimeSpan<Sp, 1>(Sp{arr}); + testRuntimeSpan<Sp, 2>(Sp{arr}); + testRuntimeSpan<Sp, 3>(Sp{arr}); + } + + { + using Sp = std::span<int, 3>; + + testRuntimeSpan<Sp, 0>(Sp{arr}); + testRuntimeSpan<Sp, 1>(Sp{arr}); + testRuntimeSpan<Sp, 2>(Sp{arr}); + testRuntimeSpan<Sp, 3>(Sp{arr}); + } + + { + using Sp = std::span<std::string>; + testConstexprSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0>(Sp{sarr}); + testRuntimeSpan<Sp, 1>(Sp{sarr}); + testRuntimeSpan<Sp, 2>(Sp{sarr}); + testRuntimeSpan<Sp, 3>(Sp{sarr}); + testRuntimeSpan<Sp, 4>(Sp{sarr}); + testRuntimeSpan<Sp, 5>(Sp{sarr}); + } + + { + using Sp = std::span<std::string, 5>; + + testRuntimeSpan<Sp, 0>(Sp{sarr}); + testRuntimeSpan<Sp, 1>(Sp{sarr}); + testRuntimeSpan<Sp, 2>(Sp{sarr}); + testRuntimeSpan<Sp, 3>(Sp{sarr}); + testRuntimeSpan<Sp, 4>(Sp{sarr}); + testRuntimeSpan<Sp, 5>(Sp{sarr}); + } +} diff --git a/test/std/containers/views/span.sub/subspan.pass.cpp b/test/std/containers/views/span.sub/subspan.pass.cpp new file mode 100644 index 0000000000000..79cdc7bcaf1af --- /dev/null +++ b/test/std/containers/views/span.sub/subspan.pass.cpp @@ -0,0 +1,210 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<ptrdiff_t Offset, ptrdiff_t Count = dynamic_extent> +// constexpr span<element_type, see below> subspan() const; +// +// constexpr span<element_type, dynamic_extent> subspan( +// index_type offset, index_type count = dynamic_extent) const; +// +// Requires: (0 <= Offset && Offset <= size()) +// && (Count == dynamic_extent || Count >= 0 && Offset + Count <= size()) + +#include <span> +#include <cassert> +#include <algorithm> +#include <string> + +#include "test_macros.h" + +template <typename Span, ptrdiff_t Offset, ptrdiff_t Count> +constexpr bool testConstexprSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>()))); + LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count)))); + auto s1 = sp.template subspan<Offset, Count>(); + auto s2 = sp.subspan(Offset, Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), ""); + static_assert(S2::extent == std::dynamic_extent, ""); + return + s1.data() == s2.data() + && s1.size() == s2.size() + && std::equal(s1.begin(), s1.end(), sp.begin() + Offset); +} + +template <typename Span, ptrdiff_t Offset> +constexpr bool testConstexprSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>()))); + LIBCPP_ASSERT((noexcept(sp.subspan(Offset)))); + auto s1 = sp.template subspan<Offset>(); + auto s2 = sp.subspan(Offset); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), ""); + static_assert(S2::extent == std::dynamic_extent, ""); + return + s1.data() == s2.data() + && s1.size() == s2.size() + && std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end()); +} + + +template <typename Span, ptrdiff_t Offset, ptrdiff_t Count> +void testRuntimeSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>()))); + LIBCPP_ASSERT((noexcept(sp.subspan(Offset, Count)))); + auto s1 = sp.template subspan<Offset, Count>(); + auto s2 = sp.subspan(Offset, Count); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Count), ""); + static_assert(S2::extent == std::dynamic_extent, ""); + assert(s1.data() == s2.data()); + assert(s1.size() == s2.size()); + assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset)); +} + + +template <typename Span, ptrdiff_t Offset> +void testRuntimeSpan(Span sp) +{ + LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>()))); + LIBCPP_ASSERT((noexcept(sp.subspan(Offset)))); + auto s1 = sp.template subspan<Offset>(); + auto s2 = sp.subspan(Offset); + using S1 = decltype(s1); + using S2 = decltype(s2); + ASSERT_SAME_TYPE(typename Span::value_type, typename S1::value_type); + ASSERT_SAME_TYPE(typename Span::value_type, typename S2::value_type); + static_assert(S1::extent == (Span::extent == std::dynamic_extent ? std::dynamic_extent : Span::extent - Offset), ""); + static_assert(S2::extent == std::dynamic_extent, ""); + assert(s1.data() == s2.data()); + assert(s1.size() == s2.size()); + assert(std::equal(s1.begin(), s1.end(), sp.begin() + Offset, sp.end())); +} + + +constexpr int carr1[] = {1,2,3,4}; + int arr1[] = {5,6,7}; + +int main () +{ + { + using Sp = std::span<const int>; + static_assert(testConstexprSpan<Sp, 0>(Sp{}), ""); + + static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), ""); + + static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), ""); + } + + { + using Sp = std::span<const int, 4>; + + static_assert(testConstexprSpan<Sp, 0, 4>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 0, 0>(Sp{carr1}), ""); + + static_assert(testConstexprSpan<Sp, 1, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4, 0>(Sp{carr1}), ""); + } + + { + using Sp = std::span<const int>; + static_assert(testConstexprSpan<Sp, 0>(Sp{}), ""); + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<const int, 4>; + + static_assert(testConstexprSpan<Sp, 0>(Sp{carr1}), ""); + + static_assert(testConstexprSpan<Sp, 1>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 2>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 3>(Sp{carr1}), ""); + static_assert(testConstexprSpan<Sp, 4>(Sp{carr1}), ""); + } + + { + using Sp = std::span<int>; + testRuntimeSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0, 3>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 0>(Sp{arr1}); + + testRuntimeSpan<Sp, 1, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 2, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 3, 0>(Sp{arr1}); + } + + { + using Sp = std::span<int, 3>; + + testRuntimeSpan<Sp, 0, 3>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 0, 0>(Sp{arr1}); + + testRuntimeSpan<Sp, 1, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 2, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 3, 0>(Sp{arr1}); + } + + { + using Sp = std::span<int>; + testRuntimeSpan<Sp, 0>(Sp{}); + + testRuntimeSpan<Sp, 0>(Sp{arr1}); + testRuntimeSpan<Sp, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 3>(Sp{arr1}); + } + + { + using Sp = std::span<int, 3>; + + testRuntimeSpan<Sp, 0>(Sp{arr1}); + testRuntimeSpan<Sp, 1>(Sp{arr1}); + testRuntimeSpan<Sp, 2>(Sp{arr1}); + testRuntimeSpan<Sp, 3>(Sp{arr1}); + } +} diff --git a/test/std/containers/views/types.pass.cpp b/test/std/containers/views/types.pass.cpp new file mode 100644 index 0000000000000..082abeb774ea2 --- /dev/null +++ b/test/std/containers/views/types.pass.cpp @@ -0,0 +1,107 @@ +// -*- C++ -*- +//===------------------------------ span ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===---------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <span> + +// template<class ElementType, ptrdiff_t Extent = dynamic_extent> +// class span { +// public: +// // constants and types +// using element_type = ElementType; +// using value_type = remove_cv_t<ElementType>; +// using index_type = ptrdiff_t; +// using difference_type = ptrdiff_t; +// using pointer = element_type *; +// using reference = element_type &; +// using iterator = implementation-defined; +// using const_iterator = implementation-defined; +// using reverse_iterator = std::reverse_iterator<iterator>; +// using const_reverse_iterator = std::reverse_iterator<const_iterator>; +// +// static constexpr index_type extent = Extent; +// + +#include <span> +#include <cassert> +#include <iterator> +#include <string> + +#include "test_macros.h" + +template <typename S, typename Iter> +void testIterator() +{ + typedef std::iterator_traits<Iter> ItT; + + ASSERT_SAME_TYPE(typename ItT::iterator_category, std::random_access_iterator_tag); + ASSERT_SAME_TYPE(typename ItT::value_type, typename S::value_type); + ASSERT_SAME_TYPE(typename ItT::reference, typename S::reference); + ASSERT_SAME_TYPE(typename ItT::pointer, typename S::pointer); + ASSERT_SAME_TYPE(typename ItT::difference_type, typename S::difference_type); +} + +template <typename S, typename Iter> +void testConstIterator() +{ + typedef std::iterator_traits<Iter> ItT; + + ASSERT_SAME_TYPE(typename ItT::iterator_category, std::random_access_iterator_tag); + ASSERT_SAME_TYPE(typename ItT::value_type, typename S::value_type); +// I'd like to say 'const typename S::pointer' here, but that gives me +// a const pointer to a non-const value, which is not what I want. + ASSERT_SAME_TYPE(typename ItT::reference, typename S::element_type const &); + ASSERT_SAME_TYPE(typename ItT::pointer, typename S::element_type const *); + ASSERT_SAME_TYPE(typename ItT::difference_type, typename S::difference_type); +} + +template <typename S, typename ElementType, std::ptrdiff_t Size> +void testSpan() +{ + ASSERT_SAME_TYPE(typename S::element_type, ElementType); + ASSERT_SAME_TYPE(typename S::value_type, std::remove_cv_t<ElementType>); + ASSERT_SAME_TYPE(typename S::index_type, std::ptrdiff_t); + ASSERT_SAME_TYPE(typename S::difference_type, std::ptrdiff_t); + ASSERT_SAME_TYPE(typename S::pointer, ElementType *); + ASSERT_SAME_TYPE(typename S::reference, ElementType &); + + static_assert(S::extent == Size); // check that it exists + + testIterator<S, typename S::iterator>(); + testIterator<S, typename S::reverse_iterator>(); + testConstIterator<S, typename S::const_iterator>(); + testConstIterator<S, typename S::const_reverse_iterator>(); +} + + +template <typename T> +void test() +{ + testSpan<std::span< T>, T, -1>(); + testSpan<std::span<const T>, const T, -1>(); + testSpan<std::span< volatile T>, volatile T, -1>(); + testSpan<std::span<const volatile T>, const volatile T, -1>(); + + testSpan<std::span< T, 5>, T, 5>(); + testSpan<std::span<const T, 5>, const T, 5>(); + testSpan<std::span< volatile T, 5>, volatile T, 5>(); + testSpan<std::span<const volatile T, 5>, const volatile T, 5>(); +} + +struct A{}; + +int main () +{ + test<int>(); + test<long>(); + test<double>(); + test<std::string>(); + test<A>(); +} diff --git a/test/std/depr/depr.c.headers/stddef_h.pass.cpp b/test/std/depr/depr.c.headers/stddef_h.pass.cpp index 0c08c782a3e44..68f70b80e92e2 100644 --- a/test/std/depr/depr.c.headers/stddef_h.pass.cpp +++ b/test/std/depr/depr.c.headers/stddef_h.pass.cpp @@ -13,6 +13,8 @@ #include <cassert> #include <type_traits> +#include "test_macros.h" + #ifndef NULL #error NULL not defined #endif @@ -42,8 +44,16 @@ int main() "decltype(nullptr) == nullptr_t"); static_assert(sizeof(nullptr_t) == sizeof(void*), "sizeof(nullptr_t) == sizeof(void*)"); +#if TEST_STD_VER > 17 +// P0767 + static_assert(std::is_trivial<max_align_t>::value, + "std::is_trivial<max_align_t>::value"); + static_assert(std::is_standard_layout<max_align_t>::value, + "std::is_standard_layout<max_align_t>::value"); +#else static_assert(std::is_pod<max_align_t>::value, "std::is_pod<max_align_t>::value"); +#endif static_assert((std::alignment_of<max_align_t>::value >= std::alignment_of<long long>::value), "std::alignment_of<max_align_t>::value >= " diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp index 5d345f13dd41c..1bac82d303cf2 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { char buf[10] = "abcd"; - int s = std::strlen(buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen(buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp index c827850abf3a7..289b61f439969 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { signed char buf[10] = "abcd"; - int s = std::strlen((char*)buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen((char*)buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp index 46c11e4afaf09..b0920f7a76f01 100644 --- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp +++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { unsigned char buf[10] = "abcd"; - int s = std::strlen((char*)buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen((char*)buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp deleted file mode 100644 index 85ff8e15d1620..0000000000000 --- a/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <algorithm> - -// template <class PopulationIterator, class SampleIterator, class Distance, -// class UniformRandomNumberGenerator> -// SampleIterator sample(PopulationIterator first, PopulationIterator last, -// SampleIterator out, Distance n, -// UniformRandomNumberGenerator &&g); - -#include <experimental/algorithm> -#include <random> -#include <cassert> - -#include "test_iterators.h" - -template <class PopulationIterator, class SampleIterator> void test() { - int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - const unsigned is = sizeof(ia) / sizeof(ia[0]); - const unsigned os = 4; - int oa[os]; - std::minstd_rand g; - std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia + is), - SampleIterator(oa), os, g); -} - -int main() { - // expected-error@algorithm:* {{static_assert failed "SampleIterator must meet the requirements of RandomAccessIterator"}} - // expected-error@algorithm:* 2 {{does not provide a subscript operator}} - // expected-error@algorithm:* {{invalid operands}} - test<input_iterator<int *>, output_iterator<int *> >(); -} diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp deleted file mode 100644 index 23098d83e4ea6..0000000000000 --- a/test/std/experimental/algorithms/alg.random.sample/sample.pass.cpp +++ /dev/null @@ -1,150 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <algorithm> - -// template <class PopulationIterator, class SampleIterator, class Distance, -// class UniformRandomNumberGenerator> -// SampleIterator sample(PopulationIterator first, PopulationIterator last, -// SampleIterator out, Distance n, -// UniformRandomNumberGenerator &&g); - -#include <experimental/algorithm> -#include <random> -#include <cassert> - -#include "test_iterators.h" - -struct ReservoirSampleExpectations { - enum { os = 4 }; - static int oa1[os]; - static int oa2[os]; -}; - -int ReservoirSampleExpectations::oa1[] = {10, 5, 9, 4}; -int ReservoirSampleExpectations::oa2[] = {5, 2, 10, 4}; - -struct SelectionSampleExpectations { - enum { os = 4 }; - static int oa1[os]; - static int oa2[os]; -}; - -int SelectionSampleExpectations::oa1[] = {1, 4, 6, 7}; -int SelectionSampleExpectations::oa2[] = {1, 2, 6, 8}; - -template <class IteratorCategory> struct TestExpectations - : public SelectionSampleExpectations {}; - -template <> -struct TestExpectations<std::input_iterator_tag> - : public ReservoirSampleExpectations {}; - -template <template<class...> class PopulationIteratorType, class PopulationItem, - template<class...> class SampleIteratorType, class SampleItem> -void test() { - typedef PopulationIteratorType<PopulationItem *> PopulationIterator; - typedef SampleIteratorType<SampleItem *> SampleIterator; - PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - const unsigned is = sizeof(ia) / sizeof(ia[0]); - typedef TestExpectations<typename std::iterator_traits< - PopulationIterator>::iterator_category> Expectations; - const unsigned os = Expectations::os; - SampleItem oa[os]; - const int *oa1 = Expectations::oa1; - ((void)oa1); // Prevent unused warning - const int *oa2 = Expectations::oa2; - ((void)oa2); // Prevent unused warning - std::minstd_rand g; - SampleIterator end; - end = std::experimental::sample(PopulationIterator(ia), - PopulationIterator(ia + is), - SampleIterator(oa), os, g); - assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is)); - // sample() is deterministic but non-reproducible; - // its results can vary between implementations. - LIBCPP_ASSERT(std::equal(oa, oa + os, oa1)); - end = std::experimental::sample(PopulationIterator(ia), - PopulationIterator(ia + is), - SampleIterator(oa), os, std::move(g)); - assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is)); - LIBCPP_ASSERT(std::equal(oa, oa + os, oa2)); -} - -template <template<class...> class PopulationIteratorType, class PopulationItem, - template<class...> class SampleIteratorType, class SampleItem> -void test_empty_population() { - typedef PopulationIteratorType<PopulationItem *> PopulationIterator; - typedef SampleIteratorType<SampleItem *> SampleIterator; - PopulationItem ia[] = {42}; - const unsigned os = 4; - SampleItem oa[os]; - std::minstd_rand g; - SampleIterator end = - std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia), - SampleIterator(oa), os, g); - assert(end.base() == oa); -} - -template <template<class...> class PopulationIteratorType, class PopulationItem, - template<class...> class SampleIteratorType, class SampleItem> -void test_empty_sample() { - typedef PopulationIteratorType<PopulationItem *> PopulationIterator; - typedef SampleIteratorType<SampleItem *> SampleIterator; - PopulationItem ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - const unsigned is = sizeof(ia) / sizeof(ia[0]); - SampleItem oa[1]; - std::minstd_rand g; - SampleIterator end = - std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia + is), - SampleIterator(oa), 0, g); - assert(end.base() == oa); -} - -template <template<class...> class PopulationIteratorType, class PopulationItem, - template<class...> class SampleIteratorType, class SampleItem> -void test_small_population() { - // The population size is less than the sample size. - typedef PopulationIteratorType<PopulationItem *> PopulationIterator; - typedef SampleIteratorType<SampleItem *> SampleIterator; - PopulationItem ia[] = {1, 2, 3, 4, 5}; - const unsigned is = sizeof(ia) / sizeof(ia[0]); - const unsigned os = 8; - SampleItem oa[os]; - const SampleItem oa1[] = {1, 2, 3, 4, 5}; - std::minstd_rand g; - SampleIterator end; - end = std::experimental::sample(PopulationIterator(ia), - PopulationIterator(ia + is), - SampleIterator(oa), os, g); - assert(static_cast<std::size_t>(end.base() - oa) == std::min(os, is)); - assert(std::equal(oa, end.base(), oa1)); -} - -int main() { - test<input_iterator, int, random_access_iterator, int>(); - test<forward_iterator, int, output_iterator, int>(); - test<forward_iterator, int, random_access_iterator, int>(); - - test<input_iterator, int, random_access_iterator, double>(); - test<forward_iterator, int, output_iterator, double>(); - test<forward_iterator, int, random_access_iterator, double>(); - - test_empty_population<input_iterator, int, random_access_iterator, int>(); - test_empty_population<forward_iterator, int, output_iterator, int>(); - test_empty_population<forward_iterator, int, random_access_iterator, int>(); - - test_empty_sample<input_iterator, int, random_access_iterator, int>(); - test_empty_sample<forward_iterator, int, output_iterator, int>(); - test_empty_sample<forward_iterator, int, random_access_iterator, int>(); - - test_small_population<input_iterator, int, random_access_iterator, int>(); - test_small_population<forward_iterator, int, output_iterator, int>(); - test_small_population<forward_iterator, int, random_access_iterator, int>(); -} diff --git a/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp b/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp deleted file mode 100644 index c805c66fa5e76..0000000000000 --- a/test/std/experimental/algorithms/alg.random.sample/sample.stable.pass.cpp +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <algorithm> - -// template <class PopulationIterator, class SampleIterator, class Distance, -// class UniformRandomNumberGenerator> -// SampleIterator sample(PopulationIterator first, PopulationIterator last, -// SampleIterator out, Distance n, -// UniformRandomNumberGenerator &&g); - -#include <experimental/algorithm> -#include <random> -#include <cassert> - -#include "test_iterators.h" - -// Stable if and only if PopulationIterator meets the requirements of a -// ForwardIterator type. -template <class PopulationIterator, class SampleIterator> -void test_stability(bool expect_stable) { - const unsigned kPopulationSize = 100; - int ia[kPopulationSize]; - for (unsigned i = 0; i < kPopulationSize; ++i) - ia[i] = i; - PopulationIterator first(ia); - PopulationIterator last(ia + kPopulationSize); - - const unsigned kSampleSize = 20; - int oa[kPopulationSize]; - SampleIterator out(oa); - - std::minstd_rand g; - - const int kIterations = 1000; - bool unstable = false; - for (int i = 0; i < kIterations; ++i) { - std::experimental::sample(first, last, out, kSampleSize, g); - unstable |= !std::is_sorted(oa, oa + kSampleSize); - } - assert(expect_stable == !unstable); -} - -int main() { - test_stability<forward_iterator<int *>, output_iterator<int *> >(true); - test_stability<input_iterator<int *>, random_access_iterator<int *> >(false); -} diff --git a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp deleted file mode 100644 index 0b9d71e5f705c..0000000000000 --- a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp +++ /dev/null @@ -1,199 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any& operator=(any const &); - -// Test copy assignment - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class LHS, class RHS> -void test_copy_assign() { - assert(LHS::count == 0); - assert(RHS::count == 0); - LHS::reset(); - RHS::reset(); - { - any lhs(LHS(1)); - any const rhs(RHS(2)); - - assert(LHS::count == 1); - assert(RHS::count == 1); - assert(RHS::copied == 0); - - lhs = rhs; - - assert(RHS::copied == 1); - assert(LHS::count == 0); - assert(RHS::count == 2); - - assertContains<RHS>(lhs, 2); - assertContains<RHS>(rhs, 2); - } - assert(LHS::count == 0); - assert(RHS::count == 0); -} - -template <class LHS> -void test_copy_assign_empty() { - assert(LHS::count == 0); - LHS::reset(); - { - any lhs; - any const rhs(LHS(42)); - - assert(LHS::count == 1); - assert(LHS::copied == 0); - - lhs = rhs; - - assert(LHS::copied == 1); - assert(LHS::count == 2); - - assertContains<LHS>(lhs, 42); - assertContains<LHS>(rhs, 42); - } - assert(LHS::count == 0); - LHS::reset(); - { - any lhs(LHS(1)); - any const rhs; - - assert(LHS::count == 1); - assert(LHS::copied == 0); - - lhs = rhs; - - assert(LHS::copied == 0); - assert(LHS::count == 0); - - assertEmpty<LHS>(lhs); - assertEmpty(rhs); - } - assert(LHS::count == 0); -} - -void test_copy_assign_self() { - // empty - { - any a; - a = a; - assertEmpty(a); - assert(globalMemCounter.checkOutstandingNewEq(0)); - } - assert(globalMemCounter.checkOutstandingNewEq(0)); - // small - { - any a((small(1))); - assert(small::count == 1); - - a = a; - - assert(small::count == 1); - assertContains<small>(a, 1); - assert(globalMemCounter.checkOutstandingNewEq(0)); - } - assert(small::count == 0); - assert(globalMemCounter.checkOutstandingNewEq(0)); - // large - { - any a(large(1)); - assert(large::count == 1); - - a = a; - - assert(large::count == 1); - assertContains<large>(a, 1); - assert(globalMemCounter.checkOutstandingNewEq(1)); - } - assert(large::count == 0); - assert(globalMemCounter.checkOutstandingNewEq(0)); -} - -template <class Tp> -void test_copy_assign_throws() -{ -#if !defined(TEST_HAS_NO_EXCEPTIONS) - auto try_throw = - [](any& lhs, any const& rhs) { - try { - lhs = rhs; - assert(false); - } catch (my_any_exception const &) { - // do nothing - } catch (...) { - assert(false); - } - }; - // const lvalue to empty - { - any lhs; - any const rhs((Tp(1))); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(Tp::count == 1); - assertEmpty<Tp>(lhs); - assertContains<Tp>(rhs); - } - { - any lhs((small(2))); - any const rhs((Tp(1))); - assert(small::count == 1); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(small::count == 1); - assert(Tp::count == 1); - assertContains<small>(lhs, 2); - assertContains<Tp>(rhs); - } - { - any lhs((large(2))); - any const rhs((Tp(1))); - assert(large::count == 1); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(large::count == 1); - assert(Tp::count == 1); - assertContains<large>(lhs, 2); - assertContains<Tp>(rhs); - } -#endif -} - -int main() { - test_copy_assign<small1, small2>(); - test_copy_assign<large1, large2>(); - test_copy_assign<small, large>(); - test_copy_assign<large, small>(); - test_copy_assign_empty<small>(); - test_copy_assign_empty<large>(); - test_copy_assign_self(); - test_copy_assign_throws<small_throws_on_copy>(); - test_copy_assign_throws<large_throws_on_copy>(); -} diff --git a/test/std/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp deleted file mode 100644 index 72351aeae68ff..0000000000000 --- a/test/std/experimental/any/any.class/any.assign/move.pass.cpp +++ /dev/null @@ -1,104 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any& operator=(any &&); - -// Test move assignment. - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class LHS, class RHS> -void test_move_assign() { - assert(LHS::count == 0); - assert(RHS::count == 0); - { - LHS const s1(1); - any a(s1); - RHS const s2(2); - any a2(s2); - - assert(LHS::count == 2); - assert(RHS::count == 2); - - a = std::move(a2); - - assert(LHS::count == 1); - assert(RHS::count == 2); - - assertContains<RHS>(a, 2); - assertEmpty<RHS>(a2); - } - assert(LHS::count == 0); - assert(RHS::count == 0); -} - -template <class LHS> -void test_move_assign_empty() { - assert(LHS::count == 0); - { - any a; - any a2((LHS(1))); - - assert(LHS::count == 1); - - a = std::move(a2); - - assert(LHS::count == 1); - - assertContains<LHS>(a, 1); - assertEmpty<LHS>(a2); - } - assert(LHS::count == 0); - { - any a((LHS(1))); - any a2; - - assert(LHS::count == 1); - - a = std::move(a2); - - assert(LHS::count == 0); - - assertEmpty<LHS>(a); - assertEmpty(a2); - } - assert(LHS::count == 0); -} - -void test_move_assign_noexcept() { - any a1; - any a2; - static_assert( - noexcept(a1 = std::move(a2)) - , "any & operator=(any &&) must be noexcept" - ); -} - -int main() { - test_move_assign_noexcept(); - test_move_assign<small1, small2>(); - test_move_assign<large1, large2>(); - test_move_assign<small, large>(); - test_move_assign<large, small>(); - test_move_assign_empty<small>(); - test_move_assign_empty<large>(); -} diff --git a/test/std/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp deleted file mode 100644 index cd4646fb5fd56..0000000000000 --- a/test/std/experimental/any/any.class/any.assign/value.pass.cpp +++ /dev/null @@ -1,179 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any& operator=(any const &); - -// Test value copy and move assignment. - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class LHS, class RHS> -void test_assign_value() { - assert(LHS::count == 0); - assert(RHS::count == 0); - LHS::reset(); - RHS::reset(); - { - any lhs(LHS(1)); - any const rhs(RHS(2)); - - assert(LHS::count == 1); - assert(RHS::count == 1); - assert(RHS::copied == 0); - - lhs = rhs; - - assert(RHS::copied == 1); - assert(LHS::count == 0); - assert(RHS::count == 2); - - assertContains<RHS>(lhs, 2); - assertContains<RHS>(rhs, 2); - } - assert(LHS::count == 0); - assert(RHS::count == 0); - LHS::reset(); - RHS::reset(); - { - any lhs(LHS(1)); - any rhs(RHS(2)); - - assert(LHS::count == 1); - assert(RHS::count == 1); - assert(RHS::moved == 1); - - lhs = std::move(rhs); - - assert(RHS::moved >= 1); - assert(RHS::copied == 0); - assert(LHS::count == 0); - assert(RHS::count == 1); - - assertContains<RHS>(lhs, 2); - assertEmpty<RHS>(rhs); - } - assert(LHS::count == 0); - assert(RHS::count == 0); -} - -template <class RHS> -void test_assign_value_empty() { - assert(RHS::count == 0); - RHS::reset(); - { - any lhs; - RHS rhs(42); - assert(RHS::count == 1); - assert(RHS::copied == 0); - - lhs = rhs; - - assert(RHS::count == 2); - assert(RHS::copied == 1); - assert(RHS::moved >= 0); - assertContains<RHS>(lhs, 42); - } - assert(RHS::count == 0); - RHS::reset(); - { - any lhs; - RHS rhs(42); - assert(RHS::count == 1); - assert(RHS::moved == 0); - - lhs = std::move(rhs); - - assert(RHS::count == 2); - assert(RHS::copied == 0); - assert(RHS::moved >= 1); - assertContains<RHS>(lhs, 42); - } - assert(RHS::count == 0); - RHS::reset(); -} - - -template <class Tp, bool Move = false> -void test_assign_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) - auto try_throw= - [](any& lhs, auto&& rhs) { - try { - Move ? lhs = std::move(rhs) - : lhs = rhs; - assert(false); - } catch (my_any_exception const &) { - // do nothing - } catch (...) { - assert(false); - } - }; - // const lvalue to empty - { - any lhs; - Tp rhs(1); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(Tp::count == 1); - assertEmpty<Tp>(lhs); - } - { - any lhs((small(2))); - Tp rhs(1); - assert(small::count == 1); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(small::count == 1); - assert(Tp::count == 1); - assertContains<small>(lhs, 2); - } - { - any lhs((large(2))); - Tp rhs(1); - assert(large::count == 1); - assert(Tp::count == 1); - - try_throw(lhs, rhs); - - assert(large::count == 1); - assert(Tp::count == 1); - assertContains<large>(lhs, 2); - } -#endif -} - -int main() { - test_assign_value<small1, small2>(); - test_assign_value<large1, large2>(); - test_assign_value<small, large>(); - test_assign_value<large, small>(); - test_assign_value_empty<small>(); - test_assign_value_empty<large>(); - test_assign_throws<small_throws_on_copy>(); - test_assign_throws<large_throws_on_copy>(); - test_assign_throws<throws_on_move, /* Move = */ true>(); -} diff --git a/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp b/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp deleted file mode 100644 index 7d2d33d63cfcf..0000000000000 --- a/test/std/experimental/any/any.class/any.assign/value_non_copyable_assign.fail.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// template <class Value> -// any& operator=(Value &&); - -// Instantiate the value assignment operator with a non-copyable type. - -#include <experimental/any> - -class non_copyable -{ - non_copyable(non_copyable const &); - -public: - non_copyable() {} - non_copyable(non_copyable &&) {} -}; - -int main() -{ - using namespace std::experimental; - non_copyable nc; - any a; - a = static_cast<non_copyable &&>(nc); // expected-error-re@experimental/any:* 2 {{static_assert failed{{.*}} "_ValueType must be CopyConstructible."}} - // expected-error@experimental/any:* {{calling a private constructor of class 'non_copyable'}} - -} diff --git a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp deleted file mode 100644 index d477394c0b910..0000000000000 --- a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp +++ /dev/null @@ -1,102 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any(any const &); - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class Type> -void test_copy_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) - assert(Type::count == 0); - { - any const a((Type(42))); - assert(Type::count == 1); - try { - any const a2(a); - assert(false); - } catch (my_any_exception const &) { - // do nothing - } catch (...) { - assert(false); - } - assert(Type::count == 1); - assertContains<Type>(a, 42); - } - assert(Type::count == 0); -#endif -} - -void test_copy_empty() { - DisableAllocationGuard g; ((void)g); // No allocations should occur. - any a1; - any a2(a1); - - assertEmpty(a1); - assertEmpty(a2); -} - -template <class Type> -void test_copy() -{ - // Copying small types should not perform any allocations. - DisableAllocationGuard g(isSmallType<Type>()); ((void)g); - assert(Type::count == 0); - Type::reset(); - { - any a((Type(42))); - assert(Type::count == 1); - assert(Type::copied == 0); - - any a2(a); - - assert(Type::copied == 1); - assert(Type::count == 2); - assertContains<Type>(a, 42); - assertContains<Type>(a, 42); - - // Modify a and check that a2 is unchanged - modifyValue<Type>(a, -1); - assertContains<Type>(a, -1); - assertContains<Type>(a2, 42); - - // modify a2 and check that a is unchanged - modifyValue<Type>(a2, 999); - assertContains<Type>(a, -1); - assertContains<Type>(a2, 999); - - // clear a and check that a2 is unchanged - a.clear(); - assertEmpty(a); - assertContains<Type>(a2, 999); - } - assert(Type::count == 0); -} - -int main() { - test_copy<small>(); - test_copy<large>(); - test_copy_empty(); - test_copy_throws<small_throws_on_copy>(); - test_copy_throws<large_throws_on_copy>(); -} diff --git a/test/std/experimental/any/any.class/any.cons/default.pass.cpp b/test/std/experimental/any/any.class/any.cons/default.pass.cpp deleted file mode 100644 index 3839e3afc81d2..0000000000000 --- a/test/std/experimental/any/any.class/any.cons/default.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// any() noexcept; - -#include <experimental/any> -#include <type_traits> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" - - -int main() -{ - using std::experimental::any; - { - static_assert( - std::is_nothrow_default_constructible<any>::value - , "Must be default constructible" - ); - } - { - DisableAllocationGuard g; ((void)g); - any const a; - assertEmpty(a); - } -} diff --git a/test/std/experimental/any/any.class/any.cons/move.pass.cpp b/test/std/experimental/any/any.class/any.cons/move.pass.cpp deleted file mode 100644 index ef980ca5f2227..0000000000000 --- a/test/std/experimental/any/any.class/any.cons/move.pass.cpp +++ /dev/null @@ -1,104 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any(any &&) noexcept; - -#include <experimental/any> -#include <utility> -#include <type_traits> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -// Moves are always noexcept. The throws_on_move object -// must be stored dynamically so the pointer is moved and -// not the stored object. -void test_move_does_not_throw() -{ -#if !defined(TEST_HAS_NO_EXCEPTIONS) - assert(throws_on_move::count == 0); - { - throws_on_move v(42); - any a(v); - assert(throws_on_move::count == 2); - // No allocations should be performed after this point. - DisableAllocationGuard g; ((void)g); - try { - any const a2(std::move(a)); - assertEmpty(a); - assertContains<throws_on_move>(a2, 42); - } catch (...) { - assert(false); - } - assert(throws_on_move::count == 1); - assertEmpty(a); - } - assert(throws_on_move::count == 0); -#endif -} - -void test_move_empty() { - DisableAllocationGuard g; ((void)g); // no allocations should be performed. - - any a1; - any a2(std::move(a1)); - - assertEmpty(a1); - assertEmpty(a2); -} - -template <class Type> -void test_move() { - assert(Type::count == 0); - Type::reset(); - { - any a((Type(42))); - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - - // Moving should not perform allocations since it must be noexcept. - DisableAllocationGuard g; ((void)g); - - any a2(std::move(a)); - - assert(Type::moved >= 1); // zero or more move operations can be performed. - assert(Type::copied == 0); // no copies can be performed. - assert(Type::count == 1); - assertEmpty(a); // Moves are always destructive. - assertContains<Type>(a2, 42); - } - assert(Type::count == 0); -} - -int main() -{ - // noexcept test - { - static_assert( - std::is_nothrow_move_constructible<any>::value - , "any must be nothrow move constructible" - ); - } - test_move<small>(); - test_move<large>(); - test_move_empty(); - test_move_does_not_throw(); -} diff --git a/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp b/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp deleted file mode 100644 index c4f7568ec8531..0000000000000 --- a/test/std/experimental/any/any.class/any.cons/non_copyable_value.fail.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// any::any<Value>(Value &&) - -// Attempt to construct any with a non-copyable type. - -#include <experimental/any> - -class non_copyable -{ - non_copyable(non_copyable const &); - -public: - non_copyable() {} - non_copyable(non_copyable &&) {} -}; - -int main() -{ - using namespace std::experimental; - non_copyable nc; - any a(static_cast<non_copyable &&>(nc)); - // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType must be CopyConstructible."}} - // expected-error@experimental/any:* 1 {{calling a private constructor of class 'non_copyable'}} -} diff --git a/test/std/experimental/any/any.class/any.cons/value.pass.cpp b/test/std/experimental/any/any.class/any.cons/value.pass.cpp deleted file mode 100644 index d37990e6ca374..0000000000000 --- a/test/std/experimental/any/any.class/any.cons/value.pass.cpp +++ /dev/null @@ -1,118 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// template <class Value> any(Value &&) - -// Test construction from a value. -// Concerns: -// --------- -// 1. The value is properly move/copied depending on the value category. -// 2. Both small and large values are properly handled. - - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class Type> -void test_copy_value_throws() -{ -#if !defined(TEST_HAS_NO_EXCEPTIONS) - assert(Type::count == 0); - { - Type const t(42); - assert(Type::count == 1); - try { - any const a2(t); - assert(false); - } catch (my_any_exception const &) { - // do nothing - } catch (...) { - assert(false); - } - assert(Type::count == 1); - assert(t.value == 42); - } - assert(Type::count == 0); -#endif -} - -void test_move_value_throws() -{ -#if !defined(TEST_HAS_NO_EXCEPTIONS) - assert(throws_on_move::count == 0); - { - throws_on_move v; - assert(throws_on_move::count == 1); - try { - any const a(std::move(v)); - assert(false); - } catch (my_any_exception const &) { - // do nothing - } catch (...) { - assert(false); - } - assert(throws_on_move::count == 1); - } - assert(throws_on_move::count == 0); -#endif -} - -template <class Type> -void test_copy_move_value() { - // constructing from a small type should perform no allocations. - DisableAllocationGuard g(isSmallType<Type>()); ((void)g); - assert(Type::count == 0); - Type::reset(); - { - Type t(42); - assert(Type::count == 1); - - any a(t); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::moved == 0); - assertContains<Type>(a, 42); - } - assert(Type::count == 0); - Type::reset(); - { - Type t(42); - assert(Type::count == 1); - - any a(std::move(t)); - - assert(Type::count == 2); - assert(Type::copied == 0); - assert(Type::moved == 1); - assertContains<Type>(a, 42); - } -} - - -int main() { - test_copy_move_value<small>(); - test_copy_move_value<large>(); - test_copy_value_throws<small_throws_on_copy>(); - test_copy_value_throws<large_throws_on_copy>(); - test_move_value_throws(); -} diff --git a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp deleted file mode 100644 index a19bd38f129bd..0000000000000 --- a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any::clear() noexcept - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" - -int main() -{ - using std::experimental::any; - using std::experimental::any_cast; - // empty - { - any a; - - // noexcept check - static_assert( - noexcept(a.clear()) - , "any.clear() must be noexcept" - ); - - assertEmpty(a); - - a.clear(); - - assertEmpty(a); - } - // small object - { - any a((small(1))); - assert(small::count == 1); - assertContains<small>(a, 1); - - a.clear(); - - assertEmpty<small>(a); - assert(small::count == 0); - } - // large object - { - any a(large(1)); - assert(large::count == 1); - assertContains<large>(a); - - a.clear(); - - assertEmpty<large>(a); - assert(large::count == 0); - } -} diff --git a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp deleted file mode 100644 index 8de582a6b76e3..0000000000000 --- a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// any::swap(any &) noexcept - -// Test swap(large, small) and swap(small, large) - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" - -using std::experimental::any; -using std::experimental::any_cast; - -template <class LHS, class RHS> -void test_swap() { - assert(LHS::count == 0); - assert(RHS::count == 0); - { - any a1((LHS(1))); - any a2(RHS{2}); - assert(LHS::count == 1); - assert(RHS::count == 1); - - a1.swap(a2); - - assert(LHS::count == 1); - assert(RHS::count == 1); - - assertContains<RHS>(a1, 2); - assertContains<LHS>(a2, 1); - } - assert(LHS::count == 0); - assert(RHS::count == 0); - assert(LHS::copied == 0); - assert(RHS::copied == 0); -} - -template <class Tp> -void test_swap_empty() { - assert(Tp::count == 0); - { - any a1((Tp(1))); - any a2; - assert(Tp::count == 1); - - a1.swap(a2); - - assert(Tp::count == 1); - - assertContains<Tp>(a2, 1); - assertEmpty(a1); - } - assert(Tp::count == 0); - { - any a1((Tp(1))); - any a2; - assert(Tp::count == 1); - - a2.swap(a1); - - assert(Tp::count == 1); - - assertContains<Tp>(a2, 1); - assertEmpty(a1); - } - assert(Tp::count == 0); - assert(Tp::copied == 0); -} - -void test_noexcept() -{ - any a1; - any a2; - static_assert( - noexcept(a1.swap(a2)) - , "any::swap(any&) must be noexcept" - ); -} - -int main() -{ - test_noexcept(); - test_swap_empty<small>(); - test_swap_empty<large>(); - test_swap<small1, small2>(); - test_swap<large1, large2>(); - test_swap<small, large>(); - test_swap<large, small>(); -} diff --git a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp b/test/std/experimental/any/any.class/any.observers/empty.pass.cpp deleted file mode 100644 index bdf0d511b8115..0000000000000 --- a/test/std/experimental/any/any.class/any.observers/empty.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// any::empty() noexcept - -#include <experimental/any> -#include <cassert> - -#include "experimental_any_helpers.h" - -int main() -{ - using std::experimental::any; - // noexcept test - { - any a; - static_assert(noexcept(a.empty()), "any::empty() must be noexcept"); - } - // empty - { - any a; - assert(a.empty()); - - a.clear(); - assert(a.empty()); - - a = 42; - assert(!a.empty()); - } - // small object - { - small const s(1); - any a(s); - assert(!a.empty()); - - a.clear(); - assert(a.empty()); - - a = s; - assert(!a.empty()); - } - // large object - { - large const l(1); - any a(l); - assert(!a.empty()); - - a.clear(); - assert(a.empty()); - - a = l; - assert(!a.empty()); - } -} diff --git a/test/std/experimental/any/any.class/any.observers/type.pass.cpp b/test/std/experimental/any/any.class/any.observers/type.pass.cpp deleted file mode 100644 index 6d00484036773..0000000000000 --- a/test/std/experimental/any/any.class/any.observers/type.pass.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: libcpp-no-rtti - -// <experimental/any> - -// any::type() noexcept - -#include <experimental/any> -#include <cassert> -#include "experimental_any_helpers.h" - -int main() -{ - using std::experimental::any; - { - any const a; - assert(a.type() == typeid(void)); - static_assert(noexcept(a.type()), "any::type() must be noexcept"); - } - { - small const s(1); - any const a(s); - assert(a.type() == typeid(small)); - - } - { - large const l(1); - any const a(l); - assert(a.type() == typeid(large)); - } -} diff --git a/test/std/experimental/any/any.class/nothing_to_do.pass.cpp b/test/std/experimental/any/any.class/nothing_to_do.pass.cpp deleted file mode 100644 index c21f8a701685b..0000000000000 --- a/test/std/experimental/any/any.class/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <experimental/string_view> - -int main () {} diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp deleted file mode 100644 index 46ddbe5b05a14..0000000000000 --- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp +++ /dev/null @@ -1,146 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// template <class ValueType> -// ValueType const* any_cast(any const *) noexcept; -// -// template <class ValueType> -// ValueType * any_cast(any *) noexcept; - -#include <experimental/any> -#include <type_traits> -#include <cassert> - -#include "experimental_any_helpers.h" - -using std::experimental::any; -using std::experimental::any_cast; - -// Test that the operators are properly noexcept. -void test_cast_is_noexcept() { - any a; - static_assert(noexcept(any_cast<int>(&a)), ""); - - any const& ca = a; - static_assert(noexcept(any_cast<int>(&ca)), ""); -} - -// Test that the return type of any_cast is correct. -void test_cast_return_type() { - any a; - static_assert(std::is_same<decltype(any_cast<int>(&a)), int*>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const>(&a)), int const*>::value, ""); - - any const& ca = a; - static_assert(std::is_same<decltype(any_cast<int>(&ca)), int const*>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const>(&ca)), int const*>::value, ""); -} - -// Test that any_cast handles null pointers. -void test_cast_nullptr() { - any* a = nullptr; - assert(nullptr == any_cast<int>(a)); - assert(nullptr == any_cast<int const>(a)); - - any const* ca = nullptr; - assert(nullptr == any_cast<int>(ca)); - assert(nullptr == any_cast<int const>(ca)); -} - -// Test casting an empty object. -void test_cast_empty() { - { - any a; - assert(nullptr == any_cast<int>(&a)); - assert(nullptr == any_cast<int const>(&a)); - - any const& ca = a; - assert(nullptr == any_cast<int>(&ca)); - assert(nullptr == any_cast<int const>(&ca)); - } - // Create as non-empty, then make empty and run test. - { - any a(42); - a.clear(); - assert(nullptr == any_cast<int>(&a)); - assert(nullptr == any_cast<int const>(&a)); - - any const& ca = a; - assert(nullptr == any_cast<int>(&ca)); - assert(nullptr == any_cast<int const>(&ca)); - } -} - -template <class Type> -void test_cast() { - assert(Type::count == 0); - Type::reset(); - { - any a((Type(42))); - any const& ca = a; - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - - // Try a cast to a bad type. - // NOTE: Type cannot be an int. - assert(any_cast<int>(&a) == nullptr); - assert(any_cast<int const>(&a) == nullptr); - assert(any_cast<int const volatile>(&a) == nullptr); - - // Try a cast to the right type, but as a pointer. - assert(any_cast<Type*>(&a) == nullptr); - assert(any_cast<Type const*>(&a) == nullptr); - - // Check getting a unqualified type from a non-const any. - Type* v = any_cast<Type>(&a); - assert(v != nullptr); - assert(v->value == 42); - - // change the stored value and later check for the new value. - v->value = 999; - - // Check getting a const qualified type from a non-const any. - Type const* cv = any_cast<Type const>(&a); - assert(cv != nullptr); - assert(cv == v); - assert(cv->value == 999); - - // Check getting a unqualified type from a const any. - cv = any_cast<Type>(&ca); - assert(cv != nullptr); - assert(cv == v); - assert(cv->value == 999); - - // Check getting a const-qualified type from a const any. - cv = any_cast<Type const>(&ca); - assert(cv != nullptr); - assert(cv == v); - assert(cv->value == 999); - - // Check that no more objects were created, copied or moved. - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - } - assert(Type::count == 0); -} - -int main() { - test_cast_is_noexcept(); - test_cast_return_type(); - test_cast_nullptr(); - test_cast_empty(); - test_cast<small>(); - test_cast<large>(); -} diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp deleted file mode 100644 index ca6d1de116eeb..0000000000000 --- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp +++ /dev/null @@ -1,312 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// XFAIL: availability=macosx - -// <experimental/any> - -// template <class ValueType> -// ValueType const any_cast(any const&); -// -// template <class ValueType> -// ValueType any_cast(any &); -// -// template <class ValueType> -// ValueType any_cast(any &&); - -#include <experimental/any> -#include <type_traits> -#include <cassert> - -#include "experimental_any_helpers.h" -#include "count_new.hpp" -#include "test_macros.h" - -using std::experimental::any; -using std::experimental::any_cast; -using std::experimental::bad_any_cast; - - -// Test that the operators are NOT marked noexcept. -void test_cast_is_not_noexcept() { - any a; - static_assert(!noexcept(any_cast<int>(static_cast<any&>(a))), ""); - static_assert(!noexcept(any_cast<int>(static_cast<any const&>(a))), ""); - static_assert(!noexcept(any_cast<int>(static_cast<any &&>(a))), ""); -} - -// Test that the return type of any_cast is correct. -void test_cast_return_type() { - any a; - static_assert(std::is_same<decltype(any_cast<int>(a)), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const>(a)), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int&>(a)), int&>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const&>(a)), int const&>::value, ""); - - //static_assert(std::is_same<decltype(any_cast<int&&>(a)), int&&>::value, ""); - //static_assert(std::is_same<decltype(any_cast<int const&&>(a)), int const&&>::value, ""); - - static_assert(std::is_same<decltype(any_cast<int>(std::move(a))), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const>(std::move(a))), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int&>(std::move(a))), int&>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const&>(std::move(a))), int const&>::value, ""); - - //static_assert(std::is_same<decltype(any_cast<int&&>(std::move(a))), int&&>::value, ""); - //static_assert(std::is_same<decltype(any_cast<int const&&>(std::move(a))), int const&&>::value, ""); - - any const& ca = a; - static_assert(std::is_same<decltype(any_cast<int>(ca)), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const>(ca)), int>::value, ""); - static_assert(std::is_same<decltype(any_cast<int const&>(ca)), int const&>::value, ""); - - //static_assert(std::is_same<decltype(any_cast<int const&&>(ca)), int const&&>::value, ""); -} - -template <class Type, class ConstT = Type> -void checkThrows(any& a) -{ -#if !defined(TEST_HAS_NO_EXCEPTIONS) - try { - any_cast<Type>(a); - assert(false); - } catch (bad_any_cast const &) { - // do nothing - } catch (...) { - assert(false); - } - - try { - any_cast<ConstT>(static_cast<any const&>(a)); - assert(false); - } catch (bad_any_cast const &) { - // do nothing - } catch (...) { - assert(false); - } - - try { - any_cast<Type>(static_cast<any&&>(a)); - assert(false); - } catch (bad_any_cast const &) { - // do nothing - } catch (...) { - assert(false); - } -#else - ((void)a); -#endif -} - -void test_cast_empty() { - // None of these operations should allocate. - DisableAllocationGuard g; ((void)g); - any a; - checkThrows<int>(a); -} - -template <class Type> -void test_cast_to_reference() { - assert(Type::count == 0); - Type::reset(); - { - any a((Type(42))); - any const& ca = a; - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - - // Try a cast to a bad type. - // NOTE: Type cannot be an int. - checkThrows<int>(a); - checkThrows<int&, int const&>(a); - checkThrows<Type*, Type const*>(a); - checkThrows<Type const*>(a); - - // Check getting a type by reference from a non-const lvalue any. - { - Type& v = any_cast<Type&>(a); - assert(v.value == 42); - - Type const &cv = any_cast<Type const&>(a); - assert(&cv == &v); - } - // Check getting a type by reference from a const lvalue any. - { - Type const& v = any_cast<Type const&>(ca); - assert(v.value == 42); - - Type const &cv = any_cast<Type const&>(ca); - assert(&cv == &v); - } - // Check getting a type by reference from a non-const rvalue - { - Type& v = any_cast<Type&>(std::move(a)); - assert(v.value == 42); - - Type const &cv = any_cast<Type const&>(std::move(a)); - assert(&cv == &v); - } - // Check getting a type by reference from a const rvalue any. - { - Type const& v = any_cast<Type const&>(std::move(ca)); - assert(v.value == 42); - - Type const &cv = any_cast<Type const&>(std::move(ca)); - assert(&cv == &v); - } - - // Check that the original object hasn't been changed. - assertContains<Type>(a, 42); - - // Check that no objects have been created/copied/moved. - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - } - assert(Type::count == 0); -} - -template <class Type> -void test_cast_to_value() { - assert(Type::count == 0); - Type::reset(); - { - any a((Type(42))); - assert(Type::count == 1); - assert(Type::copied == 0); - assert(Type::moved == 1); - - // Try a cast to a bad type. - // NOTE: Type cannot be an int. - checkThrows<int>(a); - checkThrows<int&, int const&>(a); - checkThrows<Type*, Type const*>(a); - checkThrows<Type const*>(a); - - Type::reset(); // NOTE: reset does not modify Type::count - // Check getting Type by value from a non-const lvalue any. - // This should cause the non-const copy constructor to be called. - { - Type t = any_cast<Type>(a); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 0); - assert(Type::non_const_copied == 1); - assert(Type::moved == 0); - assert(t.value == 42); - } - assert(Type::count == 1); - Type::reset(); - // Check getting const Type by value from a non-const lvalue any. - // This should cause the const copy constructor to be called. - { - Type t = any_cast<Type const>(a); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 1); - assert(Type::non_const_copied == 0); - assert(Type::moved == 0); - assert(t.value == 42); - } - assert(Type::count == 1); - Type::reset(); - // Check getting Type by value from a non-const lvalue any. - // This should cause the const copy constructor to be called. - { - Type t = any_cast<Type>(static_cast<any const&>(a)); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 1); - assert(Type::non_const_copied == 0); - assert(Type::moved == 0); - assert(t.value == 42); - } - assert(Type::count == 1); - Type::reset(); - // Check getting Type by value from a non-const rvalue any. - // This should cause the non-const copy constructor to be called. - { - Type t = any_cast<Type>(static_cast<any &&>(a)); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 0); - assert(Type::non_const_copied == 1); - assert(Type::moved == 0); - assert(t.value == 42); - } - assert(Type::count == 1); - Type::reset(); - // Check getting const Type by value from a non-const rvalue any. - // This should cause the const copy constructor to be called. - { - Type t = any_cast<Type const>(static_cast<any &&>(a)); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 1); - assert(Type::non_const_copied == 0); - assert(Type::moved == 0); - assert(t.value == 42); - } - assert(Type::count == 1); - Type::reset(); - // Check getting Type by value from a const rvalue any. - // This should cause the const copy constructor to be called. - { - Type t = any_cast<Type>(static_cast<any const&&>(a)); - - assert(Type::count == 2); - assert(Type::copied == 1); - assert(Type::const_copied == 1); - assert(Type::non_const_copied == 0); - assert(Type::moved == 0); - assert(t.value == 42); - } - // Ensure we still only have 1 Type object alive. - assert(Type::count == 1); - - // Check that the original object hasn't been changed. - assertContains<Type>(a, 42); - } - assert(Type::count == 0); -} - -// Even though you can't get a non-copyable class into std::any -// the standard requires that these overloads compile and function. -void test_non_copyable_ref() { - struct no_copy - { - no_copy() {} - no_copy(no_copy &&) {} - private: - no_copy(no_copy const &); - }; - - any a; - checkThrows<no_copy &, no_copy const&>(a); - checkThrows<no_copy const&>(a); - assertEmpty(a); -} - -int main() { - test_cast_is_not_noexcept(); - test_cast_return_type(); - test_cast_empty(); - test_cast_to_reference<small>(); - test_cast_to_reference<large>(); - test_cast_to_value<small>(); - test_cast_to_value<large>(); - test_non_copyable_ref(); -} diff --git a/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp deleted file mode 100644 index db5149265ccc1..0000000000000 --- a/test/std/experimental/any/any.nonmembers/any.cast/const_correctness.fail.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// template <class ValueType> -// ValueType any_cast(any const &); - -// Try and cast away const. - -#include <experimental/any> - -struct TestType {}; -struct TestType2 {}; - -int main() -{ - using std::experimental::any; - using std::experimental::any_cast; - - any a; - - // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType') to reference to type 'TestType' drops 'const' qualifier}} - any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}} - any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}} - - // expected-error@experimental/any:* 2 {{binding value of type '_Tp' (aka 'const TestType2') to reference to type 'TestType2' drops 'const' qualifier}} - any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}} - any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}} -} diff --git a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp deleted file mode 100644 index 1c52a64fce624..0000000000000 --- a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// template <class ValueType> -// ValueType const any_cast(any const&); -// -// template <class ValueType> -// ValueType any_cast(any &); -// -// template <class ValueType> -// ValueType any_cast(any &&); - -// Test instantiating the any_cast with a non-copyable type. - -#include <experimental/any> - -using std::experimental::any; -using std::experimental::any_cast; - -struct no_copy -{ - no_copy() {} - no_copy(no_copy &&) {} -private: - no_copy(no_copy const &); -}; - -int main() { - any a; - any_cast<no_copy>(static_cast<any&>(a)); - any_cast<no_copy>(static_cast<any const&>(a)); - any_cast<no_copy>(static_cast<any &&>(a)); - // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}} - // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}} -} diff --git a/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp deleted file mode 100644 index edef3d0a42be8..0000000000000 --- a/test/std/experimental/any/any.nonmembers/any.cast/reference_types.fail.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// template <class ValueType> -// ValueType const* any_cast(any const *) noexcept; -// -// template <class ValueType> -// ValueType * any_cast(any *) noexcept; - -#include <experimental/any> - -using std::experimental::any; -using std::experimental::any_cast; - -int main() -{ - any a(1); - any_cast<int &>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int &&>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int const &>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int const&&>(&a); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any const& a2 = a; - any_cast<int &>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int &&>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int const &>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} - any_cast<int const &&>(&a2); // expected-error-re@experimental/any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} -} diff --git a/test/std/experimental/any/any.nonmembers/swap.pass.cpp b/test/std/experimental/any/any.nonmembers/swap.pass.cpp deleted file mode 100644 index e79bc9ef099cd..0000000000000 --- a/test/std/experimental/any/any.nonmembers/swap.pass.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/any> - -// void swap(any &, any &) noexcept - -// swap(...) just wraps any::swap(...). That function is tested elsewhere. - -#include <experimental/any> -#include <cassert> - -using std::experimental::any; -using std::experimental::any_cast; - -int main() -{ - - { // test noexcept - any a; - static_assert(noexcept(swap(a, a)), "swap(any&, any&) must be noexcept"); - } - { - any a1(1); - any a2(2); - - swap(a1, a2); - - // Support testing against system dylibs that don't have bad_any_cast. - assert(*any_cast<int>(&a1) == 2); - assert(*any_cast<int>(&a2) == 1); - } -} diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp deleted file mode 100644 index 9a92f0698ba7c..0000000000000 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.cons.pass.cpp +++ /dev/null @@ -1,97 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// class directory_entry - -// directory_entry() noexcept = default; -// directory_entry(const directory_entry&) = default; -// directory_entry(directory_entry&&) noexcept = default; -// explicit directory_entry(const path); - -#include <experimental/filesystem> -#include <type_traits> -#include <cassert> - -namespace fs = std::experimental::filesystem; - -void test_default_ctor() -{ - using namespace fs; - // Default - { - static_assert(std::is_nothrow_default_constructible<directory_entry>::value, - "directory_entry must have a nothrow default constructor"); - directory_entry e; - assert(e.path() == path()); - } -} - - -void test_copy_ctor() -{ - using namespace fs; - // Copy - { - static_assert(std::is_copy_constructible<directory_entry>::value, - "directory_entry must be copy constructible"); - static_assert(!std::is_nothrow_copy_constructible<directory_entry>::value, - "directory_entry's copy constructor cannot be noexcept"); - const path p("foo/bar/baz"); - const directory_entry e(p); - assert(e.path() == p); - directory_entry e2(e); - assert(e.path() == p); - assert(e2.path() == p); - } - -} - -void test_move_ctor() -{ - using namespace fs; - // Move - { - static_assert(std::is_nothrow_move_constructible<directory_entry>::value, - "directory_entry must be nothrow move constructible"); - const path p("foo/bar/baz"); - directory_entry e(p); - assert(e.path() == p); - directory_entry e2(std::move(e)); - assert(e2.path() == p); - assert(e.path() != p); // Testing moved from state. - } -} - -void test_path_ctor() { - using namespace fs; - { - static_assert(std::is_constructible<directory_entry, const path&>::value, - "directory_entry must be constructible from path"); - static_assert(!std::is_nothrow_constructible<directory_entry, const path&>::value, - "directory_entry constructor should not be noexcept"); - static_assert(!std::is_convertible<path const&, directory_entry>::value, - "directory_entry constructor should be explicit"); - } - { - const path p("foo/bar/baz"); - const directory_entry e(p); - assert(p == e.path()); - } -} - -int main() { - test_default_ctor(); - test_copy_ctor(); - test_move_ctor(); - test_path_ctor(); -} diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp deleted file mode 100644 index 97ecbefac42a9..0000000000000 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.mods.pass.cpp +++ /dev/null @@ -1,113 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// class directory_entry - -// directory_entry& operator=(directory_entry const&) = default; -// directory_entry& operator=(directory_entry&&) noexcept = default; -// void assign(path const&); -// void replace_filename(path const&); - -#include <experimental/filesystem> -#include <type_traits> -#include <cassert> - -namespace fs = std::experimental::filesystem; - -void test_copy_assign_operator() -{ - using namespace fs; - // Copy - { - static_assert(std::is_copy_assignable<directory_entry>::value, - "directory_entry must be copy assignable"); - static_assert(!std::is_nothrow_copy_assignable<directory_entry>::value, - "directory_entry's copy assignment cannot be noexcept"); - const path p("foo/bar/baz"); - const path p2("abc"); - const directory_entry e(p); - directory_entry e2; - assert(e.path() == p && e2.path() == path()); - e2 = e; - assert(e.path() == p && e2.path() == p); - directory_entry e3(p2); - e2 = e3; - assert(e2.path() == p2 && e3.path() == p2); - } -} - - -void test_move_assign_operator() -{ - using namespace fs; - // Copy - { - static_assert(std::is_nothrow_move_assignable<directory_entry>::value, - "directory_entry is noexcept move assignable"); - const path p("foo/bar/baz"); - const path p2("abc"); - directory_entry e(p); - directory_entry e2(p2); - assert(e.path() == p && e2.path() == p2); - e2 = std::move(e); - assert(e2.path() == p); - assert(e.path() != p); // testing moved from state - } -} - -void test_path_assign_method() -{ - using namespace fs; - const path p("foo/bar/baz"); - const path p2("abc"); - directory_entry e(p); - { - static_assert(std::is_same<decltype(e.assign(p)), void>::value, - "return type should be void"); - static_assert(noexcept(e.assign(p)) == false, "operation must not be noexcept"); - } - { - assert(e.path() == p); - e.assign(p2); - assert(e.path() == p2 && e.path() != p); - e.assign(p); - assert(e.path() == p && e.path() != p2); - } -} - -void test_replace_filename_method() -{ - using namespace fs; - const path p("/path/to/foo.exe"); - const path replace("bar.out"); - const path expect("/path/to/bar.out"); - directory_entry e(p); - { - static_assert(noexcept(e.replace_filename(replace)) == false, - "operation cannot be noexcept"); - static_assert(std::is_same<decltype(e.replace_filename(replace)), void>::value, - "operation must return void"); - } - { - assert(e.path() == p); - e.replace_filename(replace); - assert(e.path() == expect); - } -} - -int main() { - test_copy_assign_operator(); - test_move_assign_operator(); - test_path_assign_method(); - test_replace_filename_method(); -} diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp b/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp deleted file mode 100644 index 54c5172ebce46..0000000000000 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/status.pass.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// class directory_entry - -// file_status status() const; -// file_status status(error_code const&) const noexcept; - -#include <experimental/filesystem> -#include <type_traits> -#include <cassert> - -#include "filesystem_test_helper.hpp" - -int main() -{ - using namespace fs; - { - const directory_entry e("foo"); - std::error_code ec; - static_assert(std::is_same<decltype(e.status()), file_status>::value, ""); - static_assert(std::is_same<decltype(e.status(ec)), file_status>::value, ""); - static_assert(noexcept(e.status()) == false, ""); - static_assert(noexcept(e.status(ec)) == true, ""); - } - auto TestFn = [](path const& p) { - const directory_entry e(p); - std::error_code pec, eec; - file_status ps = fs::status(p, pec); - file_status es = e.status(eec); - assert(ps.type() == es.type()); - assert(ps.permissions() == es.permissions()); - assert(pec == eec); - }; - { - TestFn(StaticEnv::File); - TestFn(StaticEnv::Dir); - TestFn(StaticEnv::SymlinkToFile); - TestFn(StaticEnv::DNE); - } -} diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp deleted file mode 100644 index 28e945b689703..0000000000000 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.absolute/absolute.pass.cpp +++ /dev/null @@ -1,117 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// path absolute(const path& p, const path& base=current_path()); - -#include <experimental/filesystem> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" -#include "rapid-cxx-test.hpp" -#include "filesystem_test_helper.hpp" - -using namespace std::experimental::filesystem; - -TEST_SUITE(filesystem_absolute_path_test_suite) - -TEST_CASE(absolute_signature_test) -{ - const path p; ((void)p); - ASSERT_NOT_NOEXCEPT(absolute(p)); - ASSERT_NOT_NOEXCEPT(absolute(p, p)); -} - -// There are 4 cases is the proposal for absolute path. -// Each scope tests one of the cases. -TEST_CASE(absolute_path_test) -{ - // has_root_name() && has_root_directory() - { - const path p("//net/foo"); - const path base("//net/bar/baz"); - TEST_REQUIRE(p.has_root_name()); - TEST_REQUIRE(p.has_root_directory()); - TEST_CHECK(p.is_absolute()); - path ret = absolute(p, base); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret == p); - } - // !has_root_name() && has_root_directory() - { - const path p("/foo"); - const path base("//net/bar"); - TEST_REQUIRE(not p.has_root_name()); - TEST_REQUIRE(p.has_root_directory()); - TEST_CHECK(p.is_absolute()); - // ensure absolute(base) is not recursively called - TEST_REQUIRE(base.has_root_name()); - TEST_REQUIRE(base.has_root_directory()); - - path ret = absolute(p, base); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret.has_root_name()); - TEST_CHECK(ret.root_name() == path("//net")); - TEST_CHECK(ret.has_root_directory()); - TEST_CHECK(ret.root_directory() == path("/")); - TEST_CHECK(ret == path("//net/foo")); - } - // has_root_name() && !has_root_directory() - { - const path p("//net"); - const path base("//net/foo/bar"); - TEST_REQUIRE(p.has_root_name()); - TEST_REQUIRE(not p.has_root_directory()); - TEST_CHECK(not p.is_absolute()); - // absolute is called recursively on base. The following conditions - // must be true for it to return base unmodified - TEST_REQUIRE(base.has_root_name()); - TEST_REQUIRE(base.has_root_directory()); - path ret = absolute(p, base); - const path expect("//net/foo/bar"); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret == path("//net/foo/bar")); - } - // !has_root_name() && !has_root_directory() - { - const path p("bar/baz"); - const path base("//net/foo"); - TEST_REQUIRE(not p.has_root_name()); - TEST_REQUIRE(not p.has_root_directory()); - TEST_REQUIRE(base.has_root_name()); - TEST_REQUIRE(base.has_root_directory()); - - path ret = absolute(p, base); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret == path("//net/foo/bar/baz")); - } -} - -TEST_CASE(absolute_path_with_default_base) -{ - const path testCases[] = { - "//net/foo", // has_root_name() && has_root_directory() - "/foo", // !has_root_name() && has_root_directory() - "//net", // has_root_name() && !has_root_directory() - "bar/baz" // !has_root_name() && !has_root_directory() - }; - const path base = current_path(); - for (auto& p : testCases) { - const path ret = absolute(p); - const path expect = absolute(p, base); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret == expect); - } -} - -TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp deleted file mode 100644 index 8c5241c71af8c..0000000000000 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp +++ /dev/null @@ -1,188 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// bool copy_file(const path& from, const path& to); -// bool copy_file(const path& from, const path& to, error_code& ec) noexcept; -// bool copy_file(const path& from, const path& to, copy_options options); -// bool copy_file(const path& from, const path& to, copy_options options, -// error_code& ec) noexcept; - -#include <experimental/filesystem> -#include <type_traits> -#include <chrono> -#include <cassert> - -#include "test_macros.h" -#include "rapid-cxx-test.hpp" -#include "filesystem_test_helper.hpp" - -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; - -using CO = fs::copy_options; - -TEST_SUITE(filesystem_copy_file_test_suite) - -TEST_CASE(test_signatures) -{ - const path p; ((void)p); - const copy_options opts{}; ((void)opts); - std::error_code ec; ((void)ec); - ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p)), bool); - ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts)), bool); - ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, ec)), bool); - ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts, ec)), bool); - ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p)); - ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts)); - ASSERT_NOEXCEPT(fs::copy_file(p, p, ec)); - ASSERT_NOEXCEPT(fs::copy_file(p, p, opts, ec)); -} - -TEST_CASE(test_error_reporting) -{ - auto checkThrow = [](path const& f, path const& t, const std::error_code& ec) - { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - fs::copy_file(f, t); - return false; - } catch (filesystem_error const& err) { - return err.path1() == f - && err.path2() == t - && err.code() == ec; - } -#else - ((void)f); ((void)t); ((void)ec); - return true; -#endif - }; - - scoped_test_env env; - const path file = env.create_file("file1", 42); - const path file2 = env.create_file("file2", 55); - const path dne = env.make_env_path("dne"); - { // exists(to) && equivalent(to, from) - std::error_code ec; - TEST_CHECK(fs::copy_file(file, file, ec) == false); - TEST_REQUIRE(ec); - TEST_CHECK(checkThrow(file, file, ec)); - } - { // exists(to) && !(skip_existing | overwrite_existing | update_existing) - std::error_code ec; - TEST_CHECK(fs::copy_file(file, file2, ec) == false); - TEST_REQUIRE(ec); - TEST_CHECK(checkThrow(file, file2, ec)); - } -} - -TEST_CASE(copy_file) -{ - scoped_test_env env; - const path file = env.create_file("file1", 42); - - { // !exists(to) - const path dest = env.make_env_path("dest1"); - std::error_code ec; - TEST_REQUIRE(fs::copy_file(file, dest, ec) == true); - TEST_CHECK(!ec); - TEST_CHECK(file_size(dest) == 42); - } - { // exists(to) && overwrite_existing - const path dest = env.create_file("dest2", 55); - std::error_code ec; - TEST_REQUIRE(fs::copy_file(file, dest, - copy_options::overwrite_existing, ec) == true); - TEST_CHECK(!ec); - TEST_CHECK(file_size(dest) == 42); - } - { // exists(to) && update_existing - using Sec = std::chrono::seconds; - const path older = env.create_file("older_file", 1); - - SleepFor(Sec(2)); - const path from = env.create_file("update_from", 55); - - SleepFor(Sec(2)); - const path newer = env.create_file("newer_file", 2); - - std::error_code ec; - TEST_REQUIRE(fs::copy_file(from, older, copy_options::update_existing, ec) == true); - TEST_CHECK(!ec); - TEST_CHECK(file_size(older) == 55); - - TEST_REQUIRE(fs::copy_file(from, newer, copy_options::update_existing, ec) == false); - TEST_CHECK(!ec); - TEST_CHECK(file_size(newer) == 2); - } - { // skip_existing - const path file2 = env.create_file("file2", 55); - std::error_code ec; - TEST_REQUIRE(fs::copy_file(file, file2, copy_options::skip_existing, ec) == false); - TEST_CHECK(!ec); - TEST_CHECK(file_size(file2) == 55); - } -} - -TEST_CASE(test_attributes_get_copied) -{ - scoped_test_env env; - const path file = env.create_file("file1", 42); - const path dest = env.make_env_path("file2"); - auto st = status(file); - perms new_perms = perms::owner_read; - permissions(file, new_perms); - std::error_code ec; - TEST_REQUIRE(fs::copy_file(file, dest, ec) == true); - TEST_CHECK(!ec); - auto new_st = status(dest); - TEST_CHECK(new_st.permissions() == new_perms); -} - -TEST_CASE(copy_dir_test) -{ - scoped_test_env env; - const path file = env.create_file("file1", 42); - const path dest = env.create_dir("dir1"); - std::error_code ec = GetTestEC(); - TEST_CHECK(fs::copy_file(file, dest, ec) == false); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); - ec = GetTestEC(); - TEST_CHECK(fs::copy_file(dest, file, ec) == false); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); -} - -TEST_CASE(non_regular_file_test) -{ - scoped_test_env env; - const path fifo = env.create_fifo("fifo"); - const path dest = env.make_env_path("dest"); - const path file = env.create_file("file", 42); - { - std::error_code ec = GetTestEC(); - TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); - TEST_CHECK(!exists(dest)); - } - { - std::error_code ec = GetTestEC(); - TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing, ec) == false); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); - TEST_CHECK(is_fifo(fifo)); - } -} - -TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp deleted file mode 100644 index cdd177399aa70..0000000000000 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ /dev/null @@ -1,424 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// file_time_type last_write_time(const path& p); -// file_time_type last_write_time(const path& p, std::error_code& ec) noexcept; -// void last_write_time(const path& p, file_time_type new_time); -// void last_write_time(const path& p, file_time_type new_type, -// std::error_code& ec) noexcept; - - -#include <experimental/filesystem> -#include <type_traits> -#include <chrono> -#include <fstream> -#include <cstdlib> - -#include "test_macros.h" -#include "rapid-cxx-test.hpp" -#include "filesystem_test_helper.hpp" - -#include <sys/stat.h> -#include <iostream> - -using namespace std::experimental::filesystem; - - -std::pair<std::time_t, std::time_t> GetTimes(path const& p) { - using Clock = file_time_type::clock; - struct ::stat st; - if (::stat(p.c_str(), &st) == -1) { - std::error_code ec(errno, std::generic_category()); -#ifndef TEST_HAS_NO_EXCEPTIONS - throw ec; -#else - std::cerr << ec.message() << std::endl; - std::exit(EXIT_FAILURE); -#endif - } - return {st.st_atime, st.st_mtime}; -} - -std::time_t LastAccessTime(path const& p) { - return GetTimes(p).first; -} - -std::time_t LastWriteTime(path const& p) { - return GetTimes(p).second; -} - -std::pair<std::time_t, std::time_t> GetSymlinkTimes(path const& p) { - using Clock = file_time_type::clock; - struct ::stat st; - if (::lstat(p.c_str(), &st) == -1) { - std::error_code ec(errno, std::generic_category()); -#ifndef TEST_HAS_NO_EXCEPTIONS - throw ec; -#else - std::cerr << ec.message() << std::endl; - std::exit(EXIT_FAILURE); -#endif - } - return {st.st_atime, st.st_mtime}; -} - -namespace { -bool TestSupportsNegativeTimes() { - using namespace std::chrono; - std::error_code ec; - std::time_t old_write_time, new_write_time; - { // WARNING: Do not assert in this scope. - scoped_test_env env; - const path file = env.create_file("file", 42); - old_write_time = LastWriteTime(file); - file_time_type tp(seconds(-5)); - fs::last_write_time(file, tp, ec); - new_write_time = LastWriteTime(file); - } - return !ec && new_write_time <= -5; -} - -// In some configurations, the comparison is tautological and the test is valid. -// We disable the warning so that we can actually test it regardless. Also, that -// diagnostic is pretty new, so also don't fail if old clang does not support it -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunknown-pragmas" -#pragma clang diagnostic ignored "-Wtautological-constant-compare" -#endif - -bool TestSupportsMaxTime() { - using namespace std::chrono; - using Lim = std::numeric_limits<std::time_t>; - auto max_sec = duration_cast<seconds>(file_time_type::max().time_since_epoch()).count(); - if (max_sec > Lim::max()) return false; - std::error_code ec; - std::time_t old_write_time, new_write_time; - { // WARNING: Do not assert in this scope. - scoped_test_env env; - const path file = env.create_file("file", 42); - old_write_time = LastWriteTime(file); - file_time_type tp = file_time_type::max(); - fs::last_write_time(file, tp, ec); - new_write_time = LastWriteTime(file); - } - return !ec && new_write_time > max_sec - 1; -} - -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - -static const bool SupportsNegativeTimes = TestSupportsNegativeTimes(); -static const bool SupportsMaxTime = TestSupportsMaxTime(); - -} // end namespace - -// In some configurations, the comparison is tautological and the test is valid. -// We disable the warning so that we can actually test it regardless. Also, that -// diagnostic is pretty new, so also don't fail if old clang does not support it -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunknown-warning-option" -#pragma clang diagnostic ignored "-Wunknown-pragmas" -#pragma clang diagnostic ignored "-Wtautological-constant-compare" -#endif - -// Check if a time point is representable on a given filesystem. Check that: -// (A) 'tp' is representable as a time_t -// (B) 'tp' is non-negative or the filesystem supports negative times. -// (C) 'tp' is not 'file_time_type::max()' or the filesystem supports the max -// value. -inline bool TimeIsRepresentableByFilesystem(file_time_type tp) { - using namespace std::chrono; - using Lim = std::numeric_limits<std::time_t>; - auto sec = duration_cast<seconds>(tp.time_since_epoch()).count(); - auto microsec = duration_cast<microseconds>(tp.time_since_epoch()).count(); - if (sec < Lim::min() || sec > Lim::max()) return false; - else if (microsec < 0 && !SupportsNegativeTimes) return false; - else if (tp == file_time_type::max() && !SupportsMaxTime) return false; - return true; -} - -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - -TEST_SUITE(exists_test_suite) - -TEST_CASE(signature_test) -{ - const file_time_type t; - const path p; ((void)p); - std::error_code ec; ((void)ec); - ASSERT_SAME_TYPE(decltype(last_write_time(p)), file_time_type); - ASSERT_SAME_TYPE(decltype(last_write_time(p, ec)), file_time_type); - ASSERT_SAME_TYPE(decltype(last_write_time(p, t)), void); - ASSERT_SAME_TYPE(decltype(last_write_time(p, t, ec)), void); - ASSERT_NOT_NOEXCEPT(last_write_time(p)); - ASSERT_NOT_NOEXCEPT(last_write_time(p, t)); - ASSERT_NOEXCEPT(last_write_time(p, ec)); - ASSERT_NOEXCEPT(last_write_time(p, t, ec)); -} - -TEST_CASE(read_last_write_time_static_env_test) -{ - using C = file_time_type::clock; - file_time_type min = file_time_type::min(); - { - file_time_type ret = last_write_time(StaticEnv::File); - TEST_CHECK(ret != min); - TEST_CHECK(ret < C::now()); - TEST_CHECK(C::to_time_t(ret) == LastWriteTime(StaticEnv::File)); - - file_time_type ret2 = last_write_time(StaticEnv::SymlinkToFile); - TEST_CHECK(ret == ret2); - TEST_CHECK(C::to_time_t(ret2) == LastWriteTime(StaticEnv::SymlinkToFile)); - } - { - file_time_type ret = last_write_time(StaticEnv::Dir); - TEST_CHECK(ret != min); - TEST_CHECK(ret < C::now()); - TEST_CHECK(C::to_time_t(ret) == LastWriteTime(StaticEnv::Dir)); - - file_time_type ret2 = last_write_time(StaticEnv::SymlinkToDir); - TEST_CHECK(ret == ret2); - TEST_CHECK(C::to_time_t(ret2) == LastWriteTime(StaticEnv::SymlinkToDir)); - } -} - -TEST_CASE(get_last_write_time_dynamic_env_test) -{ - using Clock = file_time_type::clock; - using Sec = std::chrono::seconds; - scoped_test_env env; - - const path file = env.create_file("file", 42); - const path dir = env.create_dir("dir"); - - const auto file_times = GetTimes(file); - const std::time_t file_access_time = file_times.first; - const std::time_t file_write_time = file_times.second; - const auto dir_times = GetTimes(dir); - const std::time_t dir_access_time = dir_times.first; - const std::time_t dir_write_time = dir_times.second; - - file_time_type ftime = last_write_time(file); - TEST_CHECK(Clock::to_time_t(ftime) == file_write_time); - - file_time_type dtime = last_write_time(dir); - TEST_CHECK(Clock::to_time_t(dtime) == dir_write_time); - - SleepFor(Sec(2)); - - // update file and add a file to the directory. Make sure the times increase. - std::ofstream of(file, std::ofstream::app); - of << "hello"; - of.close(); - env.create_file("dir/file1", 1); - - file_time_type ftime2 = last_write_time(file); - file_time_type dtime2 = last_write_time(dir); - - TEST_CHECK(ftime2 > ftime); - TEST_CHECK(dtime2 > dtime); - TEST_CHECK(LastAccessTime(file) == file_access_time || - LastAccessTime(file) == Clock::to_time_t(ftime2)); - TEST_CHECK(LastAccessTime(dir) == dir_access_time); -} - - -TEST_CASE(set_last_write_time_dynamic_env_test) -{ - using Clock = file_time_type::clock; - using Sec = std::chrono::seconds; - using Hours = std::chrono::hours; - using Minutes = std::chrono::minutes; - using MicroSec = std::chrono::microseconds; - scoped_test_env env; - - const path file = env.create_file("file", 42); - const path dir = env.create_dir("dir"); - const auto now = Clock::now(); - const file_time_type epoch_time = now - now.time_since_epoch(); - - const file_time_type future_time = now + Hours(3) + Sec(42) + MicroSec(17); - const file_time_type past_time = now - Minutes(3) - Sec(42) - MicroSec(17); - const file_time_type before_epoch_time = epoch_time - Minutes(3) - Sec(42) - MicroSec(17); - // FreeBSD has a bug in their utimes implementation where the time is not update - // when the number of seconds is '-1'. -#if defined(__FreeBSD__) - const file_time_type just_before_epoch_time = epoch_time - Sec(2) - MicroSec(17); -#else - const file_time_type just_before_epoch_time = epoch_time - MicroSec(17); -#endif - - struct TestCase { - path p; - file_time_type new_time; - } cases[] = { - {file, epoch_time}, - {dir, epoch_time}, - {file, future_time}, - {dir, future_time}, - {file, past_time}, - {dir, past_time}, - {file, before_epoch_time}, - {dir, before_epoch_time}, - {file, just_before_epoch_time}, - {dir, just_before_epoch_time} - }; - for (const auto& TC : cases) { - const auto old_times = GetTimes(TC.p); - file_time_type old_time(Sec(old_times.second)); - - std::error_code ec = GetTestEC(); - last_write_time(TC.p, TC.new_time, ec); - TEST_CHECK(!ec); - - file_time_type got_time = last_write_time(TC.p); - - if (TimeIsRepresentableByFilesystem(TC.new_time)) { - TEST_CHECK(got_time != old_time); - if (TC.new_time < epoch_time) { - TEST_CHECK(got_time <= TC.new_time); - TEST_CHECK(got_time > TC.new_time - Sec(1)); - } else { - TEST_CHECK(got_time <= TC.new_time + Sec(1)); - TEST_CHECK(got_time >= TC.new_time - Sec(1)); - } - TEST_CHECK(LastAccessTime(TC.p) == old_times.first); - } - } -} - -TEST_CASE(last_write_time_symlink_test) -{ - using Clock = file_time_type::clock; - using Sec = std::chrono::seconds; - using Hours = std::chrono::hours; - using Minutes = std::chrono::minutes; - - scoped_test_env env; - - const path file = env.create_file("file", 42); - const path sym = env.create_symlink("file", "sym"); - - const file_time_type new_time = Clock::now() + Hours(3); - - const auto old_times = GetTimes(sym); - const auto old_sym_times = GetSymlinkTimes(sym); - - std::error_code ec = GetTestEC(); - last_write_time(sym, new_time, ec); - TEST_CHECK(!ec); - - const std::time_t new_time_t = Clock::to_time_t(new_time); - file_time_type got_time = last_write_time(sym); - std::time_t got_time_t = Clock::to_time_t(got_time); - - TEST_CHECK(got_time_t != old_times.second); - TEST_CHECK(got_time_t == new_time_t); - TEST_CHECK(LastWriteTime(file) == new_time_t); - TEST_CHECK(LastAccessTime(sym) == old_times.first); - TEST_CHECK(GetSymlinkTimes(sym) == old_sym_times); -} - - -TEST_CASE(test_write_min_time) -{ - using Clock = file_time_type::clock; - using Sec = std::chrono::seconds; - using MicroSec = std::chrono::microseconds; - using Lim = std::numeric_limits<std::time_t>; - scoped_test_env env; - const path p = env.create_file("file", 42); - - std::error_code ec = GetTestEC(); - file_time_type new_time = file_time_type::min(); - - last_write_time(p, new_time, ec); - file_time_type tt = last_write_time(p); - - if (TimeIsRepresentableByFilesystem(new_time)) { - TEST_CHECK(!ec); - TEST_CHECK(tt >= new_time); - TEST_CHECK(tt < new_time + Sec(1)); - } - - ec = GetTestEC(); - last_write_time(p, Clock::now()); - - new_time = file_time_type::min() + MicroSec(1); - - last_write_time(p, new_time, ec); - tt = last_write_time(p); - - if (TimeIsRepresentableByFilesystem(new_time)) { - TEST_CHECK(!ec); - TEST_CHECK(tt >= new_time); - TEST_CHECK(tt < new_time + Sec(1)); - } -} - - - -TEST_CASE(test_write_min_max_time) -{ - using Clock = file_time_type::clock; - using Sec = std::chrono::seconds; - using Hours = std::chrono::hours; - using Lim = std::numeric_limits<std::time_t>; - scoped_test_env env; - const path p = env.create_file("file", 42); - - std::error_code ec = GetTestEC(); - file_time_type new_time = file_time_type::max(); - - ec = GetTestEC(); - last_write_time(p, new_time, ec); - file_time_type tt = last_write_time(p); - - if (TimeIsRepresentableByFilesystem(new_time)) { - TEST_CHECK(!ec); - TEST_CHECK(tt > new_time - Sec(1)); - TEST_CHECK(tt <= new_time); - } -} - -TEST_CASE(test_value_on_failure) -{ - const path p = StaticEnv::DNE; - std::error_code ec = GetTestEC(); - TEST_CHECK(last_write_time(p, ec) == file_time_type::min()); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); -} - -TEST_CASE(test_exists_fails) -{ - scoped_test_env env; - const path dir = env.create_dir("dir"); - const path file = env.create_file("dir/file", 42); - permissions(dir, perms::none); - - std::error_code ec = GetTestEC(); - TEST_CHECK(last_write_time(file, ec) == file_time_type::min()); - TEST_CHECK(ec); - TEST_CHECK(ec != GetTestEC()); - - TEST_CHECK_THROW(filesystem_error, last_write_time(file)); -} - -TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp deleted file mode 100644 index 634184e24e6d2..0000000000000 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.system_complete/system_complete.pass.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03 - -// <experimental/filesystem> - -// path system_complete(const path& p); -// path system_complete(const path& p, error_code& ec); - -// Note: For POSIX based operating systems, 'system_complete(p)' has the -// same semantics as 'absolute(p, current_path())'. - -#include <experimental/filesystem> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" -#include "rapid-cxx-test.hpp" -#include "filesystem_test_helper.hpp" - -using namespace std::experimental::filesystem; - -TEST_SUITE(filesystem_system_complete_test_suite) - -TEST_CASE(signature_test) -{ - const path p; ((void)p); - std::error_code ec; ((void)ec); - ASSERT_NOT_NOEXCEPT(system_complete(p)); - ASSERT_NOT_NOEXCEPT(system_complete(p, ec)); -} - - -TEST_CASE(basic_system_complete_tests) -{ - const path testCases[] = { - "//net/foo", // has_root_name() && has_root_directory() - "/foo", // !has_root_name() && has_root_directory() - "//net", // has_root_name() && !has_root_directory() - "bar/baz" // !has_root_name() && !has_root_directory() - }; - const path base = current_path(); - for (auto& p : testCases) { - const path ret = system_complete(p); - const path expect = absolute(p, base); - TEST_CHECK(ret.is_absolute()); - TEST_CHECK(ret == expect); - } -} - -TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp b/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp index d57dff4a7b789..c82d558c110a0 100644 --- a/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp +++ b/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp @@ -7,18 +7,23 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03 - // <experimental/filesystem> // #define __cpp_lib_experimental_filesystem 201406L #include <experimental/filesystem> +#include "test_macros.h" +#if TEST_STD_VER >= 11 #ifndef __cpp_lib_experimental_filesystem #error Filesystem feature test macro is not defined (__cpp_lib_experimental_filesystem) #elif __cpp_lib_experimental_filesystem != 201406L #error Filesystem feature test macro has an incorrect value (__cpp_lib_experimental_filesystem) #endif +#else // TEST_STD_VER < 11 +#ifdef __cpp_lib_experimental_filesystem +#error Filesystem feature test macro should not be defined in c++03 +#endif +#endif int main() { } diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp new file mode 100644 index 0000000000000..030e7af07919e --- /dev/null +++ b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp @@ -0,0 +1,75 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// UNSUPPORTED: ubsan + +// <experimental/coroutine> +// struct noop_coroutine_promise; +// using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; +// noop_coroutine_handle noop_coroutine() noexcept; + +#include <experimental/coroutine> +#include <cassert> +#include <type_traits> + +#if __has_builtin(__builtin_coro_noop) + +namespace coro = std::experimental::coroutines_v1; + + +static_assert(std::is_same<coro::coroutine_handle<coro::noop_coroutine_promise>, coro::noop_coroutine_handle>::value, ""); +static_assert(std::is_same<decltype(coro::noop_coroutine()), coro::noop_coroutine_handle>::value, ""); + +// template <> struct coroutine_handle<noop_coroutine_promise> : coroutine_handle<> +// { +// // 18.11.2.7 noop observers +// constexpr explicit operator bool() const noexcept; +// constexpr bool done() const noexcept; + +// // 18.11.2.8 noop resumption +// constexpr void operator()() const noexcept; +// constexpr void resume() const noexcept; +// constexpr void destroy() const noexcept; + +// // 18.11.2.9 noop promise access +// noop_coroutine_promise& promise() const noexcept; + +// // 18.11.2.10 noop address +// constexpr void* address() const noexcept; + +int main() +{ + auto h = coro::noop_coroutine(); + coro::coroutine_handle<> base = h; + + assert(h); + assert(base); + + assert(!h.done()); + assert(!base.done()); + + h.resume(); + h.destroy(); + h(); + static_assert(h.done() == false, ""); + static_assert(h, ""); + + h.promise(); + assert(h.address() == base.address()); + assert(h.address() != nullptr); + assert(coro::coroutine_handle<>::from_address(h.address()) == base); +} + +#else + +int main() {} + +#endif // __has_builtin(__builtin_coro_noop) diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp index acc42d39f60c5..666d8f7807d43 100644 --- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp @@ -90,6 +90,32 @@ void test_pmr_uses_allocator(std::pair<TT, UU> const& p) assert((doTest<T, U>(UA_AllocArg, UA_None, p))); } } + +template <class Alloc, class TT, class UU> +void test_pmr_not_uses_allocator(std::pair<TT, UU> const& p) +{ + { + using T = NotUsesAllocator<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, p))); + } + { + using T = UsesAllocatorV1<Alloc, 1>; + using U = UsesAllocatorV2<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, p))); + } + { + using T = UsesAllocatorV2<Alloc, 1>; + using U = UsesAllocatorV3<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, p))); + } + { + using T = UsesAllocatorV3<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, p))); + } +} + template <class Tp> struct Print; @@ -103,7 +129,7 @@ int main() int y = 42; const std::pair<int, int&> p(x, y); test_pmr_uses_allocator<ERT>(p); - test_pmr_uses_allocator<PMR>(p); + test_pmr_not_uses_allocator<PMR>(p); test_pmr_uses_allocator<PMA>(p); } { @@ -111,7 +137,7 @@ int main() int y = 42; const std::pair<int&, int&&> p(x, std::move(y)); test_pmr_uses_allocator<ERT>(p); - test_pmr_uses_allocator<PMR>(p); + test_pmr_not_uses_allocator<PMR>(p); test_pmr_uses_allocator<PMA>(p); } } diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp index 05cf82cfbd2b5..9e316991c0224 100644 --- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp @@ -90,6 +90,31 @@ void test_pmr_uses_allocator(std::pair<TT, UU>&& p) } } +template <class Alloc, class TT, class UU> +void test_pmr_not_uses_allocator(std::pair<TT, UU>&& p) +{ + { + using T = NotUsesAllocator<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); + } + { + using T = UsesAllocatorV1<Alloc, 1>; + using U = UsesAllocatorV2<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); + } + { + using T = UsesAllocatorV2<Alloc, 1>; + using U = UsesAllocatorV3<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); + } + { + using T = UsesAllocatorV3<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); + } +} + int main() { using ERT = std::experimental::erased_type; @@ -100,7 +125,7 @@ int main() int y = 42; std::pair<int&, int&&> p(x, std::move(y)); test_pmr_uses_allocator<ERT>(std::move(p)); - test_pmr_uses_allocator<PMR>(std::move(p)); + test_pmr_not_uses_allocator<PMR>(std::move(p)); test_pmr_uses_allocator<PMA>(std::move(p)); } { @@ -108,7 +133,7 @@ int main() int y = 42; std::pair<int&&, int&> p(std::move(x), y); test_pmr_uses_allocator<ERT>(std::move(p)); - test_pmr_uses_allocator<PMR>(std::move(p)); + test_pmr_not_uses_allocator<PMR>(std::move(p)); test_pmr_uses_allocator<PMA>(std::move(p)); } } diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp index 1a76072661d6d..f2f7712a44678 100644 --- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp @@ -93,6 +93,35 @@ void test_pmr_uses_allocator(TT&& t, UU&& u) } } +template <class Alloc, class TT, class UU> +void test_pmr_not_uses_allocator(TT&& t, UU&& u) +{ + { + using T = NotUsesAllocator<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, + std::forward<TT>(t), std::forward<UU>(u)))); + } + { + using T = UsesAllocatorV1<Alloc, 1>; + using U = UsesAllocatorV2<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, + std::forward<TT>(t), std::forward<UU>(u)))); + } + { + using T = UsesAllocatorV2<Alloc, 1>; + using U = UsesAllocatorV3<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, + std::forward<TT>(t), std::forward<UU>(u)))); + } + { + using T = UsesAllocatorV3<Alloc, 1>; + using U = NotUsesAllocator<Alloc, 1>; + assert((doTest<T, U>(UA_None, UA_None, + std::forward<TT>(t), std::forward<UU>(u)))); + } +} + int main() { using ERT = std::experimental::erased_type; @@ -102,14 +131,14 @@ int main() int x = 42; int y = 42; test_pmr_uses_allocator<ERT>(x, std::move(y)); - test_pmr_uses_allocator<PMR>(x, std::move(y)); + test_pmr_not_uses_allocator<PMR>(x, std::move(y)); test_pmr_uses_allocator<PMA>(x, std::move(y)); } { int x = 42; const int y = 42; test_pmr_uses_allocator<ERT>(std::move(x), y); - test_pmr_uses_allocator<PMR>(std::move(x), y); + test_pmr_not_uses_allocator<PMR>(std::move(x), y); test_pmr_uses_allocator<PMA>(std::move(x), y); } } diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp index 8f78521995d8b..27807c1f4ca87 100644 --- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp @@ -83,6 +83,35 @@ void test_pmr_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...> } } +template <class Alloc, class ...TTypes, class ...UTypes> +void test_pmr_not_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...> utuple) +{ + { + using T = NotUsesAllocator<Alloc, sizeof...(TTypes)>; + using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>; + assert((doTest<T, U>(UA_None, UA_None, + std::move(ttuple), std::move(utuple)))); + } + { + using T = UsesAllocatorV1<Alloc, sizeof...(TTypes)>; + using U = UsesAllocatorV2<Alloc, sizeof...(UTypes)>; + assert((doTest<T, U>(UA_None, UA_None, + std::move(ttuple), std::move(utuple)))); + } + { + using T = UsesAllocatorV2<Alloc, sizeof...(TTypes)>; + using U = UsesAllocatorV3<Alloc, sizeof...(UTypes)>; + assert((doTest<T, U>(UA_None, UA_None, + std::move(ttuple), std::move(utuple)))); + } + { + using T = UsesAllocatorV3<Alloc, sizeof...(TTypes)>; + using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>; + assert((doTest<T, U>(UA_None, UA_None, + std::move(ttuple), std::move(utuple)))); + } +} + int main() { using ERT = std::experimental::erased_type; @@ -91,7 +120,7 @@ int main() { std::tuple<> t1; test_pmr_uses_allocator<ERT>(t1, t1); - test_pmr_uses_allocator<PMR>(t1, t1); + test_pmr_not_uses_allocator<PMR>(t1, t1); test_pmr_uses_allocator<PMA>(t1, t1); } { @@ -99,8 +128,8 @@ int main() std::tuple<> t2; test_pmr_uses_allocator<ERT>(t1, t2); test_pmr_uses_allocator<ERT>(t2, t1); - test_pmr_uses_allocator<PMR>(t1, t2); - test_pmr_uses_allocator<PMR>(t2, t1); + test_pmr_not_uses_allocator<PMR>(t1, t2); + test_pmr_not_uses_allocator<PMR>(t2, t1); test_pmr_uses_allocator<PMA>(t1, t2); test_pmr_uses_allocator<PMA>(t2, t1); } @@ -111,8 +140,8 @@ int main() std::tuple<int&, double&&> t2(x, std::move(dx)); test_pmr_uses_allocator<ERT>( t1, std::move(t2)); test_pmr_uses_allocator<ERT>(std::move(t2), t1); - test_pmr_uses_allocator<PMR>( t1, std::move(t2)); - test_pmr_uses_allocator<PMR>(std::move(t2), t1); + test_pmr_not_uses_allocator<PMR>( t1, std::move(t2)); + test_pmr_not_uses_allocator<PMR>(std::move(t2), t1); test_pmr_uses_allocator<PMA>( t1, std::move(t2)); test_pmr_uses_allocator<PMA>(std::move(t2), t1); } @@ -126,8 +155,8 @@ int main() std::tuple<int&, double&&, const char*> t2(x, std::move(dx), s); test_pmr_uses_allocator<ERT>( t1, std::move(t2)); test_pmr_uses_allocator<ERT>(std::move(t2), t1); - test_pmr_uses_allocator<PMR>( t1, std::move(t2)); - test_pmr_uses_allocator<PMR>(std::move(t2), t1); + test_pmr_not_uses_allocator<PMR>( t1, std::move(t2)); + test_pmr_not_uses_allocator<PMR>(std::move(t2), t1); test_pmr_uses_allocator<PMA>( t1, std::move(t2)); test_pmr_uses_allocator<PMA>(std::move(t2), t1); } diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp new file mode 100644 index 0000000000000..7dc8f3aaccaf6 --- /dev/null +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp @@ -0,0 +1,142 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// REQUIRES: c++experimental +// UNSUPPORTED: c++98, c++03 + +// <memory_resource> + +// template <class T> class polymorphic_allocator + +// template <class U1, class U2, class ...Args1, class ...Args2> +// void polymorphic_allocator<T>::construct(pair<U1, U2>*, piecewise_construct_t +// tuple<Args1...>, tuple<Args2...>) + +#include <experimental/memory_resource> +#include <tuple> +#include <type_traits> +#include <utility> +#include <cassert> +#include <cstdlib> + +#include "test_macros.h" + +namespace ex = std::experimental::pmr; + +template <class T> +struct EvilAlloc { + explicit EvilAlloc() : inner_(ex::null_memory_resource()) {} + + EvilAlloc(ex::polymorphic_allocator<T> & a) : inner_(a) {} + EvilAlloc(ex::polymorphic_allocator<T> && a) : inner_(a) {} + EvilAlloc(ex::polymorphic_allocator<T> const & a) = delete; + EvilAlloc(ex::polymorphic_allocator<T> const && a) = delete; + + using value_type = T; + template <class U> EvilAlloc(EvilAlloc<U> const & rhs) : inner_(rhs.inner_) {} + + ex::polymorphic_allocator<T> inner_; +}; + +struct WidgetV0 { + WidgetV0(int v) : value_(v) {} + + bool holds(int v, const ex::polymorphic_allocator<char>&) const { + return value_ == v; + } +private: + int value_; +}; + +struct WidgetV1 { + using allocator_type = EvilAlloc<char>; + + WidgetV1(int v) : value_(v), alloc_() {} + WidgetV1(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {} + + bool holds(int v, const ex::polymorphic_allocator<char>& a) const { + return value_ == v && alloc_.inner_ == a; + } +private: + int value_; + EvilAlloc<char> alloc_; +}; + +struct WidgetV2 { + using allocator_type = EvilAlloc<char>; + + WidgetV2(int v) : value_(v), alloc_() {} + WidgetV2(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {} + + bool holds(int v, ex::polymorphic_allocator<char> a) const { + return value_ == v && alloc_.inner_ == a; + } +private: + int value_; + EvilAlloc<char> alloc_; +}; + +struct WidgetV3 { + using allocator_type = EvilAlloc<char>; + + WidgetV3(int v) : value_(v), alloc_() {} + WidgetV3(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {} + WidgetV3(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {} + + bool holds(int v, ex::polymorphic_allocator<char> a) const { + return value_ == v && alloc_.inner_ == a; + } +private: + int value_; + EvilAlloc<char> alloc_; +}; + +static_assert(std::uses_allocator<WidgetV1, EvilAlloc<char>>::value, ""); +static_assert(std::uses_allocator<WidgetV2, EvilAlloc<char>>::value, ""); +static_assert(std::uses_allocator<WidgetV3, EvilAlloc<char>>::value, ""); +static_assert(std::uses_allocator<WidgetV1, ex::polymorphic_allocator<char>>::value, ""); +static_assert(std::uses_allocator<WidgetV2, ex::polymorphic_allocator<char>>::value, ""); +static_assert(std::uses_allocator<WidgetV3, ex::polymorphic_allocator<char>>::value, ""); + +template<class W1, class W2> +void test_evil() +{ + using PMA = ex::polymorphic_allocator<char>; + PMA pma(ex::new_delete_resource()); + { + using Pair = std::pair<W1, W2>; + void *where = std::malloc(sizeof (Pair)); + Pair *p = (Pair *)where; + pma.construct(p, std::piecewise_construct, std::make_tuple(42), std::make_tuple(42)); + assert(p->first.holds(42, pma)); + assert(p->second.holds(42, pma)); + pma.destroy(p); + std::free(where); + } +} + +int main() +{ + test_evil<WidgetV0, WidgetV0>(); + test_evil<WidgetV0, WidgetV1>(); + test_evil<WidgetV0, WidgetV2>(); + test_evil<WidgetV0, WidgetV3>(); + test_evil<WidgetV1, WidgetV0>(); + test_evil<WidgetV1, WidgetV1>(); + test_evil<WidgetV1, WidgetV2>(); + test_evil<WidgetV1, WidgetV3>(); + test_evil<WidgetV2, WidgetV0>(); + test_evil<WidgetV2, WidgetV1>(); + test_evil<WidgetV2, WidgetV2>(); + test_evil<WidgetV2, WidgetV3>(); + test_evil<WidgetV3, WidgetV0>(); + test_evil<WidgetV3, WidgetV1>(); + test_evil<WidgetV3, WidgetV2>(); + test_evil<WidgetV3, WidgetV3>(); +} diff --git a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp index 3e83173555be0..a619194fec175 100644 --- a/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp +++ b/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp @@ -126,6 +126,39 @@ void test_pmr_uses_alloc(Args&&... args) } } +template <class Alloc, class ...Args> +void test_pmr_not_uses_alloc(Args&&... args) +{ + TestResource R(12435); + ex::memory_resource* M = &R; + { + // NotUsesAllocator provides valid signatures for each uses-allocator + // construction but does not supply the required allocator_type typedef. + // Test that we can call these constructors manually without + // polymorphic_allocator interfering. + using T = NotUsesAllocator<Alloc, sizeof...(Args)>; + assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...)); + assert((doTestUsesAllocV1<T>(M, std::forward<Args>(args)...))); + assert((doTestUsesAllocV2<T>(M, std::forward<Args>(args)...))); + } + { + // Test T(std::allocator_arg_t, Alloc const&, Args...) construction + using T = UsesAllocatorV1<Alloc, sizeof...(Args)>; + assert((doTest<T>(UA_None, std::forward<Args>(args)...))); + } + { + // Test T(Args..., Alloc const&) construction + using T = UsesAllocatorV2<Alloc, sizeof...(Args)>; + assert((doTest<T>(UA_None, std::forward<Args>(args)...))); + } + { + // Test that T(std::allocator_arg_t, Alloc const&, Args...) construction + // is preferred when T(Args..., Alloc const&) is also available. + using T = UsesAllocatorV3<Alloc, sizeof...(Args)>; + assert((doTest<T>(UA_None, std::forward<Args>(args)...))); + } +} + // Test that polymorphic_allocator does not prevent us from manually // doing non-pmr uses-allocator construction. template <class Alloc, class AllocObj, class ...Args> @@ -167,16 +200,16 @@ int main() const int cvalue = 43; { test_pmr_uses_alloc<ET>(); - test_pmr_uses_alloc<PMR>(); + test_pmr_not_uses_alloc<PMR>(); test_pmr_uses_alloc<PMA>(); test_pmr_uses_alloc<ET>(value); - test_pmr_uses_alloc<PMR>(value); + test_pmr_not_uses_alloc<PMR>(value); test_pmr_uses_alloc<PMA>(value); test_pmr_uses_alloc<ET>(cvalue); - test_pmr_uses_alloc<PMR>(cvalue); + test_pmr_not_uses_alloc<PMR>(cvalue); test_pmr_uses_alloc<PMA>(cvalue); test_pmr_uses_alloc<ET>(cvalue, std::move(value)); - test_pmr_uses_alloc<PMR>(cvalue, std::move(value)); + test_pmr_not_uses_alloc<PMR>(cvalue, std::move(value)); test_pmr_uses_alloc<PMA>(cvalue, std::move(value)); } { diff --git a/test/std/experimental/nothing_to_do.pass.cpp b/test/std/experimental/nothing_to_do.pass.cpp index c21f8a701685b..86bf8cc11bb95 100644 --- a/test/std/experimental/nothing_to_do.pass.cpp +++ b/test/std/experimental/nothing_to_do.pass.cpp @@ -7,6 +7,4 @@ // //===----------------------------------------------------------------------===// -#include <experimental/string_view> - int main () {} diff --git a/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp deleted file mode 100644 index 7b2527f22bf41..0000000000000 --- a/test/std/experimental/numeric/numeric.ops.overview/nothing_to_do.pass.cpp +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -#include <experimental/numeric> - -int main () {} diff --git a/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp b/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp deleted file mode 100644 index 7b2527f22bf41..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/nothing_to_do.pass.cpp +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -#include <experimental/numeric> - -int main () {} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp deleted file mode 100644 index c8d6c5367d7ef..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool1.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::gcd(false, 4); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp deleted file mode 100644 index a3a2206fba632..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool2.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::gcd(2, true); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp deleted file mode 100644 index 1f0e8a2b3a2ff..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.bool4.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::gcd<int, const bool>(2, true); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp deleted file mode 100644 index 8b069832aac81..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral1.fail.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::gcd(2.0, 4); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp deleted file mode 100644 index ca9b871ef5e00..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.not_integral2.fail.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::gcd(4, 6.0); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp deleted file mode 100644 index 3f86cfe4c7f06..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.gcd/gcd.pass.cpp +++ /dev/null @@ -1,139 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -#include <experimental/numeric> -#include <cassert> -#include <cstdlib> // for rand() -#include <iostream> - -constexpr struct { - int x; - int y; - int expect; -} Cases[] = { - {0, 0, 0}, - {1, 0, 1}, - {0, 1, 1}, - {1, 1, 1}, - {2, 3, 1}, - {2, 4, 2}, - {36, 17, 1}, - {36, 18, 18} -}; - - -template <typename Input1, typename Input2, typename Output> -constexpr bool test0(Input1 in1, Input2 in2, Output out) -{ - static_assert((std::is_same<Output, decltype(std::experimental::gcd(in1, in2))>::value), "" ); - static_assert((std::is_same<Output, decltype(std::experimental::gcd(in2, in1))>::value), "" ); - return out == std::experimental::gcd(in1, in2) ? true : (std::abort(), false); -} - - -template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int = 0) -{ - using S1 = typename std::make_signed<Input1>::type; - using S2 = typename std::make_signed<Input2>::type; - using U1 = typename std::make_unsigned<Input1>::type; - using U2 = typename std::make_unsigned<Input2>::type; - bool accumulate = true; - for (auto TC : Cases) { - { // Test with two signed types - using Output = std::common_type_t<S1, S2>; - accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect); - } - { // test with two unsigned types - using Output = std::common_type_t<U1, U2>; - accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect); - } - { // Test with mixed signs - using Output = std::common_type_t<S1, U2>; - accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect); - } - { // Test with mixed signs - using Output = std::common_type_t<S2, U1>; - accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect); - } - } - return accumulate; -} - -int main() -{ - auto non_cce = std::rand(); // a value that can't possibly be constexpr - - static_assert(do_test<signed char>(), ""); - static_assert(do_test<short>(), ""); - static_assert(do_test<int>(), ""); - static_assert(do_test<long>(), ""); - static_assert(do_test<long long>(), ""); - - assert(do_test<signed char>(non_cce)); - assert(do_test<short>(non_cce)); - assert(do_test<int>(non_cce)); - assert(do_test<long>(non_cce)); - assert(do_test<long long>(non_cce)); - - static_assert(do_test< int8_t>(), ""); - static_assert(do_test<int16_t>(), ""); - static_assert(do_test<int32_t>(), ""); - static_assert(do_test<int64_t>(), ""); - - assert(do_test< int8_t>(non_cce)); - assert(do_test<int16_t>(non_cce)); - assert(do_test<int32_t>(non_cce)); - assert(do_test<int64_t>(non_cce)); - - static_assert(do_test<signed char, int>(), ""); - static_assert(do_test<int, signed char>(), ""); - static_assert(do_test<short, int>(), ""); - static_assert(do_test<int, short>(), ""); - static_assert(do_test<int, long>(), ""); - static_assert(do_test<long, int>(), ""); - static_assert(do_test<int, long long>(), ""); - static_assert(do_test<long long, int>(), ""); - - assert((do_test<signed char, int>(non_cce))); - assert((do_test<int, signed char>(non_cce))); - assert((do_test<short, int>(non_cce))); - assert((do_test<int, short>(non_cce))); - assert((do_test<int, long>(non_cce))); - assert((do_test<long, int>(non_cce))); - assert((do_test<int, long long>(non_cce))); - assert((do_test<long long, int>(non_cce))); - -// LWG#2792 - { - auto res = std::experimental::gcd((int64_t)1234, (int32_t)-2147483648); - static_assert( std::is_same<decltype(res), std::common_type<int64_t, int32_t>::type>::value, ""); - assert(res == 2); - } -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp deleted file mode 100644 index e4c2ed8bf5396..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool1.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm(false, 4); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp deleted file mode 100644 index 097b23eae6e43..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool2.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm(2, true); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp deleted file mode 100644 index d5e6300818ccb..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool3.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm<volatile bool, int>(false, 4); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp deleted file mode 100644 index d88c490d64bf7..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.bool4.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, -// or if either is (a possibly cv-qualified) bool, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm<int, const bool>(2, true); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp deleted file mode 100644 index d12b35609b1ef..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral1.fail.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm(2.0, 4); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp deleted file mode 100644 index d5731870eb19f..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.not_integral2.fail.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n) - -// Remarks: If either M or N is not an integer type, the program is ill-formed. - -#include <experimental/numeric> - - -int main() -{ - std::experimental::lcm(4, 6.0); -} diff --git a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp deleted file mode 100644 index 211363aeac687..0000000000000 --- a/test/std/experimental/numeric/numeric.ops/numeric.ops.lcm/lcm.pass.cpp +++ /dev/null @@ -1,139 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 -// <numeric> - -// template<class _M, class _N> -// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n) - -#include <experimental/numeric> -#include <cassert> -#include <cstdlib> -#include <iostream> - -constexpr struct { - int x; - int y; - int expect; -} Cases[] = { - {0, 0, 0}, - {1, 0, 0}, - {0, 1, 0}, - {1, 1, 1}, - {2, 3, 6}, - {2, 4, 4}, - {3, 17, 51}, - {36, 18, 36} -}; - -template <typename Input1, typename Input2, typename Output> -constexpr bool test0(Input1 in1, Input2 in2, Output out) -{ - static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input1(0), Input2(0)))>::value), "" ); - static_assert((std::is_same<Output, decltype(std::experimental::lcm(Input2(0), Input1(0)))>::value), "" ); - return out == std::experimental::lcm(in1, in2) ? true : (std::abort(), false); -} - - -template <typename Input1, typename Input2 = Input1> -constexpr bool do_test(int = 0) -{ - using S1 = typename std::make_signed<Input1>::type; - using S2 = typename std::make_signed<Input2>::type; - using U1 = typename std::make_unsigned<Input1>::type; - using U2 = typename std::make_unsigned<Input2>::type; - bool accumulate = true; - for (auto TC : Cases) { - { // Test with two signed types - using Output = std::common_type_t<S1, S2>; - accumulate &= test0<S1, S2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(TC.x, -TC.y, TC.expect); - accumulate &= test0<S1, S2, Output>(-TC.x, -TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(TC.x, -TC.y, TC.expect); - accumulate &= test0<S2, S1, Output>(-TC.x, -TC.y, TC.expect); - } - { // test with two unsigned types - using Output = std::common_type_t<U1, U2>; - accumulate &= test0<U1, U2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U2, U1, Output>(TC.x, TC.y, TC.expect); - } - { // Test with mixed signs - using Output = std::common_type_t<S1, U2>; - accumulate &= test0<S1, U2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U2, S1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S1, U2, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<U2, S1, Output>(TC.x, -TC.y, TC.expect); - } - { // Test with mixed signs - using Output = std::common_type_t<S2, U1>; - accumulate &= test0<S2, U1, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<U1, S2, Output>(TC.x, TC.y, TC.expect); - accumulate &= test0<S2, U1, Output>(-TC.x, TC.y, TC.expect); - accumulate &= test0<U1, S2, Output>(TC.x, -TC.y, TC.expect); - } - } - return accumulate; -} - -int main() -{ - auto non_cce = std::rand(); // a value that can't possibly be constexpr - - static_assert(do_test<signed char>(), ""); - static_assert(do_test<short>(), ""); - static_assert(do_test<int>(), ""); - static_assert(do_test<long>(), ""); - static_assert(do_test<long long>(), ""); - - assert(do_test<signed char>(non_cce)); - assert(do_test<short>(non_cce)); - assert(do_test<int>(non_cce)); - assert(do_test<long>(non_cce)); - assert(do_test<long long>(non_cce)); - - static_assert(do_test< int8_t>(), ""); - static_assert(do_test<int16_t>(), ""); - static_assert(do_test<int32_t>(), ""); - static_assert(do_test<int64_t>(), ""); - - assert(do_test< int8_t>(non_cce)); - assert(do_test<int16_t>(non_cce)); - assert(do_test<int32_t>(non_cce)); - assert(do_test<int64_t>(non_cce)); - - static_assert(do_test<signed char, int>(), ""); - static_assert(do_test<int, signed char>(), ""); - static_assert(do_test<short, int>(), ""); - static_assert(do_test<int, short>(), ""); - static_assert(do_test<int, long>(), ""); - static_assert(do_test<long, int>(), ""); - static_assert(do_test<int, long long>(), ""); - static_assert(do_test<long long, int>(), ""); - - assert((do_test<signed char, int>(non_cce))); - assert((do_test<int, signed char>(non_cce))); - assert((do_test<short, int>(non_cce))); - assert((do_test<int, short>(non_cce))); - assert((do_test<int, long>(non_cce))); - assert((do_test<long, int>(non_cce))); - assert((do_test<int, long long>(non_cce))); - assert((do_test<long long, int>(non_cce))); - -// LWG#2792 - { - auto res1 = std::experimental::lcm((int64_t)1234, (int32_t)-2147483648); - (void) std::experimental::lcm<int, unsigned long>(INT_MIN, 2); // this used to trigger UBSAN - static_assert( std::is_same<decltype(res1), std::common_type<int64_t, int32_t>::type>::value, ""); - assert(res1 == 1324997410816LL); - } -} diff --git a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp deleted file mode 100644 index f269149829d2b..0000000000000 --- a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// XFAIL: availability=macosx10.12 -// XFAIL: availability=macosx10.11 -// XFAIL: availability=macosx10.10 -// XFAIL: availability=macosx10.9 -// XFAIL: availability=macosx10.8 -// XFAIL: availability=macosx10.7 - -// <optional> - -// class bad_optional_access is default constructible - -#include <experimental/optional> -#include <type_traits> - -int main() -{ - using std::experimental::bad_optional_access; - bad_optional_access ex; -} diff --git a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp deleted file mode 100644 index a4af713a3910b..0000000000000 --- a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// XFAIL: availability_markup=macosx10.12 -// XFAIL: availability_markup=macosx10.11 -// XFAIL: availability_markup=macosx10.10 -// XFAIL: availability_markup=macosx10.9 -// XFAIL: availability_markup=macosx10.8 -// XFAIL: availability_markup=macosx10.7 - -// <optional> - -// class bad_optional_access : public logic_error - -#include <experimental/optional> -#include <type_traits> - -int main() -{ - using std::experimental::bad_optional_access; - - static_assert(std::is_base_of<std::logic_error, bad_optional_access>::value, ""); - static_assert(std::is_convertible<bad_optional_access*, std::logic_error*>::value, ""); -} diff --git a/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp deleted file mode 100644 index 749fa7dcf0a1e..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator==(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator==(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator == ( const X &lhs, const X &rhs ) - { return lhs.i_ == rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( !(o1 == T(1)), "" ); - static_assert ( (o2 == T(1)), "" ); - static_assert ( !(o3 == T(1)), "" ); - static_assert ( (o3 == T(2)), "" ); - static_assert ( (o3 == val), "" ); - - static_assert ( !(T(1) == o1), "" ); - static_assert ( (T(1) == o2), "" ); - static_assert ( !(T(1) == o3), "" ); - static_assert ( (T(2) == o3), "" ); - static_assert ( (val == o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp deleted file mode 100644 index c4d95a1c878ff..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator>(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator>(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( !(o1 > T(1)), "" ); - static_assert ( !(o2 > T(1)), "" ); // equal - static_assert ( (o3 > T(1)), "" ); - static_assert ( !(o2 > val), "" ); - static_assert ( !(o3 > val), "" ); // equal - static_assert ( !(o3 > T(3)), "" ); - - static_assert ( (T(1) > o1), "" ); - static_assert ( !(T(1) > o2), "" ); // equal - static_assert ( !(T(1) > o3), "" ); - static_assert ( (val > o2), "" ); - static_assert ( !(val > o3), "" ); // equal - static_assert ( (T(3) > o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp deleted file mode 100644 index ce1cd9f984812..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator>=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator>=(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( !(o1 >= T(1)), "" ); - static_assert ( (o2 >= T(1)), "" ); // equal - static_assert ( (o3 >= T(1)), "" ); - static_assert ( !(o2 >= val), "" ); - static_assert ( (o3 >= val), "" ); // equal - static_assert ( !(o3 >= T(3)), "" ); - - static_assert ( (T(1) >= o1), "" ); - static_assert ( (T(1) >= o2), "" ); // equal - static_assert ( !(T(1) >= o3), "" ); - static_assert ( (val >= o2), "" ); - static_assert ( (val >= o3), "" ); // equal - static_assert ( (T(3) >= o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp deleted file mode 100644 index c519bde1e9f29..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator<=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator<=(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( (o1 <= T(1)), "" ); - static_assert ( (o2 <= T(1)), "" ); // equal - static_assert ( !(o3 <= T(1)), "" ); - static_assert ( (o2 <= val), "" ); - static_assert ( (o3 <= val), "" ); // equal - static_assert ( (o3 <= T(3)), "" ); - - static_assert ( !(T(1) <= o1), "" ); - static_assert ( (T(1) <= o2), "" ); // equal - static_assert ( (T(1) <= o3), "" ); - static_assert ( !(val <= o2), "" ); - static_assert ( (val <= o3), "" ); // equal - static_assert ( !(T(3) <= o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp deleted file mode 100644 index ee1e98f2b8c9d..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator<(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator<(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( (o1 < T(1)), "" ); - static_assert ( !(o2 < T(1)), "" ); // equal - static_assert ( !(o3 < T(1)), "" ); - static_assert ( (o2 < val), "" ); - static_assert ( !(o3 < val), "" ); // equal - static_assert ( (o3 < T(3)), "" ); - - static_assert ( !(T(1) < o1), "" ); - static_assert ( !(T(1) < o2), "" ); // equal - static_assert ( (T(1) < o3), "" ); - static_assert ( !(val < o2), "" ); - static_assert ( !(val < o3), "" ); // equal - static_assert ( !(T(3) < o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp b/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp deleted file mode 100644 index a3daa02d5dbb2..0000000000000 --- a/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator!=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator!=(const T& v, const optional<T>& x); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator == ( const X &lhs, const X &rhs ) - { return lhs.i_ == rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr T val(2); - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - constexpr O o3{val}; // engaged - - static_assert ( (o1 != T(1)), "" ); - static_assert ( !(o2 != T(1)), "" ); - static_assert ( (o3 != T(1)), "" ); - static_assert ( !(o3 != T(2)), "" ); - static_assert ( !(o3 != val), "" ); - - static_assert ( (T(1) != o1), "" ); - static_assert ( !(T(1) != o2), "" ); - static_assert ( (T(1) != o3), "" ); - static_assert ( !(T(2) != o3), "" ); - static_assert ( !(val != o3), "" ); - } -} diff --git a/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp b/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b643a..0000000000000 --- a/test/std/experimental/optional/optional.general/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/test/std/experimental/optional/optional.hash/hash.pass.cpp b/test/std/experimental/optional/optional.hash/hash.pass.cpp deleted file mode 100644 index 21126740bf860..0000000000000 --- a/test/std/experimental/optional/optional.hash/hash.pass.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> struct hash<optional<T>>; - -#include <experimental/optional> -#include <string> -#include <memory> -#include <cassert> - - -int main() -{ - using std::experimental::optional; - - { - typedef int T; - optional<T> opt; - assert(std::hash<optional<T>>{}(opt) == 0); - opt = 2; - assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); - } - { - typedef std::string T; - optional<T> opt; - assert(std::hash<optional<T>>{}(opt) == 0); - opt = std::string("123"); - assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); - } - { - typedef std::unique_ptr<int> T; - optional<T> opt; - assert(std::hash<optional<T>>{}(opt) == 0); - opt = std::unique_ptr<int>(new int(3)); - assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); - } -} diff --git a/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp b/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp deleted file mode 100644 index b63977bb69ff2..0000000000000 --- a/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// struct in_place_t{}; -// constexpr in_place_t in_place{}; - -#include <experimental/optional> -#include <type_traits> - -using std::experimental::optional; -using std::experimental::in_place_t; -using std::experimental::in_place; - -constexpr -int -test(const in_place_t&) -{ - return 3; -} - -int main() -{ - static_assert((std::is_class<in_place_t>::value), ""); - static_assert((std::is_empty<in_place_t>::value), ""); - - static_assert(test(in_place) == 3, ""); -} diff --git a/test/std/experimental/optional/optional.nullops/equal.pass.cpp b/test/std/experimental/optional/optional.nullops/equal.pass.cpp deleted file mode 100644 index 79a5a7e06fa46..0000000000000 --- a/test/std/experimental/optional/optional.nullops/equal.pass.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( (nullopt == o1), "" ); - static_assert ( !(nullopt == o2), "" ); - static_assert ( (o1 == nullopt), "" ); - static_assert ( !(o2 == nullopt), "" ); - - static_assert (noexcept(nullopt == o1), ""); - static_assert (noexcept(o1 == nullopt), ""); - } -} diff --git a/test/std/experimental/optional/optional.nullops/greater.pass.cpp b/test/std/experimental/optional/optional.nullops/greater.pass.cpp deleted file mode 100644 index 15b22005b830a..0000000000000 --- a/test/std/experimental/optional/optional.nullops/greater.pass.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator>(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( !(nullopt > o1), "" ); - static_assert ( !(nullopt > o2), "" ); - static_assert ( !(o1 > nullopt), "" ); - static_assert ( (o2 > nullopt), "" ); - - static_assert (noexcept(nullopt > o1), ""); - static_assert (noexcept(o1 > nullopt), ""); - } -} diff --git a/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp deleted file mode 100644 index 313770ff408e2..0000000000000 --- a/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator>=(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( (nullopt >= o1), "" ); - static_assert ( !(nullopt >= o2), "" ); - static_assert ( (o1 >= nullopt), "" ); - static_assert ( (o2 >= nullopt), "" ); - - static_assert (noexcept(nullopt >= o1), ""); - static_assert (noexcept(o1 >= nullopt), ""); - } -} diff --git a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp deleted file mode 100644 index ac7be156c69ca..0000000000000 --- a/test/std/experimental/optional/optional.nullops/less_equal.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <optional> - -// template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator<=(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -#include "test_macros.h" - -int main() -{ -#if TEST_STD_VER > 11 - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( (nullopt <= o1), "" ); - static_assert ( (nullopt <= o2), "" ); - static_assert ( (o1 <= nullopt), "" ); - static_assert ( !(o2 <= nullopt), "" ); - - static_assert (noexcept(nullopt <= o1), ""); - static_assert (noexcept(o1 <= nullopt), ""); - } -#endif -} diff --git a/test/std/experimental/optional/optional.nullops/less_than.pass.cpp b/test/std/experimental/optional/optional.nullops/less_than.pass.cpp deleted file mode 100644 index fdb400700d832..0000000000000 --- a/test/std/experimental/optional/optional.nullops/less_than.pass.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator<(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( !(nullopt < o1), "" ); - static_assert ( (nullopt < o2), "" ); - static_assert ( !(o1 < nullopt), "" ); - static_assert ( !(o2 < nullopt), "" ); - - static_assert (noexcept(nullopt < o1), ""); - static_assert (noexcept(o1 < nullopt), ""); - } -} diff --git a/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp b/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp deleted file mode 100644 index 70ae0f1d885ca..0000000000000 --- a/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept; -// template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) noexcept; - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - { - typedef int T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2{1}; // engaged - - static_assert ( !(nullopt != o1), "" ); - static_assert ( (nullopt != o2), "" ); - static_assert ( !(o1 != nullopt), "" ); - static_assert ( (o2 != nullopt), "" ); - - static_assert (noexcept(nullopt != o1), ""); - static_assert (noexcept(o1 != nullopt), ""); - } -} diff --git a/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp deleted file mode 100644 index 8ad49c7485d0e..0000000000000 --- a/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// struct nullopt_t{see below}; -// constexpr nullopt_t nullopt(unspecified); - -#include <experimental/optional> -#include <type_traits> - -using std::experimental::optional; -using std::experimental::nullopt_t; -using std::experimental::nullopt; - -constexpr -int -test(const nullopt_t&) -{ - return 3; -} - -int main() -{ - static_assert((std::is_class<nullopt_t>::value), ""); - static_assert((std::is_empty<nullopt_t>::value), ""); - static_assert((std::is_literal_type<nullopt_t>::value), ""); - static_assert((!std::is_default_constructible<nullopt_t>::value), ""); - - static_assert(test(nullopt) == 3, ""); -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp deleted file mode 100644 index 0215417ce0b26..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class U> optional<T>& operator=(U&& v); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> -#include <memory> - -using std::experimental::optional; - -struct AllowConstAssign { - AllowConstAssign() {} - AllowConstAssign(AllowConstAssign const&) {} - AllowConstAssign const& operator=(AllowConstAssign const&) const { - return *this; - } -}; - -struct X -{ -}; - -int main() -{ - static_assert(std::is_assignable<optional<int>, int>::value, ""); - static_assert(std::is_assignable<optional<int>, int&>::value, ""); - static_assert(std::is_assignable<optional<int>&, int>::value, ""); - static_assert(std::is_assignable<optional<int>&, int&>::value, ""); - static_assert(std::is_assignable<optional<int>&, const int&>::value, ""); - static_assert(!std::is_assignable<const optional<int>&, const int&>::value, ""); - static_assert(!std::is_assignable<optional<int>, X>::value, ""); - { - optional<int> opt; - opt = 1; - assert(static_cast<bool>(opt) == true); - assert(*opt == 1); - } - { - optional<int> opt; - const int i = 2; - opt = i; - assert(static_cast<bool>(opt) == true); - assert(*opt == i); - } - { - optional<int> opt(3); - const int i = 2; - opt = i; - assert(static_cast<bool>(opt) == true); - assert(*opt == i); - } - { - optional<const AllowConstAssign> opt; - const AllowConstAssign other; - opt = other; - } - { - optional<std::unique_ptr<int>> opt; - opt = std::unique_ptr<int>(new int(3)); - assert(static_cast<bool>(opt) == true); - assert(**opt == 3); - } - { - optional<std::unique_ptr<int>> opt(std::unique_ptr<int>(new int(2))); - opt = std::unique_ptr<int>(new int(3)); - assert(static_cast<bool>(opt) == true); - assert(**opt == 3); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp deleted file mode 100644 index 17ee9754531fe..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// optional<T>& operator=(const optional<T>& rhs); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -struct AllowConstAssign { - AllowConstAssign(AllowConstAssign const&) {} - AllowConstAssign const& operator=(AllowConstAssign const&) const { - return *this; - } -}; - -struct X -{ - static bool throw_now; - - X() = default; - X(const X&) - { - if (throw_now) - TEST_THROW(6); - } -}; - -bool X::throw_now = false; - -int main() -{ - { - optional<int> opt; - constexpr optional<int> opt2; - opt = opt2; - static_assert(static_cast<bool>(opt2) == false, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - } - { - optional<const AllowConstAssign> opt; - optional<const AllowConstAssign> opt2; - opt = opt2; - } - { - optional<int> opt; - constexpr optional<int> opt2(2); - opt = opt2; - static_assert(static_cast<bool>(opt2) == true, ""); - static_assert(*opt2 == 2, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - assert(*opt == *opt2); - } - { - optional<int> opt(3); - constexpr optional<int> opt2; - opt = opt2; - static_assert(static_cast<bool>(opt2) == false, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - } - { - optional<int> opt(3); - constexpr optional<int> opt2(2); - opt = opt2; - static_assert(static_cast<bool>(opt2) == true, ""); - static_assert(*opt2 == 2, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - assert(*opt == *opt2); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - optional<X> opt; - optional<X> opt2(X{}); - assert(static_cast<bool>(opt2) == true); - try - { - X::throw_now = true; - opt = opt2; - assert(false); - } - catch (int i) - { - assert(i == 6); - assert(static_cast<bool>(opt) == false); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp deleted file mode 100644 index 256396094a90d..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp +++ /dev/null @@ -1,153 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class... Args> void optional<T>::emplace(Args&&... args); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> -#include <memory> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; - int j_ = 0; -public: - X() : i_(0) {} - X(int i) : i_(i) {} - X(int i, int j) : i_(i), j_(j) {} - - friend bool operator==(const X& x, const X& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Y -{ -public: - static bool dtor_called; - Y() = default; - ~Y() {dtor_called = true;} -}; - -bool Y::dtor_called = false; - -class Z -{ -public: - static bool dtor_called; - Z() = default; - Z(int) {TEST_THROW(6);} - ~Z() {dtor_called = true;} -}; - -bool Z::dtor_called = false; - -int main() -{ - { - optional<int> opt; - opt.emplace(); - assert(static_cast<bool>(opt) == true); - assert(*opt == 0); - } - { - optional<int> opt; - opt.emplace(1); - assert(static_cast<bool>(opt) == true); - assert(*opt == 1); - } - { - optional<int> opt(2); - opt.emplace(); - assert(static_cast<bool>(opt) == true); - assert(*opt == 0); - } - { - optional<int> opt(2); - opt.emplace(1); - assert(static_cast<bool>(opt) == true); - assert(*opt == 1); - } - { - optional<const int> opt(2); - opt.emplace(1); - assert(static_cast<bool>(opt) == true); - assert(*opt == 1); - } - { - optional<X> opt; - opt.emplace(); - assert(static_cast<bool>(opt) == true); - assert(*opt == X()); - } - { - optional<X> opt; - opt.emplace(1); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(1)); - } - { - optional<X> opt; - opt.emplace(1, 2); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(1, 2)); - } - { - optional<X> opt(X{3}); - opt.emplace(); - assert(static_cast<bool>(opt) == true); - assert(*opt == X()); - } - { - optional<X> opt(X{3}); - opt.emplace(1); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(1)); - } - { - optional<X> opt(X{3}); - opt.emplace(1, 2); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(1, 2)); - } - { - Y y; - { - optional<Y> opt(y); - assert(Y::dtor_called == false); - opt.emplace(); - assert(Y::dtor_called == true); - } - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - Z z; - optional<Z> opt(z); - try - { - assert(static_cast<bool>(opt) == true); - assert(Z::dtor_called == false); - opt.emplace(1); - } - catch (int i) - { - assert(i == 6); - assert(static_cast<bool>(opt) == false); - assert(Z::dtor_called == true); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp deleted file mode 100644 index 8a265808a3c32..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp +++ /dev/null @@ -1,126 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class U, class... Args> -// void optional<T>::emplace(initializer_list<U> il, Args&&... args); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> -#include <vector> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; - int j_ = 0; -public: - static bool dtor_called; - constexpr X() : i_(0) {} - constexpr X(int i) : i_(i) {} - constexpr X(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {} - ~X() {dtor_called = true;} - - friend constexpr bool operator==(const X& x, const X& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -bool X::dtor_called = false; - -class Y -{ - int i_; - int j_ = 0; -public: - constexpr Y() : i_(0) {} - constexpr Y(int i) : i_(i) {} - constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {} - - friend constexpr bool operator==(const Y& x, const Y& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Z -{ - int i_; - int j_ = 0; -public: - static bool dtor_called; - constexpr Z() : i_(0) {} - constexpr Z(int i) : i_(i) {} - Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) - {TEST_THROW(6);} - ~Z() {dtor_called = true;} - - friend constexpr bool operator==(const Z& x, const Z& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -bool Z::dtor_called = false; - -int main() -{ - { - X x; - { - optional<X> opt(x); - assert(X::dtor_called == false); - opt.emplace({1, 2}); - assert(X::dtor_called == true); - assert(*opt == X({1, 2})); - } - } - X::dtor_called = false; - { - X x; - { - optional<const X> opt(x); - assert(X::dtor_called == false); - opt.emplace({1, 2}); - assert(X::dtor_called == true); - assert(*opt == X({1, 2})); - } - } - { - optional<std::vector<int>> opt; - opt.emplace({1, 2, 3}, std::allocator<int>()); - assert(static_cast<bool>(opt) == true); - assert(*opt == std::vector<int>({1, 2, 3})); - } - { - optional<Y> opt; - opt.emplace({1, 2}); - assert(static_cast<bool>(opt) == true); - assert(*opt == Y({1, 2})); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - Z z; - optional<Z> opt(z); - try - { - assert(static_cast<bool>(opt) == true); - assert(Z::dtor_called == false); - opt.emplace({1, 2}); - } - catch (int i) - { - assert(i == 6); - assert(static_cast<bool>(opt) == false); - assert(Z::dtor_called == true); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp deleted file mode 100644 index 4e2aca978865b..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp +++ /dev/null @@ -1,114 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// optional<T>& operator=(optional<T>&& rhs) -// noexcept(is_nothrow_move_assignable<T>::value && -// is_nothrow_move_constructible<T>::value); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -struct AllowConstAssign { - AllowConstAssign(AllowConstAssign const&) {} - AllowConstAssign const& operator=(AllowConstAssign const&) const { - return *this; - } -}; - -struct X -{ - static bool throw_now; - - X() = default; - X(X&&) - { - if (throw_now) - TEST_THROW(6); - } - X& operator=(X&&) noexcept - { - return *this; - } -}; - -bool X::throw_now = false; - -struct Y {}; - -int main() -{ - { - static_assert(std::is_nothrow_move_assignable<optional<int>>::value, ""); - optional<int> opt; - constexpr optional<int> opt2; - opt = std::move(opt2); - static_assert(static_cast<bool>(opt2) == false, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - } - { - optional<int> opt; - constexpr optional<int> opt2(2); - opt = std::move(opt2); - static_assert(static_cast<bool>(opt2) == true, ""); - static_assert(*opt2 == 2, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - assert(*opt == *opt2); - } - { - optional<int> opt(3); - constexpr optional<int> opt2; - opt = std::move(opt2); - static_assert(static_cast<bool>(opt2) == false, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - } - { - optional<int> opt(3); - constexpr optional<int> opt2(2); - opt = std::move(opt2); - static_assert(static_cast<bool>(opt2) == true, ""); - static_assert(*opt2 == 2, ""); - assert(static_cast<bool>(opt) == static_cast<bool>(opt2)); - assert(*opt == *opt2); - } - { - optional<const AllowConstAssign> opt; - optional<const AllowConstAssign> opt2; - opt = std::move(opt2); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - static_assert(!std::is_nothrow_move_assignable<optional<X>>::value, ""); - optional<X> opt; - optional<X> opt2(X{}); - assert(static_cast<bool>(opt2) == true); - try - { - X::throw_now = true; - opt = std::move(opt2); - assert(false); - } - catch (int i) - { - assert(i == 6); - assert(static_cast<bool>(opt) == false); - } - } -#endif - { - static_assert(std::is_nothrow_move_assignable<optional<Y>>::value, ""); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp deleted file mode 100644 index b1d851b32f4cd..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// optional<T>& operator=(nullopt_t) noexcept; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; -using std::experimental::nullopt_t; -using std::experimental::nullopt; - -struct X -{ - static bool dtor_called; - ~X() {dtor_called = true;} -}; - -bool X::dtor_called = false; - -int main() -{ - { - optional<int> opt; - static_assert(noexcept(opt = nullopt) == true, ""); - opt = nullopt; - assert(static_cast<bool>(opt) == false); - } - { - optional<int> opt(3); - opt = nullopt; - assert(static_cast<bool>(opt) == false); - } - { - optional<X> opt; - static_assert(noexcept(opt = nullopt) == true, ""); - assert(X::dtor_called == false); - opt = nullopt; - assert(X::dtor_called == false); - assert(static_cast<bool>(opt) == false); - } - { - X x; - { - optional<X> opt(x); - assert(X::dtor_called == false); - opt = nullopt; - assert(X::dtor_called == true); - assert(static_cast<bool>(opt) == false); - } - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp deleted file mode 100644 index 6371dcb4e51c0..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp +++ /dev/null @@ -1,116 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 - -// <optional> - -// constexpr optional(const T& v); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; -public: - X(int i) : i_(i) {} - - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -class Y -{ - int i_; -public: - constexpr Y(int i) : i_(i) {} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} -}; - -class Z -{ -public: - Z(int) {} - Z(const Z&) {TEST_THROW(6);} -}; - - -int main() -{ - { - typedef int T; - constexpr T t(5); - constexpr optional<T> opt(t); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 5, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(const T&) {} - }; - - } - { - typedef double T; - constexpr T t(3); - constexpr optional<T> opt(t); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 3, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(const T&) {} - }; - - } - { - typedef X T; - const T t(3); - optional<T> opt(t); - assert(static_cast<bool>(opt) == true); - assert(*opt == 3); - } - { - typedef Y T; - constexpr T t(3); - constexpr optional<T> opt(t); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 3, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(const T&) {} - }; - - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - typedef Z T; - try - { - const T t(3); - optional<T> opt(t); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp deleted file mode 100644 index 4b66fe80bbb2d..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp +++ /dev/null @@ -1,139 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// optional(const optional<T>& rhs); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -template <class T> -void -test(const optional<T>& rhs, bool is_going_to_throw = false) -{ - bool rhs_engaged = static_cast<bool>(rhs); -#ifdef TEST_HAS_NO_EXCEPTIONS - if (is_going_to_throw) - return; -#else - try -#endif - { - optional<T> lhs = rhs; - assert(is_going_to_throw == false); - assert(static_cast<bool>(lhs) == rhs_engaged); - if (rhs_engaged) - assert(*lhs == *rhs); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (int i) - { - assert(i == 6); - assert(is_going_to_throw); - } -#endif -} - -class X -{ - int i_; -public: - X(int i) : i_(i) {} - X(const X& x) : i_(x.i_) {} - ~X() {i_ = 0;} - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -class Y -{ - int i_; -public: - Y(int i) : i_(i) {} - Y(const Y& x) : i_(x.i_) {} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} -}; - -int count = 0; - -class Z -{ - int i_; -public: - Z(int i) : i_(i) {} - Z(const Z&) - { - if (++count == 2) - TEST_THROW(6); - } - - friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} -}; - - -int main() -{ - { - typedef int T; - optional<T> rhs; - test(rhs); - } - { - typedef int T; - optional<T> rhs(3); - test(rhs); - } - { - typedef const int T; - optional<T> rhs(3); - test(rhs); - } - { - typedef X T; - optional<T> rhs; - test(rhs); - } - { - typedef X T; - optional<T> rhs(X(3)); - test(rhs); - } - { - typedef const X T; - optional<T> rhs(X(3)); - test(rhs); - } - { - typedef Y T; - optional<T> rhs; - test(rhs); - } - { - typedef Y T; - optional<T> rhs(Y(3)); - test(rhs); - } - { - typedef Z T; - optional<T> rhs; - test(rhs); - } - { - typedef Z T; - optional<T> rhs(Z(3)); - test(rhs, true); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp deleted file mode 100644 index d24a1ac69b866..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// constexpr optional() noexcept; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -template <class Opt> -void -test_constexpr() -{ - static_assert(std::is_nothrow_default_constructible<Opt>::value, ""); - constexpr Opt opt; - static_assert(static_cast<bool>(opt) == false, ""); - - struct test_constexpr_ctor - : public Opt - { - constexpr test_constexpr_ctor() {} - }; - -} - -template <class Opt> -void -test() -{ - static_assert(std::is_nothrow_default_constructible<Opt>::value, ""); - Opt opt; - assert(static_cast<bool>(opt) == false); - - struct test_constexpr_ctor - : public Opt - { - constexpr test_constexpr_ctor() {} - }; -} - -struct X -{ - X(); -}; - -int main() -{ - test_constexpr<optional<int>>(); - test_constexpr<optional<int*>>(); - test<optional<X>>(); -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp deleted file mode 100644 index c46407896576a..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp +++ /dev/null @@ -1,144 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 - -// <optional> - -// template <class... Args> -// constexpr explicit optional(in_place_t, Args&&... args); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; -using std::experimental::in_place_t; -using std::experimental::in_place; - -class X -{ - int i_; - int j_ = 0; -public: - X() : i_(0) {} - X(int i) : i_(i) {} - X(int i, int j) : i_(i), j_(j) {} - - ~X() {} - - friend bool operator==(const X& x, const X& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Y -{ - int i_; - int j_ = 0; -public: - constexpr Y() : i_(0) {} - constexpr Y(int i) : i_(i) {} - constexpr Y(int i, int j) : i_(i), j_(j) {} - - friend constexpr bool operator==(const Y& x, const Y& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Z -{ -public: - Z(int) {TEST_THROW(6);} -}; - - -int main() -{ - { - constexpr optional<int> opt(in_place, 5); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 5, ""); - - struct test_constexpr_ctor - : public optional<int> - { - constexpr test_constexpr_ctor(in_place_t, int i) - : optional<int>(in_place, i) {} - }; - - } - { - const optional<X> opt(in_place); - assert(static_cast<bool>(opt) == true); - assert(*opt == X()); - } - { - const optional<X> opt(in_place, 5); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(5)); - } - { - const optional<X> opt(in_place, 5, 4); - assert(static_cast<bool>(opt) == true); - assert(*opt == X(5, 4)); - } - { - constexpr optional<Y> opt(in_place); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == Y(), ""); - - struct test_constexpr_ctor - : public optional<Y> - { - constexpr test_constexpr_ctor(in_place_t) - : optional<Y>(in_place) {} - }; - - } - { - constexpr optional<Y> opt(in_place, 5); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == Y(5), ""); - - struct test_constexpr_ctor - : public optional<Y> - { - constexpr test_constexpr_ctor(in_place_t, int i) - : optional<Y>(in_place, i) {} - }; - - } - { - constexpr optional<Y> opt(in_place, 5, 4); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == Y(5, 4), ""); - - struct test_constexpr_ctor - : public optional<Y> - { - constexpr test_constexpr_ctor(in_place_t, int i, int j) - : optional<Y>(in_place, i, j) {} - }; - - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - try - { - const optional<Z> opt(in_place, 1); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp deleted file mode 100644 index b75c147df5136..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp +++ /dev/null @@ -1,118 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class U, class... Args> -// constexpr -// explicit optional(in_place_t, initializer_list<U> il, Args&&... args); - -#include <experimental/optional> -#include <type_traits> -#include <vector> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; -using std::experimental::in_place_t; -using std::experimental::in_place; - -class X -{ - int i_; - int j_ = 0; -public: - X() : i_(0) {} - X(int i) : i_(i) {} - X(int i, int j) : i_(i), j_(j) {} - - ~X() {} - - friend bool operator==(const X& x, const X& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Y -{ - int i_; - int j_ = 0; -public: - constexpr Y() : i_(0) {} - constexpr Y(int i) : i_(i) {} - constexpr Y(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) {} - - friend constexpr bool operator==(const Y& x, const Y& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -class Z -{ - int i_; - int j_ = 0; -public: - constexpr Z() : i_(0) {} - constexpr Z(int i) : i_(i) {} - Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1]) - {TEST_THROW(6);} - - friend constexpr bool operator==(const Z& x, const Z& y) - {return x.i_ == y.i_ && x.j_ == y.j_;} -}; - -int main() -{ - { - static_assert(!std::is_constructible<X, std::initializer_list<int>&>::value, ""); - static_assert(!std::is_constructible<optional<X>, std::initializer_list<int>&>::value, ""); - } - { - optional<std::vector<int>> opt(in_place, {3, 1}); - assert(static_cast<bool>(opt) == true); - assert((*opt == std::vector<int>{3, 1})); - assert(opt->size() == 2); - } - { - optional<std::vector<int>> opt(in_place, {3, 1}, std::allocator<int>()); - assert(static_cast<bool>(opt) == true); - assert((*opt == std::vector<int>{3, 1})); - assert(opt->size() == 2); - } - { - static_assert(std::is_constructible<optional<Y>, std::initializer_list<int>&>::value, ""); - constexpr optional<Y> opt(in_place, {3, 1}); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == Y{3, 1}, ""); - - struct test_constexpr_ctor - : public optional<Y> - { - constexpr test_constexpr_ctor(in_place_t, std::initializer_list<int> i) - : optional<Y>(in_place, i) {} - }; - - constexpr test_constexpr_ctor dopt(in_place, {42, 101, -1}); - static_assert(*dopt == Y{42, 101, -1}, ""); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - static_assert(std::is_constructible<optional<Z>, std::initializer_list<int>&>::value, ""); - try - { - optional<Z> opt(in_place, {3, 1}); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp deleted file mode 100644 index a8bb6e9c275c4..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp +++ /dev/null @@ -1,149 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// optional(optional<T>&& rhs) noexcept(is_nothrow_move_constructible<T>::value); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -template <class T> -void -test(optional<T>& rhs, bool is_going_to_throw = false) -{ - static_assert(std::is_nothrow_move_constructible<optional<T>>::value == - std::is_nothrow_move_constructible<T>::value, ""); - bool rhs_engaged = static_cast<bool>(rhs); -#ifdef TEST_HAS_NO_EXCEPTIONS - if (is_going_to_throw) - return; -#else - try -#endif - { - optional<T> lhs = std::move(rhs); - assert(is_going_to_throw == false); - assert(static_cast<bool>(lhs) == rhs_engaged); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - catch (int i) - { - assert(i == 6); - assert(is_going_to_throw); - } -#endif -} - -class X -{ - int i_; -public: - X(int i) : i_(i) {} - X(X&& x) : i_(x.i_) {x.i_ = 0;} - ~X() {i_ = 0;} - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -class Y -{ - int i_; -public: - Y(int i) : i_(i) {} - Y(Y&& x) noexcept : i_(x.i_) {x.i_ = 0;} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} -}; - -int count = 0; - -class Z -{ - int i_; -public: - Z(int i) : i_(i) {} - Z(Z&&) - { - if (++count == 2) - TEST_THROW(6); - } - - friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} -}; - - -class ConstMovable -{ - int i_; -public: - ConstMovable(int i) : i_(i) {} - ConstMovable(const ConstMovable&& x) : i_(x.i_) {} - ~ConstMovable() {i_ = 0;} - friend bool operator==(const ConstMovable& x, const ConstMovable& y) {return x.i_ == y.i_;} -}; - -int main() -{ - { - typedef int T; - optional<T> rhs; - test(rhs); - } - { - typedef int T; - optional<T> rhs(3); - test(rhs); - } - { - typedef const int T; - optional<T> rhs(3); - test(rhs); - } - { - typedef X T; - optional<T> rhs; - test(rhs); - } - { - typedef X T; - optional<T> rhs(X(3)); - test(rhs); - } - { - typedef const ConstMovable T; - optional<T> rhs(ConstMovable(3)); - test(rhs); - } - { - typedef Y T; - optional<T> rhs; - test(rhs); - } - { - typedef Y T; - optional<T> rhs(Y(3)); - test(rhs); - } - { - typedef Z T; - optional<T> rhs; - test(rhs); - } - { - typedef Z T; - optional<T> rhs(Z(3)); - test(rhs, true); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp deleted file mode 100644 index 40c96581ed847..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp +++ /dev/null @@ -1,63 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// constexpr optional(nullopt_t) noexcept; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; -using std::experimental::nullopt_t; -using std::experimental::nullopt; - -template <class Opt> -void -test_constexpr() -{ - static_assert(noexcept(Opt(nullopt)), ""); - constexpr Opt opt(nullopt); - static_assert(static_cast<bool>(opt) == false, ""); - - struct test_constexpr_ctor - : public Opt - { - constexpr test_constexpr_ctor() {} - }; -} - -template <class Opt> -void -test() -{ - static_assert(noexcept(Opt(nullopt)), ""); - Opt opt(nullopt); - assert(static_cast<bool>(opt) == false); - - struct test_constexpr_ctor - : public Opt - { - constexpr test_constexpr_ctor() {} - }; -} - -struct X -{ - X(); -}; - -int main() -{ - test_constexpr<optional<int>>(); - test_constexpr<optional<int*>>(); - test<optional<X>>(); -} diff --git a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp deleted file mode 100644 index 1941546a53f79..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp +++ /dev/null @@ -1,110 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: c++98, c++03, c++11 - -// <optional> - -// constexpr optional(T&& v); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; -public: - X(int i) : i_(i) {} - X(X&& x) : i_(x.i_) {} - - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -class Y -{ - int i_; -public: - constexpr Y(int i) : i_(i) {} - constexpr Y(Y&& x) : i_(x.i_) {} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} -}; - -class Z -{ -public: - Z(int) {} - Z(Z&&) {TEST_THROW(6);} -}; - - -int main() -{ - { - typedef int T; - constexpr optional<T> opt(T(5)); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 5, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(T&&) {} - }; - } - { - typedef double T; - constexpr optional<T> opt(T(3)); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 3, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(T&&) {} - }; - } - { - typedef X T; - optional<T> opt(T(3)); - assert(static_cast<bool>(opt) == true); - assert(*opt == 3); - } - { - typedef Y T; - constexpr optional<T> opt(T(3)); - static_assert(static_cast<bool>(opt) == true, ""); - static_assert(*opt == 3, ""); - - struct test_constexpr_ctor - : public optional<T> - { - constexpr test_constexpr_ctor(T&&) {} - }; - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - typedef Z T; - try - { - optional<T> opt(T(3)); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp deleted file mode 100644 index 2bec19e6b4f43..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// ~optional(); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -class X -{ -public: - static bool dtor_called; - X() = default; - ~X() {dtor_called = true;} -}; - -bool X::dtor_called = false; - -int main() -{ - { - typedef int T; - static_assert(std::is_trivially_destructible<T>::value, ""); - static_assert(std::is_trivially_destructible<optional<T>>::value, ""); - } - { - typedef double T; - static_assert(std::is_trivially_destructible<T>::value, ""); - static_assert(std::is_trivially_destructible<optional<T>>::value, ""); - } - { - typedef X T; - static_assert(!std::is_trivially_destructible<T>::value, ""); - static_assert(!std::is_trivially_destructible<optional<T>>::value, ""); - { - X x; - optional<X> opt{x}; - assert(X::dtor_called == false); - } - assert(X::dtor_called == true); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp deleted file mode 100644 index faba8d256067c..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp +++ /dev/null @@ -1,44 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// T& optional<T>::operator*(); - -#ifdef _LIBCPP_DEBUG -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - constexpr int test() const {return 3;} - int test() {return 4;} -}; - -int main() -{ - { - optional<X> opt(X{}); - assert((*opt).test() == 4); - } -#ifdef _LIBCPP_DEBUG - { - optional<X> opt; - assert((*opt).test() == 3); - assert(false); - } -#endif // _LIBCPP_DEBUG -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp deleted file mode 100644 index f1bdc36424daf..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// constexpr const T& optional<T>::operator*() const; - -#ifdef _LIBCPP_DEBUG -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - constexpr int test() const {return 3;} -}; - -struct Y -{ - int test() const {return 2;} -}; - -int main() -{ - { - constexpr optional<X> opt(X{}); - static_assert((*opt).test() == 3, ""); - } - { - constexpr optional<Y> opt(Y{}); - assert((*opt).test() == 2); - } -#ifdef _LIBCPP_DEBUG - { - const optional<X> opt; - assert((*opt).test() == 3); - assert(false); - } -#endif // _LIBCPP_DEBUG -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp deleted file mode 100644 index 954ccd71ff538..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// constexpr T* optional<T>::operator->(); - -#ifdef _LIBCPP_DEBUG -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - constexpr int test() const {return 3;} -}; - -int main() -{ - { - constexpr optional<X> opt(X{}); - static_assert(opt->test() == 3, ""); - } -#ifdef _LIBCPP_DEBUG - { - optional<X> opt; - assert(opt->test() == 3); - assert(false); - } -#endif // _LIBCPP_DEBUG -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp deleted file mode 100644 index 46586c65a6e02..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// constexpr const T* optional<T>::operator->() const; - -#ifdef _LIBCPP_DEBUG -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - constexpr int test() const {return 3;} -}; - -struct Y -{ - int test() const {return 2;} -}; - -struct Z -{ - const Z* operator&() const {return this;} - constexpr int test() const {return 1;} -}; - -int main() -{ - { - constexpr optional<X> opt(X{}); - static_assert(opt->test() == 3, ""); - } - { - constexpr optional<Y> opt(Y{}); - assert(opt->test() == 2); - } - { - constexpr optional<Z> opt(Z{}); - assert(opt->test() == 1); -#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF - static_assert(opt->test() == 1, ""); -#endif - } -#ifdef _LIBCPP_DEBUG - { - const optional<X> opt; - assert(opt->test() == 3); - assert(false); - } -#endif // _LIBCPP_DEBUG -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp deleted file mode 100644 index 72d7790590d87..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// XFAIL: availability=macosx10.12 -// XFAIL: availability=macosx10.11 -// XFAIL: availability=macosx10.10 -// XFAIL: availability=macosx10.9 -// XFAIL: availability=macosx10.8 -// XFAIL: availability=macosx10.7 - -// <optional> - -// T& optional<T>::value(); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; -using std::experimental::bad_optional_access; - -struct X -{ - X() = default; - X(const X&) = delete; - constexpr int test() const {return 3;} - int test() {return 4;} -}; - -int main() -{ - { - optional<X> opt; - opt.emplace(); - assert(opt.value().test() == 4); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - optional<X> opt; - try - { - opt.value(); - assert(false); - } - catch (const bad_optional_access&) - { - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp deleted file mode 100644 index b3d6dfda4fb58..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// XFAIL: availability=macosx10.12 -// XFAIL: availability=macosx10.11 -// XFAIL: availability=macosx10.10 -// XFAIL: availability=macosx10.9 -// XFAIL: availability=macosx10.8 -// XFAIL: availability=macosx10.7 - -// <optional> - -// constexpr const T& optional<T>::value() const; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; -using std::experimental::in_place_t; -using std::experimental::in_place; -using std::experimental::bad_optional_access; - -struct X -{ - X() = default; - X(const X&) = delete; - constexpr int test() const {return 3;} - int test() {return 4;} -}; - -int main() -{ - { - constexpr optional<X> opt(in_place); - static_assert(opt.value().test() == 3, ""); - } - { - const optional<X> opt(in_place); - assert(opt.value().test() == 3); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - const optional<X> opt; - try - { - opt.value(); - assert(false); - } - catch (const bad_optional_access&) - { - } - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp deleted file mode 100644 index 6fca8c82cebdc..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class U> T optional<T>::value_or(U&& v) &&; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; -using std::experimental::in_place_t; -using std::experimental::in_place; - -struct Y -{ - int i_; - - Y(int i) : i_(i) {} -}; - -struct X -{ - int i_; - - X(int i) : i_(i) {} - X(X&& x) : i_(x.i_) {x.i_ = 0;} - X(const Y& y) : i_(y.i_) {} - X(Y&& y) : i_(y.i_+1) {} - friend constexpr bool operator==(const X& x, const X& y) - {return x.i_ == y.i_;} -}; - -int main() -{ - { - optional<X> opt(in_place, 2); - Y y(3); - assert(std::move(opt).value_or(y) == 2); - assert(*opt == 0); - } - { - optional<X> opt(in_place, 2); - assert(std::move(opt).value_or(Y(3)) == 2); - assert(*opt == 0); - } - { - optional<X> opt; - Y y(3); - assert(std::move(opt).value_or(y) == 3); - assert(!opt); - } - { - optional<X> opt; - assert(std::move(opt).value_or(Y(3)) == 4); - assert(!opt); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp deleted file mode 100644 index 4a008dce23863..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp +++ /dev/null @@ -1,77 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class U> constexpr T optional<T>::value_or(U&& v) const&; - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct Y -{ - int i_; - - constexpr Y(int i) : i_(i) {} -}; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} - constexpr X(const Y& y) : i_(y.i_) {} - constexpr X(Y&& y) : i_(y.i_+1) {} - friend constexpr bool operator==(const X& x, const X& y) - {return x.i_ == y.i_;} -}; - -int main() -{ - { - constexpr optional<X> opt(2); - constexpr Y y(3); - static_assert(opt.value_or(y) == 2, ""); - } - { - constexpr optional<X> opt(2); - static_assert(opt.value_or(Y(3)) == 2, ""); - } - { - constexpr optional<X> opt; - constexpr Y y(3); - static_assert(opt.value_or(y) == 3, ""); - } - { - constexpr optional<X> opt; - static_assert(opt.value_or(Y(3)) == 4, ""); - } - { - const optional<X> opt(2); - const Y y(3); - assert(opt.value_or(y) == 2); - } - { - const optional<X> opt(2); - assert(opt.value_or(Y(3)) == 2); - } - { - const optional<X> opt; - const Y y(3); - assert(opt.value_or(y) == 3); - } - { - const optional<X> opt; - assert(opt.value_or(Y(3)) == 4); - } -} diff --git a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp deleted file mode 100644 index f2d373c299bf1..0000000000000 --- a/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp +++ /dev/null @@ -1,313 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// void swap(optional&) -// noexcept(is_nothrow_move_constructible<T>::value && -// noexcept(swap(declval<T&>(), declval<T&>()))); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; -public: - static unsigned dtor_called; - X(int i) : i_(i) {} - X(X&& x) = default; - X& operator=(X&&) = default; - ~X() {++dtor_called;} - - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -unsigned X::dtor_called = 0; - -class Y -{ - int i_; -public: - static unsigned dtor_called; - Y(int i) : i_(i) {} - Y(Y&&) = default; - ~Y() {++dtor_called;} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} - friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} -}; - -unsigned Y::dtor_called = 0; - -class Z -{ - int i_; -public: - Z(int i) : i_(i) {} - Z(Z&&) {TEST_THROW(7);} - - friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} - friend void swap(Z&, Z&) {TEST_THROW(6);} -}; - -struct ConstSwappable { -}; -void swap(ConstSwappable const&, ConstSwappable const&) {} - -int main() -{ - { - optional<int> opt1; - optional<int> opt2; - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - } - { - optional<int> opt1(1); - optional<int> opt2; - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<int> opt1; - optional<int> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<int> opt1(1); - optional<int> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<const ConstSwappable> opt; - optional<const ConstSwappable> opt2; - opt.swap(opt2); - } - { - optional<X> opt1; - optional<X> opt2; - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - assert(X::dtor_called == 0); - } - { - optional<X> opt1(1); - optional<X> opt2; - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - X::dtor_called = 0; - opt1.swap(opt2); - assert(X::dtor_called == 1); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<X> opt1; - optional<X> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - X::dtor_called = 0; - opt1.swap(opt2); - assert(X::dtor_called == 1); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<X> opt1(1); - optional<X> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - X::dtor_called = 0; - opt1.swap(opt2); - assert(X::dtor_called == 1); // from inside std::swap - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<Y> opt1; - optional<Y> opt2; - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - assert(Y::dtor_called == 0); - } - { - optional<Y> opt1(1); - optional<Y> opt2; - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - Y::dtor_called = 0; - opt1.swap(opt2); - assert(Y::dtor_called == 1); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<Y> opt1; - optional<Y> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - Y::dtor_called = 0; - opt1.swap(opt2); - assert(Y::dtor_called == 1); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<Y> opt1(1); - optional<Y> opt2(2); - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - Y::dtor_called = 0; - opt1.swap(opt2); - assert(Y::dtor_called == 0); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - optional<Z> opt1; - optional<Z> opt2; - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - opt1.swap(opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - } - { - optional<Z> opt1; - opt1.emplace(1); - optional<Z> opt2; - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - try - { - opt1.swap(opt2); - assert(false); - } - catch (int i) - { - assert(i == 7); - } - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - } - { - optional<Z> opt1; - optional<Z> opt2; - opt2.emplace(2); - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - try - { - opt1.swap(opt2); - assert(false); - } - catch (int i) - { - assert(i == 7); - } - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - } - { - optional<Z> opt1; - opt1.emplace(1); - optional<Z> opt2; - opt2.emplace(2); - static_assert(noexcept(opt1.swap(opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - try - { - opt1.swap(opt2); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - } -#endif -} diff --git a/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp b/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp deleted file mode 100644 index 02c0a3a63a5e6..0000000000000 --- a/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// T shall be an object type and shall satisfy the requirements of Destructible - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - optional<const void> opt; -} diff --git a/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp b/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp deleted file mode 100644 index da8bd05f2c9be..0000000000000 --- a/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// T shall be an object type and shall satisfy the requirements of Destructible - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ -private: - ~X() {} -}; - -int main() -{ - optional<X> opt; -} diff --git a/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp b/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp deleted file mode 100644 index 7aa179afeaf6a..0000000000000 --- a/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// T shall be an object type and shall satisfy the requirements of Destructible - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - ~X() noexcept(false) {} -}; - -int main() -{ - optional<X> opt; -} diff --git a/test/std/experimental/optional/optional.object/optional_void.fail.cpp b/test/std/experimental/optional/optional.object/optional_void.fail.cpp deleted file mode 100644 index 73f689c56720e..0000000000000 --- a/test/std/experimental/optional/optional.object/optional_void.fail.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// T shall be an object type and shall satisfy the requirements of Destructible - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - optional<void> opt; -} diff --git a/test/std/experimental/optional/optional.object/types.pass.cpp b/test/std/experimental/optional/optional.object/types.pass.cpp deleted file mode 100644 index af8da2df8fd51..0000000000000 --- a/test/std/experimental/optional/optional.object/types.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> -// class optional -// { -// public: -// typedef T value_type; -// ... - -#include <experimental/optional> -#include <type_traits> - -using std::experimental::optional; - -template <class Opt, class T> -void -test() -{ - static_assert(std::is_same<typename Opt::value_type, T>::value, ""); -} - -int main() -{ - test<optional<int>, int>(); - test<optional<const int>, const int>(); - test<optional<double>, double>(); - test<optional<const double>, const double>(); -} diff --git a/test/std/experimental/optional/optional.relops/equal.pass.cpp b/test/std/experimental/optional/optional.relops/equal.pass.cpp deleted file mode 100644 index 413e7c8b3780b..0000000000000 --- a/test/std/experimental/optional/optional.relops/equal.pass.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator == ( const X &lhs, const X &rhs ) - { return lhs.i_ == rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( o1 == o1 , "" ); - static_assert ( o1 == o2 , "" ); - static_assert ( !(o1 == o3), "" ); - static_assert ( !(o1 == o4), "" ); - static_assert ( !(o1 == o5), "" ); - - static_assert ( o2 == o1 , "" ); - static_assert ( o2 == o2 , "" ); - static_assert ( !(o2 == o3), "" ); - static_assert ( !(o2 == o4), "" ); - static_assert ( !(o2 == o5), "" ); - - static_assert ( !(o3 == o1), "" ); - static_assert ( !(o3 == o2), "" ); - static_assert ( o3 == o3 , "" ); - static_assert ( !(o3 == o4), "" ); - static_assert ( o3 == o5 , "" ); - - static_assert ( !(o4 == o1), "" ); - static_assert ( !(o4 == o2), "" ); - static_assert ( !(o4 == o3), "" ); - static_assert ( o4 == o4 , "" ); - static_assert ( !(o4 == o5), "" ); - - static_assert ( !(o5 == o1), "" ); - static_assert ( !(o5 == o2), "" ); - static_assert ( o5 == o3 , "" ); - static_assert ( !(o5 == o4), "" ); - static_assert ( o5 == o5 , "" ); - - } -} diff --git a/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp b/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp deleted file mode 100644 index c0739dda6b832..0000000000000 --- a/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef optional<X> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( (o1 >= o1), "" ); - static_assert ( (o1 >= o2), "" ); - static_assert ( !(o1 >= o3), "" ); - static_assert ( !(o1 >= o4), "" ); - static_assert ( !(o1 >= o5), "" ); - - static_assert ( (o2 >= o1), "" ); - static_assert ( (o2 >= o2), "" ); - static_assert ( !(o2 >= o3), "" ); - static_assert ( !(o2 >= o4), "" ); - static_assert ( !(o2 >= o5), "" ); - - static_assert ( (o3 >= o1), "" ); - static_assert ( (o3 >= o2), "" ); - static_assert ( (o3 >= o3), "" ); - static_assert ( !(o3 >= o4), "" ); - static_assert ( (o3 >= o5), "" ); - - static_assert ( (o4 >= o1), "" ); - static_assert ( (o4 >= o2), "" ); - static_assert ( (o4 >= o3), "" ); - static_assert ( (o4 >= o4), "" ); - static_assert ( (o4 >= o5), "" ); - - static_assert ( (o5 >= o1), "" ); - static_assert ( (o5 >= o2), "" ); - static_assert ( (o5 >= o3), "" ); - static_assert ( !(o5 >= o4), "" ); - static_assert ( (o5 >= o5), "" ); - } -} diff --git a/test/std/experimental/optional/optional.relops/greater_than.pass.cpp b/test/std/experimental/optional/optional.relops/greater_than.pass.cpp deleted file mode 100644 index df7dbb64717fb..0000000000000 --- a/test/std/experimental/optional/optional.relops/greater_than.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef optional<X> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( !(o1 > o1), "" ); - static_assert ( !(o1 > o2), "" ); - static_assert ( !(o1 > o3), "" ); - static_assert ( !(o1 > o4), "" ); - static_assert ( !(o1 > o5), "" ); - - static_assert ( !(o2 > o1), "" ); - static_assert ( !(o2 > o2), "" ); - static_assert ( !(o2 > o3), "" ); - static_assert ( !(o2 > o4), "" ); - static_assert ( !(o2 > o5), "" ); - - static_assert ( (o3 > o1), "" ); - static_assert ( (o3 > o2), "" ); - static_assert ( !(o3 > o3), "" ); - static_assert ( !(o3 > o4), "" ); - static_assert ( !(o3 > o5), "" ); - - static_assert ( (o4 > o1), "" ); - static_assert ( (o4 > o2), "" ); - static_assert ( (o4 > o3), "" ); - static_assert ( !(o4 > o4), "" ); - static_assert ( (o4 > o5), "" ); - - static_assert ( (o5 > o1), "" ); - static_assert ( (o5 > o2), "" ); - static_assert ( !(o5 > o3), "" ); - static_assert ( !(o5 > o4), "" ); - static_assert ( !(o5 > o5), "" ); - } -} diff --git a/test/std/experimental/optional/optional.relops/less_equal.pass.cpp b/test/std/experimental/optional/optional.relops/less_equal.pass.cpp deleted file mode 100644 index d4874d17b2405..0000000000000 --- a/test/std/experimental/optional/optional.relops/less_equal.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef optional<X> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( (o1 <= o1), "" ); - static_assert ( (o1 <= o2), "" ); - static_assert ( (o1 <= o3), "" ); - static_assert ( (o1 <= o4), "" ); - static_assert ( (o1 <= o5), "" ); - - static_assert ( (o2 <= o1), "" ); - static_assert ( (o2 <= o2), "" ); - static_assert ( (o2 <= o3), "" ); - static_assert ( (o2 <= o4), "" ); - static_assert ( (o2 <= o5), "" ); - - static_assert ( !(o3 <= o1), "" ); - static_assert ( !(o3 <= o2), "" ); - static_assert ( (o3 <= o3), "" ); - static_assert ( (o3 <= o4), "" ); - static_assert ( (o3 <= o5), "" ); - - static_assert ( !(o4 <= o1), "" ); - static_assert ( !(o4 <= o2), "" ); - static_assert ( !(o4 <= o3), "" ); - static_assert ( (o4 <= o4), "" ); - static_assert ( !(o4 <= o5), "" ); - - static_assert ( !(o5 <= o1), "" ); - static_assert ( !(o5 <= o2), "" ); - static_assert ( (o5 <= o3), "" ); - static_assert ( (o5 <= o4), "" ); - static_assert ( (o5 <= o5), "" ); - } -} diff --git a/test/std/experimental/optional/optional.relops/less_than.pass.cpp b/test/std/experimental/optional/optional.relops/less_than.pass.cpp deleted file mode 100644 index 4113408268e8f..0000000000000 --- a/test/std/experimental/optional/optional.relops/less_than.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator < ( const X &lhs, const X &rhs ) - { return lhs.i_ < rhs.i_ ; } - -int main() -{ - { - typedef optional<X> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( !(o1 < o1), "" ); - static_assert ( !(o1 < o2), "" ); - static_assert ( (o1 < o3), "" ); - static_assert ( (o1 < o4), "" ); - static_assert ( (o1 < o5), "" ); - - static_assert ( !(o2 < o1), "" ); - static_assert ( !(o2 < o2), "" ); - static_assert ( (o2 < o3), "" ); - static_assert ( (o2 < o4), "" ); - static_assert ( (o2 < o5), "" ); - - static_assert ( !(o3 < o1), "" ); - static_assert ( !(o3 < o2), "" ); - static_assert ( !(o3 < o3), "" ); - static_assert ( (o3 < o4), "" ); - static_assert ( !(o3 < o5), "" ); - - static_assert ( !(o4 < o1), "" ); - static_assert ( !(o4 < o2), "" ); - static_assert ( !(o4 < o3), "" ); - static_assert ( !(o4 < o4), "" ); - static_assert ( !(o4 < o5), "" ); - - static_assert ( !(o5 < o1), "" ); - static_assert ( !(o5 < o2), "" ); - static_assert ( !(o5 < o3), "" ); - static_assert ( (o5 < o4), "" ); - static_assert ( !(o5 < o5), "" ); - } -} diff --git a/test/std/experimental/optional/optional.relops/not_equal.pass.cpp b/test/std/experimental/optional/optional.relops/not_equal.pass.cpp deleted file mode 100644 index 19a196317d4f8..0000000000000 --- a/test/std/experimental/optional/optional.relops/not_equal.pass.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -using std::experimental::optional; - -struct X -{ - int i_; - - constexpr X(int i) : i_(i) {} -}; - -constexpr bool operator == ( const X &lhs, const X &rhs ) - { return lhs.i_ == rhs.i_ ; } - -int main() -{ - { - typedef X T; - typedef optional<T> O; - - constexpr O o1; // disengaged - constexpr O o2; // disengaged - constexpr O o3{1}; // engaged - constexpr O o4{2}; // engaged - constexpr O o5{1}; // engaged - - static_assert ( !(o1 != o1), "" ); - static_assert ( !(o1 != o2), "" ); - static_assert ( (o1 != o3), "" ); - static_assert ( (o1 != o4), "" ); - static_assert ( (o1 != o5), "" ); - - static_assert ( !(o2 != o1), "" ); - static_assert ( !(o2 != o2), "" ); - static_assert ( (o2 != o3), "" ); - static_assert ( (o2 != o4), "" ); - static_assert ( (o2 != o5), "" ); - - static_assert ( (o3 != o1), "" ); - static_assert ( (o3 != o2), "" ); - static_assert ( !(o3 != o3), "" ); - static_assert ( (o3 != o4), "" ); - static_assert ( !(o3 != o5), "" ); - - static_assert ( (o4 != o1), "" ); - static_assert ( (o4 != o2), "" ); - static_assert ( (o4 != o3), "" ); - static_assert ( !(o4 != o4), "" ); - static_assert ( (o4 != o5), "" ); - - static_assert ( (o5 != o1), "" ); - static_assert ( (o5 != o2), "" ); - static_assert ( !(o5 != o3), "" ); - static_assert ( (o5 != o4), "" ); - static_assert ( !(o5 != o5), "" ); - - } -} diff --git a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp b/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp deleted file mode 100644 index 9abd87bd40513..0000000000000 --- a/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> -// constexpr -// optional<typename decay<T>::type> -// make_optional(T&& v); - -#include <experimental/optional> -#include <string> -#include <memory> -#include <cassert> - -#include "test_macros.h" - -int main() -{ - using std::experimental::optional; - using std::experimental::make_optional; - - { - optional<int> opt = make_optional(2); - assert(*opt == 2); - } - { - std::string s("123"); - optional<std::string> opt = make_optional(s); - assert(*opt == s); - } - { - std::string s("123"); - optional<std::string> opt = make_optional(std::move(s)); - assert(*opt == "123"); - LIBCPP_ASSERT(s.empty()); - } - { - std::unique_ptr<int> s(new int(3)); - optional<std::unique_ptr<int>> opt = make_optional(std::move(s)); - assert(**opt == 3); - assert(s == nullptr); - } -} diff --git a/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/test/std/experimental/optional/optional.specalg/swap.pass.cpp deleted file mode 100644 index 4d643cb44b67b..0000000000000 --- a/test/std/experimental/optional/optional.specalg/swap.pass.cpp +++ /dev/null @@ -1,303 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// template <class T> void swap(optional<T>& x, optional<T>& y) -// noexcept(noexcept(x.swap(y))); - -#include <experimental/optional> -#include <type_traits> -#include <cassert> - -#include "test_macros.h" - -using std::experimental::optional; - -class X -{ - int i_; -public: - static unsigned dtor_called; - X(int i) : i_(i) {} - X(X&& x) = default; - X& operator=(X&&) = default; - ~X() {++dtor_called;} - - friend bool operator==(const X& x, const X& y) {return x.i_ == y.i_;} -}; - -unsigned X::dtor_called = 0; - -class Y -{ - int i_; -public: - static unsigned dtor_called; - Y(int i) : i_(i) {} - Y(Y&&) = default; - ~Y() {++dtor_called;} - - friend constexpr bool operator==(const Y& x, const Y& y) {return x.i_ == y.i_;} - friend void swap(Y& x, Y& y) {std::swap(x.i_, y.i_);} -}; - -unsigned Y::dtor_called = 0; - -class Z -{ - int i_; -public: - Z(int i) : i_(i) {} - Z(Z&&) {TEST_THROW(7);} - - friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} - friend void swap(Z&, Z&) {TEST_THROW(6);} -}; - -int main() -{ - { - optional<int> opt1; - optional<int> opt2; - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - } - { - optional<int> opt1(1); - optional<int> opt2; - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<int> opt1; - optional<int> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<int> opt1(1); - optional<int> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<X> opt1; - optional<X> opt2; - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - assert(X::dtor_called == 0); - } - { - optional<X> opt1(1); - optional<X> opt2; - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - X::dtor_called = 0; - swap(opt1, opt2); - assert(X::dtor_called == 1); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<X> opt1; - optional<X> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - X::dtor_called = 0; - swap(opt1, opt2); - assert(X::dtor_called == 1); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<X> opt1(1); - optional<X> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == true, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - X::dtor_called = 0; - swap(opt1, opt2); - assert(X::dtor_called == 1); // from inside std::swap - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<Y> opt1; - optional<Y> opt2; - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - assert(Y::dtor_called == 0); - } - { - optional<Y> opt1(1); - optional<Y> opt2; - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - Y::dtor_called = 0; - swap(opt1, opt2); - assert(Y::dtor_called == 1); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<Y> opt1; - optional<Y> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - Y::dtor_called = 0; - swap(opt1, opt2); - assert(Y::dtor_called == 1); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == false); - } - { - optional<Y> opt1(1); - optional<Y> opt2(2); - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - Y::dtor_called = 0; - swap(opt1, opt2); - assert(Y::dtor_called == 0); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 2); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 1); - } - { - optional<Z> opt1; - optional<Z> opt2; - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - swap(opt1, opt2); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == false); - } -#ifndef TEST_HAS_NO_EXCEPTIONS - { - optional<Z> opt1; - opt1.emplace(1); - optional<Z> opt2; - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - try - { - swap(opt1, opt2); - assert(false); - } - catch (int i) - { - assert(i == 7); - } - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == false); - } - { - optional<Z> opt1; - optional<Z> opt2; - opt2.emplace(2); - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - try - { - swap(opt1, opt2); - assert(false); - } - catch (int i) - { - assert(i == 7); - } - assert(static_cast<bool>(opt1) == false); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - } - { - optional<Z> opt1; - opt1.emplace(1); - optional<Z> opt2; - opt2.emplace(2); - static_assert(noexcept(swap(opt1, opt2)) == false, ""); - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - try - { - swap(opt1, opt2); - assert(false); - } - catch (int i) - { - assert(i == 6); - } - assert(static_cast<bool>(opt1) == true); - assert(*opt1 == 1); - assert(static_cast<bool>(opt2) == true); - assert(*opt2 == 2); - } -#endif // TEST_HAS_NO_EXCEPTIONS -} diff --git a/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp deleted file mode 100644 index bdf01eba406f7..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for -// (possibly cv-qualified) in_place_t is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::in_place_t; - using std::experimental::in_place; - - optional<const in_place_t> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp deleted file mode 100644 index 61393c105e959..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for a -// reference type is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - optional<const int&> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp deleted file mode 100644 index 89c207306aba8..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for -// (possibly cv-qualified) nullopt_t is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - optional<const nullopt_t> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp deleted file mode 100644 index 47c2be7da0d0a..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for -// (possibly cv-qualified) in_place_t is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::in_place_t; - using std::experimental::in_place; - - optional<in_place_t> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp b/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp deleted file mode 100644 index b8fba47f7e78e..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// #include <initializer_list> - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - std::initializer_list<int> list; - (void)list; -} diff --git a/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp deleted file mode 100644 index de2f18991b246..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for a -// reference type is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - optional<int&> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp b/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp deleted file mode 100644 index 3d276d6420226..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for -// (possibly cv-qualified) nullopt_t is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - using std::experimental::nullopt_t; - using std::experimental::nullopt; - - optional<nullopt_t> opt; -} diff --git a/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp b/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp deleted file mode 100644 index fd6da18e8c161..0000000000000 --- a/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <optional> - -// A program that necessitates the instantiation of template optional for a -// reference type is ill-formed. - -#include <experimental/optional> - -int main() -{ - using std::experimental::optional; - - optional<int&&> opt; -} diff --git a/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp b/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp new file mode 100644 index 0000000000000..af6b13fe878db --- /dev/null +++ b/test/std/experimental/simd/simd.casts/simd_cast.pass.cpp @@ -0,0 +1,40 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.casts] +// template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); +#include <experimental/simd> +#include <cstdint> + +using namespace std::experimental::parallelism_v2; + +static_assert(std::is_same<decltype(simd_cast<int32_t>(native_simd<int32_t>())), + native_simd<int32_t>>::value, + ""); + +static_assert( + std::is_same<decltype(simd_cast<int64_t>(fixed_size_simd<int32_t, 4>())), + fixed_size_simd<int64_t, 4>>::value, + ""); + +static_assert(std::is_same<decltype(simd_cast<fixed_size_simd<int64_t, 1>>( + simd<int32_t, simd_abi::scalar>())), + fixed_size_simd<int64_t, 1>>::value, + ""); + +static_assert(std::is_same<decltype(simd_cast<simd<int64_t, simd_abi::scalar>>( + fixed_size_simd<int32_t, 1>())), + simd<int64_t, simd_abi::scalar>>::value, + ""); + +int main() {} diff --git a/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp b/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp new file mode 100644 index 0000000000000..eb1fa55e0a449 --- /dev/null +++ b/test/std/experimental/simd/simd.casts/static_simd_cast.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.casts] +// template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); + +#include <experimental/simd> +#include <cstdint> + +using namespace std::experimental::parallelism_v2; + +static_assert( + std::is_same<decltype(static_simd_cast<float>(native_simd<int>())), + native_simd<float>>::value, + ""); + +static_assert(std::is_same<decltype(static_simd_cast<fixed_size_simd<float, 1>>( + simd<int, simd_abi::scalar>())), + fixed_size_simd<float, 1>>::value, + ""); + +static_assert( + std::is_same<decltype(static_simd_cast<simd<float, simd_abi::scalar>>( + fixed_size_simd<int, 1>())), + simd<float, simd_abi::scalar>>::value, + ""); + +int main() {} diff --git a/test/std/experimental/simd/simd.cons/broadcast.pass.cpp b/test/std/experimental/simd/simd.cons/broadcast.pass.cpp new file mode 100644 index 0000000000000..60230cc637358 --- /dev/null +++ b/test/std/experimental/simd/simd.cons/broadcast.pass.cpp @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// See GCC PR63723. +// UNSUPPORTED: gcc-4.9 + +// <experimental/simd> +// +// [simd.class] +// template <class U> simd(U&& value); + +#include <cstdint> +#include <experimental/simd> + +using namespace std::experimental::parallelism_v2; + +template <class T, class... Args> +auto not_supported_native_simd_ctor(Args&&... args) + -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete; + +template <class T> +void not_supported_native_simd_ctor(...) {} + +template <class T, class... Args> +auto supported_native_simd_ctor(Args&&... args) + -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {} + +template <class T> +void supported_native_simd_ctor(...) = delete; + +void compile_narrowing_conversion() { + supported_native_simd_ctor<int8_t>(3); + supported_native_simd_ctor<int16_t>(3); + supported_native_simd_ctor<int32_t>(3); + supported_native_simd_ctor<int64_t>(3); + supported_native_simd_ctor<uint8_t>(3); + supported_native_simd_ctor<uint16_t>(3); + supported_native_simd_ctor<uint32_t>(3); + supported_native_simd_ctor<uint64_t>(3); + supported_native_simd_ctor<float>(3.f); + supported_native_simd_ctor<double>(3.); + supported_native_simd_ctor<long double>(3.); + + not_supported_native_simd_ctor<float>(3.); + not_supported_native_simd_ctor<int8_t>(long(3)); + not_supported_native_simd_ctor<float>(long(3)); + not_supported_native_simd_ctor<int>(3.); +} + +int main() {} diff --git a/test/std/experimental/simd/simd.cons/generator.pass.cpp b/test/std/experimental/simd/simd.cons/generator.pass.cpp new file mode 100644 index 0000000000000..baf7d936c6a32 --- /dev/null +++ b/test/std/experimental/simd/simd.cons/generator.pass.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// See GCC PR63723. +// UNSUPPORTED: gcc-4.9 + +// <experimental/simd> +// +// [simd.class] +// template <class G> explicit simd(G&& gen); + +#include <cstdint> +#include <experimental/simd> + +using namespace std::experimental::parallelism_v2; + +template <class T, class... Args> +auto not_supported_native_simd_ctor(Args&&... args) + -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete; + +template <class T> +void not_supported_native_simd_ctor(...) {} + +template <class T, class... Args> +auto supported_native_simd_ctor(Args&&... args) + -> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {} + +template <class T> +void supported_native_simd_ctor(...) = delete; + +void compile_generator() { + supported_native_simd_ctor<int>([](int i) { return i; }); + not_supported_native_simd_ctor<int>([](int i) { return float(i); }); + not_supported_native_simd_ctor<int>([](intptr_t i) { return (int*)(i); }); + not_supported_native_simd_ctor<int>([](int* i) { return i; }); +} + +int main() {} diff --git a/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp b/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp new file mode 100644 index 0000000000000..6e244220d7e2c --- /dev/null +++ b/test/std/experimental/simd/simd.traits/abi_for_size.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.traits] +// template <class T, size_t N> struct abi_for_size { using type = see below ; }; +// template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; + +#include <cstdint> +#include <experimental/simd> + +using namespace std::experimental::parallelism_v2; + +static_assert(std::is_same<typename abi_for_size<int, 4>::type, + simd_abi::fixed_size<4>>::value, + ""); + +static_assert( + std::is_same<abi_for_size_t<int, 4>, simd_abi::fixed_size<4>>::value, ""); + +int main() {} diff --git a/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp b/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp new file mode 100644 index 0000000000000..4f4f738a83514 --- /dev/null +++ b/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp @@ -0,0 +1,115 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.traits] +// template <class T> struct is_abi_tag; +// template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; + +#include <cstdint> +#include <experimental/simd> +#include "test_macros.h" + +using namespace std::experimental::parallelism_v2; + +struct UserType {}; + +static_assert( is_abi_tag<simd_abi::native<int8_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<int16_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<int32_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<int64_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<uint8_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<uint16_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<uint32_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<uint64_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<float>>::value, ""); +static_assert( is_abi_tag<simd_abi::native<double>>::value, ""); + +static_assert( is_abi_tag<simd_abi::compatible<int8_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<int16_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<int32_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<int64_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<uint8_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<uint16_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<uint32_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<uint64_t>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<float>>::value, ""); +static_assert( is_abi_tag<simd_abi::compatible<double>>::value, ""); + +static_assert( is_abi_tag<simd_abi::scalar>::value, ""); +static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value, + ""); + +static_assert( is_abi_tag<simd_abi::fixed_size<1>>::value, ""); +static_assert( is_abi_tag<simd_abi::fixed_size<2>>::value, ""); +static_assert( is_abi_tag<simd_abi::fixed_size<3>>::value, ""); +static_assert( is_abi_tag<simd_abi::fixed_size<4>>::value, ""); +static_assert( is_abi_tag<simd_abi::fixed_size<5>>::value, ""); +static_assert( is_abi_tag<simd_abi::fixed_size<32>>::value, ""); + +static_assert(!is_abi_tag<void>::value, ""); +static_assert(!is_abi_tag<int>::value, ""); +static_assert(!is_abi_tag<float>::value, ""); +static_assert(!is_abi_tag<UserType>::value, ""); +static_assert(!is_abi_tag<simd<int>>::value, ""); +static_assert(!is_abi_tag<simd<float>>::value, ""); +static_assert(!is_abi_tag<simd_mask<int>>::value, ""); +static_assert(!is_abi_tag<simd_mask<float>>::value, ""); + +#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \ + !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES) + +static_assert( is_abi_tag_v<simd_abi::native<int8_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<int16_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<int32_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<int64_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<uint8_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<uint16_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<uint32_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<uint64_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<float>>, ""); +static_assert( is_abi_tag_v<simd_abi::native<double>>, ""); + +static_assert( is_abi_tag_v<simd_abi::compatible<int8_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<int16_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<int32_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<int64_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<uint8_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<uint16_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<uint32_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<uint64_t>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<float>>, ""); +static_assert( is_abi_tag_v<simd_abi::compatible<double>>, ""); + +static_assert( is_abi_tag_v<simd_abi::scalar>, ""); +static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value, + ""); + +static_assert( is_abi_tag_v<simd_abi::fixed_size<1>>, ""); +static_assert( is_abi_tag_v<simd_abi::fixed_size<2>>, ""); +static_assert( is_abi_tag_v<simd_abi::fixed_size<3>>, ""); +static_assert( is_abi_tag_v<simd_abi::fixed_size<4>>, ""); +static_assert( is_abi_tag_v<simd_abi::fixed_size<5>>, ""); +static_assert( is_abi_tag_v<simd_abi::fixed_size<32>>, ""); + +static_assert(!is_abi_tag_v<void>, ""); +static_assert(!is_abi_tag_v<int>, ""); +static_assert(!is_abi_tag_v<float>, ""); +static_assert(!is_abi_tag_v<UserType>, ""); +static_assert(!is_abi_tag_v<simd<int>>, ""); +static_assert(!is_abi_tag_v<simd<float>>, ""); +static_assert(!is_abi_tag_v<simd_mask<int>>, ""); +static_assert(!is_abi_tag_v<simd_mask<float>>, ""); + +#endif + +int main() {} diff --git a/test/std/experimental/simd/simd.traits/is_simd.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd.pass.cpp new file mode 100644 index 0000000000000..77f5d10ed3a8a --- /dev/null +++ b/test/std/experimental/simd/simd.traits/is_simd.pass.cpp @@ -0,0 +1,133 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.traits] +// template <class T> struct is_simd; +// template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; + +#include <cstdint> +#include <experimental/simd> +#include "test_macros.h" + +using namespace std::experimental::parallelism_v2; + +struct UserType {}; + +static_assert( is_simd<native_simd<int8_t>>::value, ""); +static_assert( is_simd<native_simd<int16_t>>::value, ""); +static_assert( is_simd<native_simd<int32_t>>::value, ""); +static_assert( is_simd<native_simd<int64_t>>::value, ""); +static_assert( is_simd<native_simd<uint8_t>>::value, ""); +static_assert( is_simd<native_simd<uint16_t>>::value, ""); +static_assert( is_simd<native_simd<uint32_t>>::value, ""); +static_assert( is_simd<native_simd<uint64_t>>::value, ""); +static_assert( is_simd<native_simd<float>>::value, ""); +static_assert( is_simd<native_simd<double>>::value, ""); + +static_assert( is_simd<fixed_size_simd<int8_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<int16_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<int32_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<int64_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint8_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint16_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint32_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint64_t, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<float, 1>>::value, ""); +static_assert( is_simd<fixed_size_simd<double, 1>>::value, ""); + +static_assert( is_simd<fixed_size_simd<int8_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<int16_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<int32_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<int64_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint8_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint16_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint32_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint64_t, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<float, 3>>::value, ""); +static_assert( is_simd<fixed_size_simd<double, 3>>::value, ""); + +static_assert( is_simd<fixed_size_simd<int8_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<int16_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<int32_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<int64_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint8_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint16_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint32_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<uint64_t, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<float, 32>>::value, ""); +static_assert( is_simd<fixed_size_simd<double, 32>>::value, ""); + +static_assert(!is_simd<void>::value, ""); +static_assert(!is_simd<int>::value, ""); +static_assert(!is_simd<float>::value, ""); +static_assert(!is_simd<simd_mask<int>>::value, ""); +static_assert(!is_simd<simd_mask<float>>::value, ""); +static_assert(!is_simd<UserType>::value, ""); + +#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \ + !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES) + +static_assert( is_simd_v<native_simd<int8_t>>, ""); +static_assert( is_simd_v<native_simd<int16_t>>, ""); +static_assert( is_simd_v<native_simd<int32_t>>, ""); +static_assert( is_simd_v<native_simd<int64_t>>, ""); +static_assert( is_simd_v<native_simd<uint8_t>>, ""); +static_assert( is_simd_v<native_simd<uint16_t>>, ""); +static_assert( is_simd_v<native_simd<uint32_t>>, ""); +static_assert( is_simd_v<native_simd<uint64_t>>, ""); +static_assert( is_simd_v<native_simd<float>>, ""); +static_assert( is_simd_v<native_simd<double>>, ""); + +static_assert( is_simd_v<fixed_size_simd<int8_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<int16_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<int32_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<int64_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint8_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint16_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint32_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint64_t, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<float, 1>>, ""); +static_assert( is_simd_v<fixed_size_simd<double, 1>>, ""); + +static_assert( is_simd_v<fixed_size_simd<int8_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<int16_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<int32_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<int64_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint8_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint16_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint32_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint64_t, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<float, 3>>, ""); +static_assert( is_simd_v<fixed_size_simd<double, 3>>, ""); + +static_assert( is_simd_v<fixed_size_simd<int8_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<int16_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<int32_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<int64_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint8_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint16_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint32_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<uint64_t, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<float, 32>>, ""); +static_assert( is_simd_v<fixed_size_simd<double, 32>>, ""); + +static_assert(!is_simd_v<void>, ""); +static_assert(!is_simd_v<int>, ""); +static_assert(!is_simd_v<float>, ""); +static_assert(!is_simd_v<simd_mask<int>>, ""); +static_assert(!is_simd_v<simd_mask<float>>, ""); +static_assert(!is_simd_v<UserType>, ""); + +#endif + +int main() {} diff --git a/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp new file mode 100644 index 0000000000000..a6fe409057c25 --- /dev/null +++ b/test/std/experimental/simd/simd.traits/is_simd_flag_type.pass.cpp @@ -0,0 +1,55 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.traits] +// template <class T> struct is_simd_flag_type; +// template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; + +#include <cstdint> +#include <experimental/simd> +#include "test_macros.h" + +using namespace std::experimental::parallelism_v2; + +struct UserType {}; + +static_assert( is_simd_flag_type<element_aligned_tag>::value, ""); +static_assert( is_simd_flag_type<vector_aligned_tag>::value, ""); +static_assert( is_simd_flag_type<overaligned_tag<16>>::value, ""); +static_assert( is_simd_flag_type<overaligned_tag<32>>::value, ""); + +static_assert(!is_simd_flag_type<void>::value, ""); +static_assert(!is_simd_flag_type<int>::value, ""); +static_assert(!is_simd_flag_type<float>::value, ""); +static_assert(!is_simd_flag_type<UserType>::value, ""); +static_assert(!is_simd_flag_type<simd<int8_t>>::value, ""); +static_assert(!is_simd_flag_type<simd_mask<int8_t>>::value, ""); + +#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \ + !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES) + +static_assert( is_simd_flag_type_v<element_aligned_tag>, ""); +static_assert( is_simd_flag_type_v<vector_aligned_tag>, ""); +static_assert( is_simd_flag_type_v<overaligned_tag<16>>, ""); +static_assert( is_simd_flag_type_v<overaligned_tag<32>>, ""); + +static_assert(!is_simd_flag_type_v<void>, ""); +static_assert(!is_simd_flag_type_v<int>, ""); +static_assert(!is_simd_flag_type_v<float>, ""); +static_assert(!is_simd_flag_type_v<UserType>, ""); +static_assert(!is_simd_flag_type_v<simd<int8_t>>, ""); +static_assert(!is_simd_flag_type_v<simd_mask<int8_t>>, ""); + +#endif + +int main() {} diff --git a/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp b/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp new file mode 100644 index 0000000000000..8c2e0ed5bf43d --- /dev/null +++ b/test/std/experimental/simd/simd.traits/is_simd_mask.pass.cpp @@ -0,0 +1,133 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <experimental/simd> +// +// [simd.traits] +// template <class T> struct is_simd_mask; +// template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; + +#include <cstdint> +#include <experimental/simd> +#include "test_macros.h" + +using namespace std::experimental::parallelism_v2; + +struct UserType {}; + +static_assert( is_simd_mask<native_simd_mask<int8_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<int16_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<int32_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<int64_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<uint8_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<uint16_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<uint32_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<uint64_t>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<float>>::value, ""); +static_assert( is_simd_mask<native_simd_mask<double>>::value, ""); + +static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<float, 1>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<double, 1>>::value, ""); + +static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<float, 3>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<double, 3>>::value, ""); + +static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<float, 32>>::value, ""); +static_assert( is_simd_mask<fixed_size_simd_mask<double, 32>>::value, ""); + +static_assert(!is_simd_mask<void>::value, ""); +static_assert(!is_simd_mask<int>::value, ""); +static_assert(!is_simd_mask<float>::value, ""); +static_assert(!is_simd_mask<simd<int>>::value, ""); +static_assert(!is_simd_mask<simd<float>>::value, ""); +static_assert(!is_simd_mask<UserType>::value, ""); + +#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \ + !defined(_LIBCPP_HAS_NO_INLINE_VARIABLES) + +static_assert( is_simd_mask_v<native_simd_mask<int8_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<int16_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<int32_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<int64_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<uint8_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<uint16_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<uint32_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<uint64_t>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<float>>, ""); +static_assert( is_simd_mask_v<native_simd_mask<double>>, ""); + +static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 1>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 1>>, ""); + +static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 3>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 3>>, ""); + +static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 32>>, ""); +static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 32>>, ""); + +static_assert(!is_simd_mask_v<void>, ""); +static_assert(!is_simd_mask_v<int>, ""); +static_assert(!is_simd_mask_v<float>, ""); +static_assert(!is_simd_mask_v<simd<int>>, ""); +static_assert(!is_simd_mask_v<simd<float>>, ""); +static_assert(!is_simd_mask_v<UserType>, ""); + +#endif + +int main() {} diff --git a/test/std/experimental/string.view/lit.local.cfg b/test/std/experimental/string.view/lit.local.cfg deleted file mode 100644 index 376dbe7c16ec9..0000000000000 --- a/test/std/experimental/string.view/lit.local.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Disable all of the filesystem tests if the correct feature is not available. -if 'msvc' in config.available_features: - config.unsupported = True diff --git a/test/std/experimental/string.view/nothing_to_do.pass.cpp b/test/std/experimental/string.view/nothing_to_do.pass.cpp deleted file mode 100644 index c21f8a701685b..0000000000000 --- a/test/std/experimental/string.view/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <experimental/string_view> - -int main () {} diff --git a/test/std/experimental/string.view/string.view.access/at.pass.cpp b/test/std/experimental/string.view/string.view.access/at.pass.cpp deleted file mode 100644 index eaea062987fb3..0000000000000 --- a/test/std/experimental/string.view/string.view.access/at.pass.cpp +++ /dev/null @@ -1,63 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// NOTE: Older versions of clang have a bug where they fail to evaluate -// string_view::at as a constant expression. -// XFAIL: clang-3.4, clang-3.3 - - -// <string_view> - -// constexpr const _CharT& at(size_type _pos) const; - -#include <experimental/string_view> -#include <stdexcept> -#include <cassert> - -#include "test_macros.h" - -template <typename CharT> -void test ( const CharT *s, size_t len ) { - std::experimental::basic_string_view<CharT> sv ( s, len ); - assert ( sv.length() == len ); - for ( size_t i = 0; i < len; ++i ) { - assert ( sv.at(i) == s[i] ); - assert ( &sv.at(i) == s + i ); - } - -#ifndef TEST_HAS_NO_EXCEPTIONS - try { sv.at(len); } catch ( const std::out_of_range & ) { return ; } - assert ( false ); -#endif -} - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); -#endif - -#if TEST_STD_VER >= 11 - { - constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 ); - static_assert ( sv.length() == 2, "" ); - static_assert ( sv.at(0) == 'A', "" ); - static_assert ( sv.at(1) == 'B', "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.access/back.pass.cpp b/test/std/experimental/string.view/string.view.access/back.pass.cpp deleted file mode 100644 index 09f7950341a8d..0000000000000 --- a/test/std/experimental/string.view/string.view.access/back.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr const _CharT& front(); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <typename CharT> -bool test ( const CharT *s, size_t len ) { - std::experimental::basic_string_view<CharT> sv ( s, len ); - assert ( sv.length() == len ); - assert ( sv.back() == s[len-1] ); - return &sv.back() == s + len - 1; - } - -int main () { - assert ( test ( "ABCDE", 5 )); - assert ( test ( "a", 1 )); - - assert ( test ( L"ABCDE", 5 )); - assert ( test ( L"a", 1 )); - -#if TEST_STD_VER >= 11 - assert ( test ( u"ABCDE", 5 )); - assert ( test ( u"a", 1 )); - - assert ( test ( U"ABCDE", 5 )); - assert ( test ( U"a", 1 )); -#endif - -#if TEST_STD_VER >= 11 - { - constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 ); - static_assert ( sv.length() == 2, "" ); - static_assert ( sv.back() == 'B', "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.access/data.pass.cpp b/test/std/experimental/string.view/string.view.access/data.pass.cpp deleted file mode 100644 index 4b581d653eac9..0000000000000 --- a/test/std/experimental/string.view/string.view.access/data.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr const _CharT* data() const noexcept; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <typename CharT> -void test ( const CharT *s, size_t len ) { - std::experimental::basic_string_view<CharT> sv ( s, len ); - assert ( sv.length() == len ); - assert ( sv.data() == s ); - } - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); -#endif - -#if TEST_STD_VER > 11 - { - constexpr const char *s = "ABC"; - constexpr std::experimental::basic_string_view<char> sv( s, 2 ); - static_assert( sv.length() == 2, "" ); - static_assert( sv.data() == s, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.access/front.pass.cpp b/test/std/experimental/string.view/string.view.access/front.pass.cpp deleted file mode 100644 index acb00a46a2e54..0000000000000 --- a/test/std/experimental/string.view/string.view.access/front.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr const _CharT& back(); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <typename CharT> -bool test ( const CharT *s, size_t len ) { - std::experimental::basic_string_view<CharT> sv ( s, len ); - assert ( sv.length() == len ); - assert ( sv.front() == s[0] ); - return &sv.front() == s; - } - -int main () { - assert ( test ( "ABCDE", 5 )); - assert ( test ( "a", 1 )); - - assert ( test ( L"ABCDE", 5 )); - assert ( test ( L"a", 1 )); - -#if TEST_STD_VER >= 11 - assert ( test ( u"ABCDE", 5 )); - assert ( test ( u"a", 1 )); - - assert ( test ( U"ABCDE", 5 )); - assert ( test ( U"a", 1 )); -#endif - -#if TEST_STD_VER >= 11 - { - constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 ); - static_assert ( sv.length() == 2, "" ); - static_assert ( sv.front() == 'A', "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.access/index.pass.cpp b/test/std/experimental/string.view/string.view.access/index.pass.cpp deleted file mode 100644 index 0cb385eeff58f..0000000000000 --- a/test/std/experimental/string.view/string.view.access/index.pass.cpp +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr const _CharT& operator[](size_type _pos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <typename CharT> -void test ( const CharT *s, size_t len ) { - std::experimental::basic_string_view<CharT> sv ( s, len ); - assert ( sv.length() == len ); - for ( size_t i = 0; i < len; ++i ) { - assert ( sv[i] == s[i] ); - assert ( &sv[i] == s + i ); - } - } - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); -#endif - -#if TEST_STD_VER > 11 - { - constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 ); - static_assert ( sv.length() == 2, "" ); - static_assert ( sv[0] == 'A', "" ); - static_assert ( sv[1] == 'B', "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp b/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp deleted file mode 100644 index a5108bf12660f..0000000000000 --- a/test/std/experimental/string.view/string.view.capacity/capacity.pass.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// [string.view.capacity], capacity -// constexpr size_type size() const noexcept; -// constexpr size_type length() const noexcept; -// constexpr size_type max_size() const noexcept; -// constexpr bool empty() const noexcept; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename SV> -void test1 () { -#if TEST_STD_VER > 11 - { - constexpr SV sv1; - static_assert ( sv1.size() == 0, "" ); - static_assert ( sv1.empty(), ""); - static_assert ( sv1.size() == sv1.length(), "" ); - static_assert ( sv1.max_size() > sv1.size(), ""); - } -#endif - - { - SV sv1; - assert ( sv1.size() == 0 ); - assert ( sv1.empty()); - assert ( sv1.size() == sv1.length()); - assert ( sv1.max_size() > sv1.size()); - } -} - -template<typename CharT> -void test2 ( const CharT *s, size_t len ) { - { - std::experimental::basic_string_view<CharT> sv1 ( s ); - assert ( sv1.size() == len ); - assert ( sv1.data() == s ); - assert ( sv1.empty() == (len == 0)); - assert ( sv1.size() == sv1.length()); - assert ( sv1.max_size() > sv1.size()); - } -} - -int main () { - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test1<string_view> (); - test1<u16string_view> (); - test1<u32string_view> (); - test1<wstring_view> (); - - test2 ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); - test2 ( "ABCDE", 5 ); - test2 ( "a", 1 ); - test2 ( "", 0 ); - - test2 ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); - test2 ( L"ABCDE", 5 ); - test2 ( L"a", 1 ); - test2 ( L"", 0 ); - -#if TEST_STD_VER >= 11 - test2 ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); - test2 ( u"ABCDE", 5 ); - test2 ( u"a", 1 ); - test2 ( u"", 0 ); - - test2 ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 ); - test2 ( U"ABCDE", 5 ); - test2 ( U"a", 1 ); - test2 ( U"", 0 ); -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp deleted file mode 100644 index bd566a9862766..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator==(basic_string_view<charT,traits> lhs, const charT* rhs); -// template<class charT, class traits> -// constexpr bool operator==(const charT* lhs, basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(S lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs == rhs) == x); - assert((rhs == lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", true); - test(S(""), "abcde", false); - test(S(""), "abcdefghij", false); - test(S(""), "abcdefghijklmnopqrst", false); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", true); - test(S("abcde"), "abcdefghij", false); - test(S("abcde"), "abcdefghijklmnopqrst", false); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - static_assert ( sv1 == "", "" ); - static_assert ( "" == sv1, "" ); - static_assert (!(sv1 == "abcde"), "" ); - static_assert (!("abcde" == sv1), "" ); - - static_assert ( sv2 == "abcde", "" ); - static_assert ( "abcde" == sv2, "" ); - static_assert (!(sv2 == "abcde0"), "" ); - static_assert (!("abcde0" == sv2), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp deleted file mode 100644 index 1fd72d7964b6c..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator==(const charT* lhs, const basic_string<charT,traits> rhs); -// template<class charT, class traits, class Allocator> -// bool operator==(const basic_string_view<charT,traits> lhs, const CharT* rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const std::string &lhs, S rhs, bool x) -{ - assert((lhs == rhs) == x); - assert((rhs == lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), true); - test("", S("abcde"), false); - test("", S("abcdefghij"), false); - test("", S("abcdefghijklmnopqrst"), false); - test("abcde", S(""), false); - test("abcde", S("abcde"), true); - test("abcde", S("abcdefghij"), false); - test("abcde", S("abcdefghijklmnopqrst"), false); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), true); - test("abcdefghij", S("abcdefghijklmnopqrst"), false); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true); - } -} - diff --git a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp deleted file mode 100644 index 51decdca67cdf..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opeq.string_view.string_view.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// template<class charT, class traits, class Allocator> -// constexpr bool operator==(const basic_string_view<charT,traits> lhs, -// const basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(S lhs, S rhs, bool x) -{ - assert((lhs == rhs) == x); - assert((rhs == lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), true); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2; - constexpr SV sv3 { "abcde", 5 }; - static_assert ( sv1 == sv2, "" ); - static_assert (!(sv1 == sv3), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp deleted file mode 100644 index cf8a30a3942cd..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.pointer.pass.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// constexpr bool operator>=(const charT* lhs, basic_string_wiew<charT,traits> rhs); -// template<class charT, class traits, class Allocator> -// constexpr bool operator>=(basic_string_wiew<charT,traits> lhs, const charT* rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x, bool y) -{ - assert((lhs >= rhs) == x); - assert((rhs >= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), true, true); - test("", S("abcde"), false, true); - test("", S("abcdefghij"), false, true); - test("", S("abcdefghijklmnopqrst"), false, true); - test("abcde", S(""), true, false); - test("abcde", S("abcde"), true, true); - test("abcde", S("abcdefghij"), false, true); - test("abcde", S("abcdefghijklmnopqrst"), false, true); - test("abcdefghij", S(""), true, false); - test("abcdefghij", S("abcde"), true, false); - test("abcdefghij", S("abcdefghij"), true, true); - test("abcdefghij", S("abcdefghijklmnopqrst"), false, true); - test("abcdefghijklmnopqrst", S(""), true, false); - test("abcdefghijklmnopqrst", S("abcde"), true, false); - test("abcdefghijklmnopqrst", S("abcdefghij"), true, false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert ( sv1 >= "", "" ); - static_assert ( "" >= sv1, "" ); - static_assert (!(sv1 >= "abcde"), "" ); - static_assert ( "abcde" >= sv1, "" ); - - static_assert ( sv2 >= "", "" ); - static_assert (!("" >= sv2), "" ); - static_assert ( sv2 >= "abcde", "" ); - static_assert ( "abcde" >= sv2, "" ); - static_assert (!(sv2 >= "abcde0"), "" ); - static_assert ( "abcde0" >= sv2, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp deleted file mode 100644 index 0790f80f863c0..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>=(const basic_string<charT,traits,Allocator>& lhs, -// basic_string_view<charT,traits> rhs); -// bool operator>=(basic_string_view<charT,traits> lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x, bool y) -{ - assert((lhs >= rhs) == x); - assert((rhs >= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", true, true); - test(S(""), "abcde", false, true); - test(S(""), "abcdefghij", false, true); - test(S(""), "abcdefghijklmnopqrst", false, true); - test(S("abcde"), "", true, false); - test(S("abcde"), "abcde", true, true); - test(S("abcde"), "abcdefghij", false, true); - test(S("abcde"), "abcdefghijklmnopqrst", false, true); - test(S("abcdefghij"), "", true, false); - test(S("abcdefghij"), "abcde", true, false); - test(S("abcdefghij"), "abcdefghij", true, true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true); - test(S("abcdefghijklmnopqrst"), "", true, false); - test(S("abcdefghijklmnopqrst"), "abcde", true, false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true); - } -} diff --git a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp deleted file mode 100644 index 1bacf285f4eb3..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opge.string_view.string_view.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator>=(basic_string_view<charT,traits> lhs, -// basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x, bool y) -{ - assert((lhs >= rhs) == x); - assert((rhs >= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), true, true); - test(S(""), S("abcde"), false, true); - test(S(""), S("abcdefghij"), false, true); - test(S(""), S("abcdefghijklmnopqrst"), false, true); - test(S("abcde"), S(""), true, false); - test(S("abcde"), S("abcde"), true, true); - test(S("abcde"), S("abcdefghij"), false, true); - test(S("abcde"), S("abcdefghijklmnopqrst"), false, true); - test(S("abcdefghij"), S(""), true, false); - test(S("abcdefghij"), S("abcde"), true, false); - test(S("abcdefghij"), S("abcdefghij"), true, true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true); - test(S("abcdefghijklmnopqrst"), S(""), true, false); - test(S("abcdefghijklmnopqrst"), S("abcde"), true, false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert ( sv1 >= sv1, "" ); - static_assert ( sv2 >= sv2, "" ); - - static_assert (!(sv1 >= sv2), "" ); - static_assert ( sv2 >= sv1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp deleted file mode 100644 index 0aae3d41a8254..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.pointer.pass.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr template<class charT, class traits, class Allocator> -// bool operator>(const charT* lhs, basic_string_wiew<charT,traits> rhs); -// constexpr template<class charT, class traits, class Allocator> -// bool operator>(basic_string_wiew<charT,traits> lhs, const charT* rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x, bool y) -{ - assert((lhs > rhs) == x); - assert((rhs > lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), false, false); - test("", S("abcde"), false, true); - test("", S("abcdefghij"), false, true); - test("", S("abcdefghijklmnopqrst"), false, true); - test("abcde", S(""), true, false); - test("abcde", S("abcde"), false, false); - test("abcde", S("abcdefghij"), false, true); - test("abcde", S("abcdefghijklmnopqrst"), false, true); - test("abcdefghij", S(""), true, false); - test("abcdefghij", S("abcde"), true, false); - test("abcdefghij", S("abcdefghij"), false, false); - test("abcdefghij", S("abcdefghijklmnopqrst"), false, true); - test("abcdefghijklmnopqrst", S(""), true, false); - test("abcdefghijklmnopqrst", S("abcde"), true, false); - test("abcdefghijklmnopqrst", S("abcdefghij"), true, false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (!(sv1 > ""), "" ); - static_assert (!("" > sv1), "" ); - static_assert (!(sv1 > "abcde"), "" ); - static_assert ( "abcde" > sv1, "" ); - - static_assert ( sv2 > "", "" ); - static_assert (!("" > sv2), "" ); - static_assert (!(sv2 > "abcde"), "" ); - static_assert (!("abcde" > sv2), "" ); - static_assert (!(sv2 > "abcde0"), "" ); - static_assert ( "abcde0" > sv2, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp deleted file mode 100644 index 92f812f8249c6..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>(const basic_string<charT,traits,Allocator>& lhs, -// basic_string_view<charT,traits> rhs); -// bool operator>(basic_string_view<charT,traits> lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x, bool y) -{ - assert((lhs > rhs) == x); - assert((rhs > lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", false, false); - test(S(""), "abcde", false, true); - test(S(""), "abcdefghij", false, true); - test(S(""), "abcdefghijklmnopqrst", false, true); - test(S("abcde"), "", true, false); - test(S("abcde"), "abcde", false, false); - test(S("abcde"), "abcdefghij", false, true); - test(S("abcde"), "abcdefghijklmnopqrst", false, true); - test(S("abcdefghij"), "", true, false); - test(S("abcdefghij"), "abcde", true, false); - test(S("abcdefghij"), "abcdefghij", false, false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true); - test(S("abcdefghijklmnopqrst"), "", true, false); - test(S("abcdefghijklmnopqrst"), "abcde", true, false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false); - } -} diff --git a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp deleted file mode 100644 index e014872a613c0..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opgt.string_view.string_view.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator>(basic_string_view<charT,traits> lhs, -// basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x, bool y) -{ - assert((lhs > rhs) == x); - assert((rhs > lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), false, false); - test(S(""), S("abcde"), false, true); - test(S(""), S("abcdefghij"), false, true); - test(S(""), S("abcdefghijklmnopqrst"), false, true); - test(S("abcde"), S(""), true, false); - test(S("abcde"), S("abcde"), false, false); - test(S("abcde"), S("abcdefghij"), false, true); - test(S("abcde"), S("abcdefghijklmnopqrst"), false, true); - test(S("abcdefghij"), S(""), true, false); - test(S("abcdefghij"), S("abcde"), true, false); - test(S("abcdefghij"), S("abcdefghij"), false, false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false, true); - test(S("abcdefghijklmnopqrst"), S(""), true, false); - test(S("abcdefghijklmnopqrst"), S("abcde"), true, false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true, false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (!(sv1 > sv1), "" ); - static_assert (!(sv2 > sv2), "" ); - - static_assert (!(sv1 > sv2), "" ); - static_assert ( sv2 > sv1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp deleted file mode 100644 index bdc4c966fd063..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.pointer.pass.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// constexpr bool operator<=(const charT* lhs, basic_string_wiew<charT,traits> rhs); -// template<class charT, class traits, class Allocator> -// constexpr bool operator<=(basic_string_wiew<charT,traits> lhs, const charT* rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x, bool y) -{ - assert((lhs <= rhs) == x); - assert((rhs <= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), true, true); - test("", S("abcde"), true, false); - test("", S("abcdefghij"), true, false); - test("", S("abcdefghijklmnopqrst"), true, false); - test("abcde", S(""), false, true); - test("abcde", S("abcde"), true, true); - test("abcde", S("abcdefghij"), true, false); - test("abcde", S("abcdefghijklmnopqrst"), true, false); - test("abcdefghij", S(""), false, true); - test("abcdefghij", S("abcde"), false, true); - test("abcdefghij", S("abcdefghij"), true, true); - test("abcdefghij", S("abcdefghijklmnopqrst"), true, false); - test("abcdefghijklmnopqrst", S(""), false, true); - test("abcdefghijklmnopqrst", S("abcde"), false, true); - test("abcdefghijklmnopqrst", S("abcdefghij"), false, true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert ( sv1 <= "", "" ); - static_assert ( "" <= sv1, "" ); - static_assert ( sv1 <= "abcde", "" ); - static_assert (!("abcde" <= sv1), "" ); - - static_assert (!(sv2 <= ""), "" ); - static_assert ( "" <= sv2, "" ); - static_assert ( sv2 <= "abcde", "" ); - static_assert ( "abcde" <= sv2, "" ); - static_assert ( sv2 <= "abcde0", "" ); - static_assert (!("abcde0" <= sv2), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp deleted file mode 100644 index 39abbd04fc5db..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<=(const basic_string<charT,traits,Allocator>& lhs, -// basic_string_view<charT,traits> rhs); -// bool operator<=(basic_string_view<charT,traits> lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x, bool y) -{ - assert((lhs <= rhs) == x); - assert((rhs <= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", true, true); - test(S(""), "abcde", true, false); - test(S(""), "abcdefghij", true, false); - test(S(""), "abcdefghijklmnopqrst", true, false); - test(S("abcde"), "", false, true); - test(S("abcde"), "abcde", true, true); - test(S("abcde"), "abcdefghij", true, false); - test(S("abcde"), "abcdefghijklmnopqrst", true, false); - test(S("abcdefghij"), "", false, true); - test(S("abcdefghij"), "abcde", false, true); - test(S("abcdefghij"), "abcdefghij", true, true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false); - test(S("abcdefghijklmnopqrst"), "", false, true); - test(S("abcdefghijklmnopqrst"), "abcde", false, true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true); - } -} diff --git a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp deleted file mode 100644 index e814283ad5b6e..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/ople.string_view.string_view.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator<=(basic_string_view<charT,traits> lhs, -// basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x, bool y) -{ - assert((lhs <= rhs) == x); - assert((rhs <= lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), true, true); - test(S(""), S("abcde"), true, false); - test(S(""), S("abcdefghij"), true, false); - test(S(""), S("abcdefghijklmnopqrst"), true, false); - test(S("abcde"), S(""), false, true); - test(S("abcde"), S("abcde"), true, true); - test(S("abcde"), S("abcdefghij"), true, false); - test(S("abcde"), S("abcdefghijklmnopqrst"), true, false); - test(S("abcdefghij"), S(""), false, true); - test(S("abcdefghij"), S("abcde"), false, true); - test(S("abcdefghij"), S("abcdefghij"), true, true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false); - test(S("abcdefghijklmnopqrst"), S(""), false, true); - test(S("abcdefghijklmnopqrst"), S("abcde"), false, true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert ( sv1 <= sv1, "" ); - static_assert ( sv2 <= sv2, "" ); - - static_assert ( sv1 <= sv2, "" ); - static_assert (!(sv2 <= sv1), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp deleted file mode 100644 index 10e82437cd6da..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.pointer.pass.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// constexpr bool operator<(const charT* lhs, basic_string_wiew<charT,traits> rhs); -// template<class charT, class traits, class Allocator> -// constexpr bool operator<(basic_string_wiew<charT,traits> lhs, const charT* rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x, bool y) -{ - assert((lhs < rhs) == x); - assert((rhs < lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), false, false); - test("", S("abcde"), true, false); - test("", S("abcdefghij"), true, false); - test("", S("abcdefghijklmnopqrst"), true, false); - test("abcde", S(""), false, true); - test("abcde", S("abcde"), false, false); - test("abcde", S("abcdefghij"), true, false); - test("abcde", S("abcdefghijklmnopqrst"), true, false); - test("abcdefghij", S(""), false, true); - test("abcdefghij", S("abcde"), false, true); - test("abcdefghij", S("abcdefghij"), false, false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true, false); - test("abcdefghijklmnopqrst", S(""), false, true); - test("abcdefghijklmnopqrst", S("abcde"), false, true); - test("abcdefghijklmnopqrst", S("abcdefghij"), false, true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (!(sv1 < ""), "" ); - static_assert (!("" < sv1), "" ); - static_assert ( sv1 < "abcde", "" ); - static_assert (!("abcde" < sv1), "" ); - - static_assert (!(sv2 < ""), "" ); - static_assert ( "" < sv2, "" ); - static_assert (!(sv2 < "abcde"), "" ); - static_assert (!("abcde" < sv2), "" ); - static_assert ( sv2 < "abcde0", "" ); - static_assert (!("abcde0" < sv2), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp deleted file mode 100644 index 51ea639ba432d..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string.pass.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<(const basic_string<charT,traits,Allocator>& lhs, -// basic_string_view<charT,traits> rhs); -// bool operator<(basic_string_view<charT,traits> lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x, bool y) -{ - assert((lhs < rhs) == x); - assert((rhs < lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", false, false); - test(S(""), "abcde", true, false); - test(S(""), "abcdefghij", true, false); - test(S(""), "abcdefghijklmnopqrst", true, false); - test(S("abcde"), "", false, true); - test(S("abcde"), "abcde", false, false); - test(S("abcde"), "abcdefghij", true, false); - test(S("abcde"), "abcdefghijklmnopqrst", true, false); - test(S("abcdefghij"), "", false, true); - test(S("abcdefghij"), "abcde", false, true); - test(S("abcdefghij"), "abcdefghij", false, false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true, false); - test(S("abcdefghijklmnopqrst"), "", false, true); - test(S("abcdefghijklmnopqrst"), "abcde", false, true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false, true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false, false); - } -} diff --git a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp deleted file mode 100644 index 77d8fa3e5b275..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/oplt.string_view.string_view.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator<(basic_string_view<charT,traits> lhs, -// basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x, bool y) -{ - assert((lhs < rhs) == x); - assert((rhs < lhs) == y); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), false, false); - test(S(""), S("abcde"), true, false); - test(S(""), S("abcdefghij"), true, false); - test(S(""), S("abcdefghijklmnopqrst"), true, false); - test(S("abcde"), S(""), false, true); - test(S("abcde"), S("abcde"), false, false); - test(S("abcde"), S("abcdefghij"), true, false); - test(S("abcde"), S("abcdefghijklmnopqrst"), true, false); - test(S("abcdefghij"), S(""), false, true); - test(S("abcdefghij"), S("abcde"), false, true); - test(S("abcdefghij"), S("abcdefghij"), false, false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true, false); - test(S("abcdefghijklmnopqrst"), S(""), false, true); - test(S("abcdefghijklmnopqrst"), S("abcde"), false, true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false, true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (!(sv1 < sv1), "" ); - static_assert (!(sv2 < sv2), "" ); - - static_assert ( sv1 < sv2, "" ); - static_assert (!(sv2 < sv1), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp deleted file mode 100644 index 9c13199d24a75..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.pointer.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits> -// constexpr bool operator!=(basic_string_view<charT,traits> lhs, const charT* rhs); -// template<class charT, class traits> -// constexpr bool operator!=(const charT* lhs, basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(S lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs != rhs) == x); - assert((rhs != lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), "", false); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", true); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", true); - test(S("abcdefghij"), "abcde", true); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", true); - test(S("abcdefghijklmnopqrst"), "abcde", true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (!(sv1 != ""), "" ); - static_assert (!("" != sv1), "" ); - static_assert ( sv1 != "abcde", "" ); - static_assert ( "abcde" != sv1, "" ); - - static_assert (!(sv2 != "abcde"), "" ); - static_assert (!("abcde" != sv2), "" ); - static_assert ( sv2 != "abcde0", "" ); - static_assert ( "abcde0" != sv2, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp deleted file mode 100644 index 9ed0ac1d0fda3..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string.pass.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator!=(const basic_string<charT, traits, Allocator> &lhs, basic_string_view<charT,traits> rhs); -// template<class charT, class traits, class Allocator> -// bool operator!=(basic_string_view<charT,traits> lhs, const basic_string<charT, traits, Allocator> &rhs); - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const std::string &lhs, S rhs, bool x) -{ - assert((lhs != rhs) == x); - assert((rhs != lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test("", S(""), false); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), true); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), true); - test("abcdefghij", S("abcde"), true); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), true); - test("abcdefghijklmnopqrst", S("abcde"), true); - test("abcdefghijklmnopqrst", S("abcdefghij"), true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -} diff --git a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp b/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp deleted file mode 100644 index c74b327f14bb6..0000000000000 --- a/test/std/experimental/string.view/string.view.comparison/opne.string_view.string_view.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// template<class charT, class traits, class Allocator> -// constexpr bool operator!=(const basic_string_view<charT,traits> lhs, -// const basic_string_view<charT,traits> rhs); - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(S lhs, S rhs, bool x) -{ - assert((lhs != rhs) == x); - assert((rhs != lhs) == x); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), S(""), false); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2; - constexpr SV sv3 { "abcde", 5 }; - static_assert (!( sv1 != sv2), "" ); - static_assert ( sv1 != sv3, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.cons/default.pass.cpp b/test/std/experimental/string.view/string.view.cons/default.pass.cpp deleted file mode 100644 index 37df020e7ea40..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/default.pass.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr basic_string_view () noexcept; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename T> -void test () { -#if TEST_STD_VER > 11 - { - constexpr T sv1; - static_assert ( sv1.size() == 0, "" ); - static_assert ( sv1.empty(), ""); - } -#endif - - { - T sv1; - assert ( sv1.size() == 0 ); - assert ( sv1.empty()); - } -} - -int main () { - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test<string_view> (); - test<u16string_view> (); - test<u32string_view> (); - test<wstring_view> (); - -} diff --git a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp deleted file mode 100644 index a8638389e1681..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/from_literal.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr basic_string_view(const _CharT* _s) -// : __data (_s), __size(_Traits::length(_s)) {} - - -#include <experimental/string_view> -#include <string> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template<typename CharT> -size_t StrLen ( const CharT *s ) { - size_t retVal = 0; - while ( *s != 0 ) { ++retVal; ++s; } - return retVal; - } - -template<typename CharT> -void test ( const CharT *s ) { - std::experimental::basic_string_view<CharT> sv1 ( s ); - assert ( sv1.size() == StrLen( s )); - assert ( sv1.data() == s ); - } - - -int main () { - - test ( "QBCDE" ); - test ( "A" ); - test ( "" ); - - test ( L"QBCDE" ); - test ( L"A" ); - test ( L"" ); - -#if TEST_STD_VER >= 11 - test ( u"QBCDE" ); - test ( u"A" ); - test ( u"" ); - - test ( U"QBCDE" ); - test ( U"A" ); - test ( U"" ); -#endif - -#if TEST_STD_VER > 11 - { - constexpr std::experimental::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" ); - static_assert ( sv1.size() == 5, ""); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp deleted file mode 100644 index c2f312daa8634..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/from_ptr_len.pass.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// constexpr basic_string_view(const _CharT* _s, size_type _len) -// : __data (_s), __size(_len) {} - - -#include <experimental/string_view> -#include <string> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s, size_t sz ) { - { - std::experimental::basic_string_view<CharT> sv1 ( s, sz ); - assert ( sv1.size() == sz ); - assert ( sv1.data() == s ); - } -} - -int main () { - - test ( "QBCDE", 5 ); - test ( "QBCDE", 2 ); - test ( "", 0 ); -#if TEST_STD_VER > 11 - { - constexpr const char *s = "QBCDE"; - constexpr std::experimental::basic_string_view<char> sv1 ( s, 2 ); - static_assert ( sv1.size() == 2, "" ); - static_assert ( sv1.data() == s, "" ); - } -#endif - - test ( L"QBCDE", 5 ); - test ( L"QBCDE", 2 ); - test ( L"", 0 ); -#if TEST_STD_VER > 11 - { - constexpr const wchar_t *s = L"QBCDE"; - constexpr std::experimental::basic_string_view<wchar_t> sv1 ( s, 2 ); - static_assert ( sv1.size() == 2, "" ); - static_assert ( sv1.data() == s, "" ); - } -#endif - -#if TEST_STD_VER >= 11 - test ( u"QBCDE", 5 ); - test ( u"QBCDE", 2 ); - test ( u"", 0 ); -#if TEST_STD_VER > 11 - { - constexpr const char16_t *s = u"QBCDE"; - constexpr std::experimental::basic_string_view<char16_t> sv1 ( s, 2 ); - static_assert ( sv1.size() == 2, "" ); - static_assert ( sv1.data() == s, "" ); - } -#endif - - test ( U"QBCDE", 5 ); - test ( U"QBCDE", 2 ); - test ( U"", 0 ); -#if TEST_STD_VER > 11 - { - constexpr const char32_t *s = U"QBCDE"; - constexpr std::experimental::basic_string_view<char32_t> sv1 ( s, 2 ); - static_assert ( sv1.size() == 2, "" ); - static_assert ( sv1.data() == s, "" ); - } -#endif -#endif -} diff --git a/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp b/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp deleted file mode 100644 index 4ecd2cdff9ba9..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/from_string.pass.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// template<class Allocator> -// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept - - -#include <experimental/string_view> -#include <string> -#include <cassert> - -#include "test_macros.h" - -struct dummy_char_traits : public std::char_traits<char> {}; - -template<typename CharT, typename Traits> -void test ( const std::basic_string<CharT, Traits> &str ) { - std::experimental::basic_string_view<CharT, Traits> sv1 ( str ); - assert ( sv1.size() == str.size()); - assert ( sv1.data() == str.data()); -} - -int main () { - - test ( std::string("QBCDE") ); - test ( std::string("") ); - test ( std::string() ); - - test ( std::wstring(L"QBCDE") ); - test ( std::wstring(L"") ); - test ( std::wstring() ); - -#if TEST_STD_VER >= 11 - test ( std::u16string{u"QBCDE"} ); - test ( std::u16string{u""} ); - test ( std::u16string{} ); - - test ( std::u32string{U"QBCDE"} ); - test ( std::u32string{U""} ); - test ( std::u32string{} ); -#endif - - test ( std::basic_string<char, dummy_char_traits>("QBCDE") ); - test ( std::basic_string<char, dummy_char_traits>("") ); - test ( std::basic_string<char, dummy_char_traits>() ); - -} diff --git a/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp b/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp deleted file mode 100644 index 72e9dad83c843..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/from_string1.fail.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// template<class Allocator> -// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept - -#include <experimental/string_view> -#include <string> -#include <cassert> - -struct dummy_char_traits : public std::char_traits<char> {}; - -int main () { - using string_view = std::experimental::basic_string_view<char>; - using string = std:: basic_string <char, dummy_char_traits>; - - { - string s{"QBCDE"}; - string_view sv1 ( s ); - assert ( sv1.size() == s.size()); - assert ( sv1.data() == s.data()); - } -} diff --git a/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp b/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp deleted file mode 100644 index a14e131c85aaf..0000000000000 --- a/test/std/experimental/string.view/string.view.cons/from_string2.fail.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// template<class Allocator> -// basic_string_view(const basic_string<_CharT, _Traits, Allocator>& _str) noexcept - -#include <experimental/string_view> -#include <string> -#include <cassert> - -struct dummy_char_traits : public std::char_traits<char> {}; - -int main () { - using string_view = std::experimental::basic_string_view<char, dummy_char_traits>; - using string = std:: basic_string <char>; - - { - string s{"QBCDE"}; - string_view sv1 ( s ); - assert ( sv1.size() == s.size()); - assert ( sv1.data() == s.data()); - } -} diff --git a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp deleted file mode 100644 index fdaf8aa066f5d..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_char_size.pass.cpp +++ /dev/null @@ -1,85 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find(charT c, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find(c, pos) == x); - if (x != S::npos) - assert(pos <= x && x + 1 <= s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.find(c) == x); - if (x != S::npos) - assert(0 <= x && x + 1 <= s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'c', 0, S::npos); - test(S(""), 'c', 1, S::npos); - test(S("abcde"), 'c', 0, 2); - test(S("abcde"), 'c', 1, 2); - test(S("abcde"), 'c', 2, 2); - test(S("abcde"), 'c', 4, S::npos); - test(S("abcde"), 'c', 5, S::npos); - test(S("abcde"), 'c', 6, S::npos); - test(S("abcdeabcde"), 'c', 0, 2); - test(S("abcdeabcde"), 'c', 1, 2); - test(S("abcdeabcde"), 'c', 5, 7); - test(S("abcdeabcde"), 'c', 9, S::npos); - test(S("abcdeabcde"), 'c', 10, S::npos); - test(S("abcdeabcde"), 'c', 11, S::npos); - test(S("abcdeabcdeabcdeabcde"), 'c', 0, 2); - test(S("abcdeabcdeabcdeabcde"), 'c', 1, 2); - test(S("abcdeabcdeabcdeabcde"), 'c', 10, 12); - test(S("abcdeabcdeabcdeabcde"), 'c', 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), 'c', 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), 'c', 21, S::npos); - - test(S(""), 'c', S::npos); - test(S("abcde"), 'c', 2); - test(S("abcdeabcde"), 'c', 2); - test(S("abcdeabcdeabcdeabcde"), 'c', 2); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find( 'c', 0 ) == SV::npos, "" ); - static_assert (sv1.find( 'c', 1 ) == SV::npos, "" ); - static_assert (sv2.find( 'c', 0 ) == 2, "" ); - static_assert (sv2.find( 'c', 1 ) == 2, "" ); - static_assert (sv2.find( 'c', 2 ) == 2, "" ); - static_assert (sv2.find( 'c', 3 ) == SV::npos, "" ); - static_assert (sv2.find( 'c', 4 ) == SV::npos, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp deleted file mode 100644 index 859980af29561..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_not_of_char_size.pass.cpp +++ /dev/null @@ -1,85 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_first_not_of(charT c, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_first_not_of(c, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.find_first_not_of(c) == x); - if (x != S::npos) - assert(x < s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'q', 0, S::npos); - test(S(""), 'q', 1, S::npos); - test(S("kitcj"), 'q', 0, 0); - test(S("qkamf"), 'q', 1, 1); - test(S("nhmko"), 'q', 2, 2); - test(S("tpsaf"), 'q', 4, 4); - test(S("lahfb"), 'q', 5, S::npos); - test(S("irkhs"), 'q', 6, S::npos); - test(S("gmfhdaipsr"), 'q', 0, 0); - test(S("kantesmpgj"), 'q', 1, 1); - test(S("odaftiegpm"), 'q', 5, 5); - test(S("oknlrstdpi"), 'q', 9, 9); - test(S("eolhfgpjqk"), 'q', 10, S::npos); - test(S("pcdrofikas"), 'q', 11, S::npos); - test(S("nbatdlmekrgcfqsophij"), 'q', 0, 0); - test(S("bnrpehidofmqtcksjgla"), 'q', 1, 1); - test(S("jdmciepkaqgotsrfnhlb"), 'q', 10, 10); - test(S("jtdaefblsokrmhpgcnqi"), 'q', 19, 19); - test(S("hkbgspofltajcnedqmri"), 'q', 20, S::npos); - test(S("oselktgbcapndfjihrmq"), 'q', 21, S::npos); - - test(S(""), 'q', S::npos); - test(S("q"), 'q', S::npos); - test(S("qqq"), 'q', S::npos); - test(S("csope"), 'q', 0); - test(S("gfsmthlkon"), 'q', 0); - test(S("laenfsbridchgotmkqpj"), 'q', 0); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_not_of( 'q', 0 ) == SV::npos, "" ); - static_assert (sv1.find_first_not_of( 'q', 1 ) == SV::npos, "" ); - static_assert (sv2.find_first_not_of( 'q', 0 ) == 0, "" ); - static_assert (sv2.find_first_not_of( 'q', 1 ) == 1, "" ); - static_assert (sv2.find_first_not_of( 'q', 5 ) == SV::npos, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp deleted file mode 100644 index 1f7ce3ef54d13..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size.pass.cpp +++ /dev/null @@ -1,166 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_first_not_of(str, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.find_first_not_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, S::npos); - test(S(""), "laenf", 0, S::npos); - test(S(""), "pqlnkmbdjo", 0, S::npos); - test(S(""), "qkamfogpnljdcshbreti", 0, S::npos); - test(S(""), "", 1, S::npos); - test(S(""), "bjaht", 1, S::npos); - test(S(""), "hjlcmgpket", 1, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos); - test(S("fodgq"), "", 0, 0); - test(S("qanej"), "dfkap", 0, 0); - test(S("clbao"), "ihqrfebgad", 0, 0); - test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos); - test(S("srdfq"), "", 1, 1); - test(S("oemth"), "ikcrq", 1, 1); - test(S("cdaih"), "dmajblfhsg", 1, 3); - test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos); - test(S("cshmd"), "", 2, 2); - test(S("lhcdo"), "oebqi", 2, 2); - test(S("qnsoh"), "kojhpmbsfe", 2, S::npos); - test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos); - test(S("fmtsp"), "", 4, 4); - test(S("khbpm"), "aobjd", 4, 4); - test(S("pbsji"), "pcbahntsje", 4, 4); - test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos); - test(S("eqmpa"), "", 5, S::npos); - test(S("omigs"), "kocgb", 5, S::npos); - test(S("onmje"), "fbslrjiqkm", 5, S::npos); - test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos); - test(S("schfa"), "", 6, S::npos); - test(S("igdsc"), "qngpd", 6, S::npos); - test(S("brqgo"), "rodhqklgmb", 6, S::npos); - test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos); - test(S("hcjitbfapl"), "", 0, 0); - test(S("daiprenocl"), "ashjd", 0, 2); - test(S("litpcfdghe"), "mgojkldsqh", 0, 1); - test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos); - test(S("qpghtfbaji"), "", 1, 1); - test(S("gfshlcmdjr"), "nadkh", 1, 1); - test(S("nkodajteqp"), "ofdrqmkebl", 1, 4); - test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos); - test(S("crnklpmegd"), "", 5, 5); - test(S("jsbtafedoc"), "prqgn", 5, 5); - test(S("qnmodrtkeb"), "pejafmnokr", 5, 6); - test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos); - test(S("lmofqdhpki"), "", 9, 9); - test(S("hnefkqimca"), "rtjpa", 9, S::npos); - test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9); - test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos); - test(S("elgofjmbrq"), "", 10, S::npos); - test(S("mjqdgalkpc"), "dplqa", 10, S::npos); - test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos); - test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos); - test(S("eqsgalomhb"), "", 11, S::npos); - test(S("akiteljmoh"), "lofbc", 11, S::npos); - test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos); - test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), "", 0, 0); - test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0); - test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 1); - test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos); - test(S("jlnkraeodhcspfgbqitm"), "", 1, 1); - test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1); - test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 3); - test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos); - test(S("hdpkobnsalmcfijregtq"), "", 10, 10); - test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 11); - test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 13); - test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos); - test(S("niptglfbosehkamrdqcj"), "", 19, 19); - test(S("copqdhstbingamjfkler"), "djkqc", 19, 19); - test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, S::npos); - test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos); - test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos); - test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos); - test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos); - test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos); - test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos); - test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), "", S::npos); - test(S(""), "laenf", S::npos); - test(S(""), "pqlnkmbdjo", S::npos); - test(S(""), "qkamfogpnljdcshbreti", S::npos); - test(S("nhmko"), "", 0); - test(S("lahfb"), "irkhs", 0); - test(S("gmfhd"), "kantesmpgj", 2); - test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos); - test(S("eolhfgpjqk"), "", 0); - test(S("nbatdlmekr"), "bnrpe", 2); - test(S("jdmciepkaq"), "jtdaefblso", 2); - test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos); - test(S("gprdcokbnjhlsfmtieqa"), "", 0); - test(S("qjghlnftcaismkropdeb"), "bjaht", 0); - test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 1); - test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_not_of( "", 0) == SV::npos, "" ); - static_assert (sv1.find_first_not_of( "irkhs", 0) == SV::npos, "" ); - static_assert (sv2.find_first_not_of( "", 0) == 0, "" ); - static_assert (sv2.find_first_not_of( "gfsrt", 0) == 0, "" ); - static_assert (sv2.find_first_not_of( "lecar", 0) == 1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp deleted file mode 100644 index 28255dd457f71..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_not_of_pointer_size_size.pass.cpp +++ /dev/null @@ -1,393 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.find_first_not_of(str, pos, n) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, S::npos); - test(S(""), "irkhs", 0, 0, S::npos); - test(S(""), "kante", 0, 1, S::npos); - test(S(""), "oknlr", 0, 2, S::npos); - test(S(""), "pcdro", 0, 4, S::npos); - test(S(""), "bnrpe", 0, 5, S::npos); - test(S(""), "jtdaefblso", 0, 0, S::npos); - test(S(""), "oselktgbca", 0, 1, S::npos); - test(S(""), "eqgaplhckj", 0, 5, S::npos); - test(S(""), "bjahtcmnlp", 0, 9, S::npos); - test(S(""), "hjlcmgpket", 0, 10, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos); - test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos); - test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos); - test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos); - test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos); - test(S(""), "", 1, 0, S::npos); - test(S(""), "lbtqd", 1, 0, S::npos); - test(S(""), "tboim", 1, 1, S::npos); - test(S(""), "slcer", 1, 2, S::npos); - test(S(""), "cbjfs", 1, 4, S::npos); - test(S(""), "aqibs", 1, 5, S::npos); - test(S(""), "gtfblmqinc", 1, 0, S::npos); - test(S(""), "mkqpbtdalg", 1, 1, S::npos); - test(S(""), "kphatlimcd", 1, 5, S::npos); - test(S(""), "pblasqogic", 1, 9, S::npos); - test(S(""), "arosdhcfme", 1, 10, S::npos); - test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos); - test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos); - test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos); - test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos); - test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos); - test(S("eaint"), "", 0, 0, 0); - test(S("binja"), "gfsrt", 0, 0, 0); - test(S("latkm"), "pfsoc", 0, 1, 0); - test(S("lecfr"), "tpflm", 0, 2, 0); - test(S("eqkst"), "sgkec", 0, 4, 1); - test(S("cdafr"), "romds", 0, 5, 0); - test(S("prbhe"), "qhjistlgmr", 0, 0, 0); - test(S("lbisk"), "pedfirsglo", 0, 1, 0); - test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0); - test(S("ehmja"), "dabckmepqj", 0, 9, 1); - test(S("mhqgd"), "pqscrjthli", 0, 10, 0); - test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0); - test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0); - test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0); - test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos); - test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos); - test(S("clrgb"), "", 1, 0, 1); - test(S("tjmek"), "osmia", 1, 0, 1); - test(S("bgstp"), "ckonl", 1, 1, 1); - test(S("hstrk"), "ilcaj", 1, 2, 1); - test(S("kmspj"), "lasiq", 1, 4, 1); - test(S("tjboh"), "kfqmr", 1, 5, 1); - test(S("ilbcj"), "klnitfaobg", 1, 0, 1); - test(S("jkngf"), "gjhmdlqikp", 1, 1, 1); - test(S("gfcql"), "skbgtahqej", 1, 5, 1); - test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1); - test(S("bthpg"), "bjgfmnlkio", 1, 10, 1); - test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1); - test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1); - test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 3); - test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos); - test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos); - test(S("ndrhl"), "", 2, 0, 2); - test(S("mrecp"), "otkgb", 2, 0, 2); - test(S("qlasf"), "cqsjl", 2, 1, 2); - test(S("smaqd"), "dpifl", 2, 2, 2); - test(S("hjeni"), "oapht", 2, 4, 2); - test(S("ocmfj"), "cifts", 2, 5, 2); - test(S("hmftq"), "nmsckbgalo", 2, 0, 2); - test(S("fklad"), "tpksqhamle", 2, 1, 2); - test(S("dirnm"), "tpdrchmkji", 2, 5, 3); - test(S("hrgdc"), "ijagfkblst", 2, 9, 3); - test(S("ifakg"), "kpocsignjb", 2, 10, 2); - test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2); - test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2); - test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2); - test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos); - test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos); - test(S("cjgao"), "", 4, 0, 4); - test(S("kjplq"), "mabns", 4, 0, 4); - test(S("herni"), "bdnrp", 4, 1, 4); - test(S("tadrb"), "scidp", 4, 2, 4); - test(S("pkfeo"), "agbjl", 4, 4, 4); - test(S("hoser"), "jfmpr", 4, 5, S::npos); - test(S("kgrsp"), "rbpefghsmj", 4, 0, 4); - test(S("pgejb"), "apsfntdoqc", 4, 1, 4); - test(S("thlnq"), "ndkjeisgcl", 4, 5, 4); - test(S("nbmit"), "rnfpqatdeo", 4, 9, S::npos); - test(S("jgmib"), "bntjlqrfik", 4, 10, S::npos); - test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4); - test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4); - test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, S::npos); - test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, S::npos); - test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos); - test(S("klopi"), "", 5, 0, S::npos); - test(S("dajhn"), "psthd", 5, 0, S::npos); - test(S("jbgno"), "rpmjd", 5, 1, S::npos); - test(S("hkjae"), "dfsmk", 5, 2, S::npos); -} - -template <class S> -void test1() -{ - test(S("gbhqo"), "skqne", 5, 4, S::npos); - test(S("ktdor"), "kipnf", 5, 5, S::npos); - test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos); - test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos); - test(S("armql"), "pcdgltbrfj", 5, 5, S::npos); - test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos); - test(S("jcons"), "ledihrsgpf", 5, 10, S::npos); - test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos); - test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos); - test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos); - test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos); - test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos); - test(S("gajqn"), "", 6, 0, S::npos); - test(S("stedk"), "hrnat", 6, 0, S::npos); - test(S("tjkaf"), "gsqdt", 6, 1, S::npos); - test(S("dthpe"), "bspkd", 6, 2, S::npos); - test(S("klhde"), "ohcmb", 6, 4, S::npos); - test(S("bhlki"), "heatr", 6, 5, S::npos); - test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos); - test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos); - test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos); - test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos); - test(S("jblqp"), "njolbmspac", 6, 10, S::npos); - test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos); - test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos); - test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos); - test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos); - test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos); - test(S("jnkrfhotgl"), "", 0, 0, 0); - test(S("dltjfngbko"), "rqegt", 0, 0, 0); - test(S("bmjlpkiqde"), "dashm", 0, 1, 0); - test(S("skrflobnqm"), "jqirk", 0, 2, 0); - test(S("jkpldtshrm"), "rckeg", 0, 4, 0); - test(S("ghasdbnjqo"), "jscie", 0, 5, 0); - test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0); - test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0); - test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 2); - test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 4); - test(S("itphbqsker"), "dtablcrseo", 0, 10, 0); - test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0); - test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0); - test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0); - test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 1); - test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos); - test(S("shbcqnmoar"), "", 1, 0, 1); - test(S("bdoshlmfin"), "ontrs", 1, 0, 1); - test(S("khfrebnsgq"), "pfkna", 1, 1, 1); - test(S("getcrsaoji"), "ekosa", 1, 2, 2); - test(S("fjiknedcpq"), "anqhk", 1, 4, 1); - test(S("tkejgnafrm"), "jekca", 1, 5, 4); - test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1); - test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1); - test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 3); - test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1); - test(S("cigfqkated"), "sqcflrgtim", 1, 10, 5); - test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1); - test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1); - test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 5); - test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 5); - test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos); - test(S("ectnhskflp"), "", 5, 0, 5); - test(S("fgtianblpq"), "pijag", 5, 0, 5); - test(S("mfeqklirnh"), "jrckd", 5, 1, 5); - test(S("astedncjhk"), "qcloh", 5, 2, 5); - test(S("fhlqgcajbr"), "thlmp", 5, 4, 5); - test(S("epfhocmdng"), "qidmo", 5, 5, 5); - test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5); - test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 6); - test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5); - test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 6); - test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5); - test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5); - test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5); - test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 6); - test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 8); - test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos); - test(S("shoiedtcjb"), "", 9, 0, 9); - test(S("ebcinjgads"), "tqbnh", 9, 0, 9); - test(S("dqmregkcfl"), "akmle", 9, 1, 9); - test(S("ngcrieqajf"), "iqfkm", 9, 2, 9); - test(S("qosmilgnjb"), "tqjsr", 9, 4, 9); - test(S("ikabsjtdfl"), "jplqg", 9, 5, S::npos); - test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9); - test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9); - test(S("fdbicojerm"), "dmicerngat", 9, 5, S::npos); - test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9); - test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9); - test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9); - test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9); - test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9); - test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, S::npos); - test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos); - test(S("ncjpmaekbs"), "", 10, 0, S::npos); - test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos); - test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos); - test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos); - test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos); - test(S("beanrfodgj"), "odpte", 10, 5, S::npos); - test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos); - test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos); -} - -template <class S> -void test2() -{ - test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos); - test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos); - test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos); - test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos); - test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos); - test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos); - test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos); - test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos); - test(S("cqjohampgd"), "", 11, 0, S::npos); - test(S("hobitmpsan"), "aocjb", 11, 0, S::npos); - test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos); - test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos); - test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos); - test(S("qghptonrea"), "eaqkl", 11, 5, S::npos); - test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos); - test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos); - test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos); - test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos); - test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos); - test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos); - test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos); - test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos); - test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos); - test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos); - test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0); - test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0); - test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0); - test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0); - test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0); - test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0); - test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0); - test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0); - test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0); - test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0); - test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0); - test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0); - test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0); - test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0); - test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 11); - test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos); - test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1); - test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1); - test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1); - test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 2); - test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 2); - test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1); - test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1); - test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1); - test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1); - test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 3); - test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 2); - test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1); - test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1); - test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 2); - test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 13); - test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos); - test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10); - test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10); - test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10); - test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10); - test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 11); - test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10); - test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10); - test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10); - test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10); - test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 11); - test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10); - test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10); - test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10); - test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 11); - test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 11); - test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos); - test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19); - test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19); - test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19); - test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19); - test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19); - test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, S::npos); - test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19); - test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19); - test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19); - test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19); - test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19); - test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19); - test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19); - test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, S::npos); - test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, S::npos); - test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos); - test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos); - test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos); - test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos); - test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos); - test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos); - test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos); - test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos); - test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos); - test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos); - test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos); - test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos); - test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos); -} - -template <class S> -void test3() -{ - test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos); - test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos); - test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos); - test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos); - test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos); - test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos); - test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos); - test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos); - test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos); - test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos); - test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos); - test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos); - test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos); - test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos); - test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos); - test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos); - test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos); - test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos); - test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos); - test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_not_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv1.find_first_not_of( "irkhs", 0, 5) == SV::npos, "" ); - static_assert (sv2.find_first_not_of( "", 0, 0) == 0, "" ); - static_assert (sv2.find_first_not_of( "gfsrt", 0, 5) == 0, "" ); - static_assert (sv2.find_first_not_of( "lecar", 0, 5) == 1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp deleted file mode 100644 index 7002312940928..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_not_of_string_view_size.pass.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// size_type find_first_not_of(const basic_string& str, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.find_first_not_of(str, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.find_first_not_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, S::npos); - test(S(""), S("laenf"), 0, S::npos); - test(S(""), S("pqlnkmbdjo"), 0, S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos); - test(S(""), S(""), 1, S::npos); - test(S(""), S("bjaht"), 1, S::npos); - test(S(""), S("hjlcmgpket"), 1, S::npos); - test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos); - test(S("fodgq"), S(""), 0, 0); - test(S("qanej"), S("dfkap"), 0, 0); - test(S("clbao"), S("ihqrfebgad"), 0, 0); - test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos); - test(S("srdfq"), S(""), 1, 1); - test(S("oemth"), S("ikcrq"), 1, 1); - test(S("cdaih"), S("dmajblfhsg"), 1, 3); - test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos); - test(S("cshmd"), S(""), 2, 2); - test(S("lhcdo"), S("oebqi"), 2, 2); - test(S("qnsoh"), S("kojhpmbsfe"), 2, S::npos); - test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos); - test(S("fmtsp"), S(""), 4, 4); - test(S("khbpm"), S("aobjd"), 4, 4); - test(S("pbsji"), S("pcbahntsje"), 4, 4); - test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos); - test(S("eqmpa"), S(""), 5, S::npos); - test(S("omigs"), S("kocgb"), 5, S::npos); - test(S("onmje"), S("fbslrjiqkm"), 5, S::npos); - test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos); - test(S("schfa"), S(""), 6, S::npos); - test(S("igdsc"), S("qngpd"), 6, S::npos); - test(S("brqgo"), S("rodhqklgmb"), 6, S::npos); - test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos); - test(S("hcjitbfapl"), S(""), 0, 0); - test(S("daiprenocl"), S("ashjd"), 0, 2); - test(S("litpcfdghe"), S("mgojkldsqh"), 0, 1); - test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos); - test(S("qpghtfbaji"), S(""), 1, 1); - test(S("gfshlcmdjr"), S("nadkh"), 1, 1); - test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 4); - test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos); - test(S("crnklpmegd"), S(""), 5, 5); - test(S("jsbtafedoc"), S("prqgn"), 5, 5); - test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 6); - test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos); - test(S("lmofqdhpki"), S(""), 9, 9); - test(S("hnefkqimca"), S("rtjpa"), 9, S::npos); - test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9); - test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos); - test(S("elgofjmbrq"), S(""), 10, S::npos); - test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos); - test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos); - test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos); - test(S("eqsgalomhb"), S(""), 11, S::npos); - test(S("akiteljmoh"), S("lofbc"), 11, S::npos); - test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos); - test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0); - test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0); - test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 1); - test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos); - test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1); - test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1); - test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 3); - test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos); - test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10); - test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 11); - test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 13); - test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos); - test(S("niptglfbosehkamrdqcj"), S(""), 19, 19); - test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19); - test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, S::npos); - test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos); - test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos); - test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos); - test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos); - test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos); - test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos); - test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), S(""), S::npos); - test(S(""), S("laenf"), S::npos); - test(S(""), S("pqlnkmbdjo"), S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), S::npos); - test(S("nhmko"), S(""), 0); - test(S("lahfb"), S("irkhs"), 0); - test(S("gmfhd"), S("kantesmpgj"), 2); - test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos); - test(S("eolhfgpjqk"), S(""), 0); - test(S("nbatdlmekr"), S("bnrpe"), 2); - test(S("jdmciepkaq"), S("jtdaefblso"), 2); - test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos); - test(S("gprdcokbnjhlsfmtieqa"), S(""), 0); - test(S("qjghlnftcaismkropdeb"), S("bjaht"), 0); - test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 1); - test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp deleted file mode 100644 index ffafcfc044812..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_of_char_size.pass.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr size_type find_first_of(charT c, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_first_of(c, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.find_first_of(c) == x); - if (x != S::npos) - assert(x < s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'e', 0, S::npos); - test(S(""), 'e', 1, S::npos); - test(S("kitcj"), 'e', 0, S::npos); - test(S("qkamf"), 'e', 1, S::npos); - test(S("nhmko"), 'e', 2, S::npos); - test(S("tpsaf"), 'e', 4, S::npos); - test(S("lahfb"), 'e', 5, S::npos); - test(S("irkhs"), 'e', 6, S::npos); - test(S("gmfhdaipsr"), 'e', 0, S::npos); - test(S("kantesmpgj"), 'e', 1, 4); - test(S("odaftiegpm"), 'e', 5, 6); - test(S("oknlrstdpi"), 'e', 9, S::npos); - test(S("eolhfgpjqk"), 'e', 10, S::npos); - test(S("pcdrofikas"), 'e', 11, S::npos); - test(S("nbatdlmekrgcfqsophij"), 'e', 0, 7); - test(S("bnrpehidofmqtcksjgla"), 'e', 1, 4); - test(S("jdmciepkaqgotsrfnhlb"), 'e', 10, S::npos); - test(S("jtdaefblsokrmhpgcnqi"), 'e', 19, S::npos); - test(S("hkbgspofltajcnedqmri"), 'e', 20, S::npos); - test(S("oselktgbcapndfjihrmq"), 'e', 21, S::npos); - - test(S(""), 'e', S::npos); - test(S("csope"), 'e', 4); - test(S("gfsmthlkon"), 'e', S::npos); - test(S("laenfsbridchgotmkqpj"), 'e', 2); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_of( 'e', 0 ) == SV::npos, "" ); - static_assert (sv1.find_first_of( 'e', 1 ) == SV::npos, "" ); - static_assert (sv2.find_first_of( 'q', 0 ) == SV::npos, "" ); - static_assert (sv2.find_first_of( 'e', 1 ) == 4, "" ); - static_assert (sv2.find_first_of( 'e', 5 ) == SV::npos, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp deleted file mode 100644 index 7b37fe057213d..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size.pass.cpp +++ /dev/null @@ -1,166 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr size_type find_first_of(const charT* s, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_first_of(str, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.find_first_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, S::npos); - test(S(""), "laenf", 0, S::npos); - test(S(""), "pqlnkmbdjo", 0, S::npos); - test(S(""), "qkamfogpnljdcshbreti", 0, S::npos); - test(S(""), "", 1, S::npos); - test(S(""), "bjaht", 1, S::npos); - test(S(""), "hjlcmgpket", 1, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos); - test(S("fodgq"), "", 0, S::npos); - test(S("qanej"), "dfkap", 0, 1); - test(S("clbao"), "ihqrfebgad", 0, 2); - test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0); - test(S("srdfq"), "", 1, S::npos); - test(S("oemth"), "ikcrq", 1, S::npos); - test(S("cdaih"), "dmajblfhsg", 1, 1); - test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1); - test(S("cshmd"), "", 2, S::npos); - test(S("lhcdo"), "oebqi", 2, 4); - test(S("qnsoh"), "kojhpmbsfe", 2, 2); - test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2); - test(S("fmtsp"), "", 4, S::npos); - test(S("khbpm"), "aobjd", 4, S::npos); - test(S("pbsji"), "pcbahntsje", 4, S::npos); - test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4); - test(S("eqmpa"), "", 5, S::npos); - test(S("omigs"), "kocgb", 5, S::npos); - test(S("onmje"), "fbslrjiqkm", 5, S::npos); - test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos); - test(S("schfa"), "", 6, S::npos); - test(S("igdsc"), "qngpd", 6, S::npos); - test(S("brqgo"), "rodhqklgmb", 6, S::npos); - test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos); - test(S("hcjitbfapl"), "", 0, S::npos); - test(S("daiprenocl"), "ashjd", 0, 0); - test(S("litpcfdghe"), "mgojkldsqh", 0, 0); - test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0); - test(S("qpghtfbaji"), "", 1, S::npos); - test(S("gfshlcmdjr"), "nadkh", 1, 3); - test(S("nkodajteqp"), "ofdrqmkebl", 1, 1); - test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1); - test(S("crnklpmegd"), "", 5, S::npos); - test(S("jsbtafedoc"), "prqgn", 5, S::npos); - test(S("qnmodrtkeb"), "pejafmnokr", 5, 5); - test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5); - test(S("lmofqdhpki"), "", 9, S::npos); - test(S("hnefkqimca"), "rtjpa", 9, 9); - test(S("drtasbgmfp"), "ktsrmnqagd", 9, S::npos); - test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9); - test(S("elgofjmbrq"), "", 10, S::npos); - test(S("mjqdgalkpc"), "dplqa", 10, S::npos); - test(S("kthqnfcerm"), "dkacjoptns", 10, S::npos); - test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos); - test(S("eqsgalomhb"), "", 11, S::npos); - test(S("akiteljmoh"), "lofbc", 11, S::npos); - test(S("hlbdfreqjo"), "astoegbfpn", 11, S::npos); - test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos); - test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 3); - test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0); - test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0); - test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos); - test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 3); - test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1); - test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1); - test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos); - test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10); - test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10); - test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10); - test(S("niptglfbosehkamrdqcj"), "", 19, S::npos); - test(S("copqdhstbingamjfkler"), "djkqc", 19, S::npos); - test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19); - test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19); - test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, S::npos); - test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, S::npos); - test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos); - test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, S::npos); - test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, S::npos); - test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), "", S::npos); - test(S(""), "laenf", S::npos); - test(S(""), "pqlnkmbdjo", S::npos); - test(S(""), "qkamfogpnljdcshbreti", S::npos); - test(S("nhmko"), "", S::npos); - test(S("lahfb"), "irkhs", 2); - test(S("gmfhd"), "kantesmpgj", 0); - test(S("odaft"), "oknlrstdpiqmjbaghcfe", 0); - test(S("eolhfgpjqk"), "", S::npos); - test(S("nbatdlmekr"), "bnrpe", 0); - test(S("jdmciepkaq"), "jtdaefblso", 0); - test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 0); - test(S("gprdcokbnjhlsfmtieqa"), "", S::npos); - test(S("qjghlnftcaismkropdeb"), "bjaht", 1); - test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 0); - test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_of( "", 0) == SV::npos, "" ); - static_assert (sv1.find_first_of( "irkhs", 0) == SV::npos, "" ); - static_assert (sv2.find_first_of( "", 0) == SV::npos, "" ); - static_assert (sv2.find_first_of( "gfsrt", 0) == SV::npos, "" ); - static_assert (sv2.find_first_of( "lecar", 0) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp deleted file mode 100644 index 1f7ea383a589b..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_of_pointer_size_size.pass.cpp +++ /dev/null @@ -1,393 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.find_first_of(str, pos, n) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, S::npos); - test(S(""), "irkhs", 0, 0, S::npos); - test(S(""), "kante", 0, 1, S::npos); - test(S(""), "oknlr", 0, 2, S::npos); - test(S(""), "pcdro", 0, 4, S::npos); - test(S(""), "bnrpe", 0, 5, S::npos); - test(S(""), "jtdaefblso", 0, 0, S::npos); - test(S(""), "oselktgbca", 0, 1, S::npos); - test(S(""), "eqgaplhckj", 0, 5, S::npos); - test(S(""), "bjahtcmnlp", 0, 9, S::npos); - test(S(""), "hjlcmgpket", 0, 10, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos); - test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos); - test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos); - test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos); - test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos); - test(S(""), "", 1, 0, S::npos); - test(S(""), "lbtqd", 1, 0, S::npos); - test(S(""), "tboim", 1, 1, S::npos); - test(S(""), "slcer", 1, 2, S::npos); - test(S(""), "cbjfs", 1, 4, S::npos); - test(S(""), "aqibs", 1, 5, S::npos); - test(S(""), "gtfblmqinc", 1, 0, S::npos); - test(S(""), "mkqpbtdalg", 1, 1, S::npos); - test(S(""), "kphatlimcd", 1, 5, S::npos); - test(S(""), "pblasqogic", 1, 9, S::npos); - test(S(""), "arosdhcfme", 1, 10, S::npos); - test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos); - test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos); - test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos); - test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos); - test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos); - test(S("eaint"), "", 0, 0, S::npos); - test(S("binja"), "gfsrt", 0, 0, S::npos); - test(S("latkm"), "pfsoc", 0, 1, S::npos); - test(S("lecfr"), "tpflm", 0, 2, S::npos); - test(S("eqkst"), "sgkec", 0, 4, 0); - test(S("cdafr"), "romds", 0, 5, 1); - test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos); - test(S("lbisk"), "pedfirsglo", 0, 1, S::npos); - test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos); - test(S("ehmja"), "dabckmepqj", 0, 9, 0); - test(S("mhqgd"), "pqscrjthli", 0, 10, 1); - test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos); - test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos); - test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos); - test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0); - test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0); - test(S("clrgb"), "", 1, 0, S::npos); - test(S("tjmek"), "osmia", 1, 0, S::npos); - test(S("bgstp"), "ckonl", 1, 1, S::npos); - test(S("hstrk"), "ilcaj", 1, 2, S::npos); - test(S("kmspj"), "lasiq", 1, 4, 2); - test(S("tjboh"), "kfqmr", 1, 5, S::npos); - test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos); - test(S("jkngf"), "gjhmdlqikp", 1, 1, 3); - test(S("gfcql"), "skbgtahqej", 1, 5, S::npos); - test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 2); - test(S("bthpg"), "bjgfmnlkio", 1, 10, 4); - test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos); - test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos); - test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1); - test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1); - test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1); - test(S("ndrhl"), "", 2, 0, S::npos); - test(S("mrecp"), "otkgb", 2, 0, S::npos); - test(S("qlasf"), "cqsjl", 2, 1, S::npos); - test(S("smaqd"), "dpifl", 2, 2, 4); - test(S("hjeni"), "oapht", 2, 4, S::npos); - test(S("ocmfj"), "cifts", 2, 5, 3); - test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos); - test(S("fklad"), "tpksqhamle", 2, 1, S::npos); - test(S("dirnm"), "tpdrchmkji", 2, 5, 2); - test(S("hrgdc"), "ijagfkblst", 2, 9, 2); - test(S("ifakg"), "kpocsignjb", 2, 10, 3); - test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos); - test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos); - test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 3); - test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2); - test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2); - test(S("cjgao"), "", 4, 0, S::npos); - test(S("kjplq"), "mabns", 4, 0, S::npos); - test(S("herni"), "bdnrp", 4, 1, S::npos); - test(S("tadrb"), "scidp", 4, 2, S::npos); - test(S("pkfeo"), "agbjl", 4, 4, S::npos); - test(S("hoser"), "jfmpr", 4, 5, 4); - test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos); - test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos); - test(S("thlnq"), "ndkjeisgcl", 4, 5, S::npos); - test(S("nbmit"), "rnfpqatdeo", 4, 9, 4); - test(S("jgmib"), "bntjlqrfik", 4, 10, 4); - test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos); - test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos); - test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4); - test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4); - test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4); - test(S("klopi"), "", 5, 0, S::npos); - test(S("dajhn"), "psthd", 5, 0, S::npos); - test(S("jbgno"), "rpmjd", 5, 1, S::npos); - test(S("hkjae"), "dfsmk", 5, 2, S::npos); -} - -template <class S> -void test1() -{ - test(S("gbhqo"), "skqne", 5, 4, S::npos); - test(S("ktdor"), "kipnf", 5, 5, S::npos); - test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos); - test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos); - test(S("armql"), "pcdgltbrfj", 5, 5, S::npos); - test(S("cdhjo"), "aekfctpirg", 5, 9, S::npos); - test(S("jcons"), "ledihrsgpf", 5, 10, S::npos); - test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos); - test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos); - test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, S::npos); - test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, S::npos); - test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos); - test(S("gajqn"), "", 6, 0, S::npos); - test(S("stedk"), "hrnat", 6, 0, S::npos); - test(S("tjkaf"), "gsqdt", 6, 1, S::npos); - test(S("dthpe"), "bspkd", 6, 2, S::npos); - test(S("klhde"), "ohcmb", 6, 4, S::npos); - test(S("bhlki"), "heatr", 6, 5, S::npos); - test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos); - test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos); - test(S("dpqbr"), "lmbtdehjrn", 6, 5, S::npos); - test(S("kdhmo"), "teqmcrlgib", 6, 9, S::npos); - test(S("jblqp"), "njolbmspac", 6, 10, S::npos); - test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos); - test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos); - test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, S::npos); - test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos); - test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos); - test(S("jnkrfhotgl"), "", 0, 0, S::npos); - test(S("dltjfngbko"), "rqegt", 0, 0, S::npos); - test(S("bmjlpkiqde"), "dashm", 0, 1, 8); - test(S("skrflobnqm"), "jqirk", 0, 2, 8); - test(S("jkpldtshrm"), "rckeg", 0, 4, 1); - test(S("ghasdbnjqo"), "jscie", 0, 5, 3); - test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos); - test(S("ikthdgcamf"), "gdicosleja", 0, 1, 5); - test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0); - test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0); - test(S("itphbqsker"), "dtablcrseo", 0, 10, 1); - test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos); - test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos); - test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 4); - test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0); - test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0); - test(S("shbcqnmoar"), "", 1, 0, S::npos); - test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos); - test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos); - test(S("getcrsaoji"), "ekosa", 1, 2, 1); - test(S("fjiknedcpq"), "anqhk", 1, 4, 4); - test(S("tkejgnafrm"), "jekca", 1, 5, 1); - test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos); - test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos); - test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1); - test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 4); - test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1); - test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos); - test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos); - test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1); - test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1); - test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1); - test(S("ectnhskflp"), "", 5, 0, S::npos); - test(S("fgtianblpq"), "pijag", 5, 0, S::npos); - test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos); - test(S("astedncjhk"), "qcloh", 5, 2, 6); - test(S("fhlqgcajbr"), "thlmp", 5, 4, S::npos); - test(S("epfhocmdng"), "qidmo", 5, 5, 6); - test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos); - test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5); - test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 7); - test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5); - test(S("jbhcfposld"), "trfqgmckbe", 5, 10, S::npos); - test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos); - test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos); - test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5); - test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5); - test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5); - test(S("shoiedtcjb"), "", 9, 0, S::npos); - test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos); - test(S("dqmregkcfl"), "akmle", 9, 1, S::npos); - test(S("ngcrieqajf"), "iqfkm", 9, 2, S::npos); - test(S("qosmilgnjb"), "tqjsr", 9, 4, S::npos); - test(S("ikabsjtdfl"), "jplqg", 9, 5, 9); - test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos); - test(S("fdnplotmgh"), "morkglpesn", 9, 1, S::npos); - test(S("fdbicojerm"), "dmicerngat", 9, 5, 9); - test(S("mbtafndjcq"), "radgeskbtc", 9, 9, S::npos); - test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, S::npos); - test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos); - test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, S::npos); - test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, S::npos); - test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9); - test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9); - test(S("ncjpmaekbs"), "", 10, 0, S::npos); - test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos); - test(S("pqfhsgilen"), "qnpor", 10, 1, S::npos); - test(S("gqtjsbdckh"), "otdma", 10, 2, S::npos); - test(S("cfkqpjlegi"), "efhjg", 10, 4, S::npos); - test(S("beanrfodgj"), "odpte", 10, 5, S::npos); - test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos); - test(S("iomkfthagj"), "oaklidrbqg", 10, 1, S::npos); -} - -template <class S> -void test2() -{ - test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, S::npos); - test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, S::npos); - test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, S::npos); - test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos); - test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, S::npos); - test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, S::npos); - test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, S::npos); - test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos); - test(S("cqjohampgd"), "", 11, 0, S::npos); - test(S("hobitmpsan"), "aocjb", 11, 0, S::npos); - test(S("tjehkpsalm"), "jbrnk", 11, 1, S::npos); - test(S("ngfbojitcl"), "tqedg", 11, 2, S::npos); - test(S("rcfkdbhgjo"), "nqskp", 11, 4, S::npos); - test(S("qghptonrea"), "eaqkl", 11, 5, S::npos); - test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos); - test(S("hlmgabenti"), "lsftgajqpm", 11, 1, S::npos); - test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, S::npos); - test(S("jqedtkornm"), "shkncmiaqj", 11, 9, S::npos); - test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, S::npos); - test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos); - test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos); - test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, S::npos); - test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos); - test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos); - test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos); - test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos); - test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 4); - test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 3); - test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 3); - test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 3); - test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos); - test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 19); - test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 2); - test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 2); - test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 2); - test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos); - test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 16); - test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 1); - test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0); - test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0); - test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos); - test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos); - test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 6); - test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1); - test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1); - test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 6); - test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos); - test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 19); - test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 4); - test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1); - test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1); - test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos); - test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 7); - test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1); - test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1); - test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1); - test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos); - test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos); - test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 12); - test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, S::npos); - test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10); - test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 15); - test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos); - test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, S::npos); - test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 11); - test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10); - test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 11); - test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos); - test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 18); - test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10); - test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10); - test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10); - test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos); - test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos); - test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, S::npos); - test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, S::npos); - test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, S::npos); - test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19); - test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos); - test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, S::npos); - test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, S::npos); - test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, S::npos); - test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, S::npos); - test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos); - test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, S::npos); - test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19); - test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19); - test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19); - test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos); - test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos); - test(S("grkpahljcftesdmonqib"), "odife", 20, 1, S::npos); - test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, S::npos); - test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, S::npos); - test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, S::npos); - test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos); - test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, S::npos); - test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, S::npos); - test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, S::npos); - test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, S::npos); - test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos); -} - -template <class S> -void test3() -{ - test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, S::npos); - test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, S::npos); - test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, S::npos); - test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos); - test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos); - test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos); - test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, S::npos); - test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, S::npos); - test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, S::npos); - test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, S::npos); - test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos); - test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, S::npos); - test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, S::npos); - test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, S::npos); - test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, S::npos); - test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos); - test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, S::npos); - test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, S::npos); - test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, S::npos); - test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_first_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv1.find_first_of( "irkhs", 0, 5) == SV::npos, "" ); - static_assert (sv2.find_first_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv2.find_first_of( "gfsrt", 0, 5) == SV::npos, "" ); - static_assert (sv2.find_first_of( "lecar", 0, 5) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp deleted file mode 100644 index fddd47171dd82..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_first_of_string_view_size.pass.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// size_type find_first_of(const basic_string_view& str, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.find_first_of(str, pos) == x); - if (x != S::npos) - assert(pos <= x && x < s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.find_first_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, S::npos); - test(S(""), S("laenf"), 0, S::npos); - test(S(""), S("pqlnkmbdjo"), 0, S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos); - test(S(""), S(""), 1, S::npos); - test(S(""), S("bjaht"), 1, S::npos); - test(S(""), S("hjlcmgpket"), 1, S::npos); - test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos); - test(S("fodgq"), S(""), 0, S::npos); - test(S("qanej"), S("dfkap"), 0, 1); - test(S("clbao"), S("ihqrfebgad"), 0, 2); - test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0); - test(S("srdfq"), S(""), 1, S::npos); - test(S("oemth"), S("ikcrq"), 1, S::npos); - test(S("cdaih"), S("dmajblfhsg"), 1, 1); - test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1); - test(S("cshmd"), S(""), 2, S::npos); - test(S("lhcdo"), S("oebqi"), 2, 4); - test(S("qnsoh"), S("kojhpmbsfe"), 2, 2); - test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2); - test(S("fmtsp"), S(""), 4, S::npos); - test(S("khbpm"), S("aobjd"), 4, S::npos); - test(S("pbsji"), S("pcbahntsje"), 4, S::npos); - test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4); - test(S("eqmpa"), S(""), 5, S::npos); - test(S("omigs"), S("kocgb"), 5, S::npos); - test(S("onmje"), S("fbslrjiqkm"), 5, S::npos); - test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos); - test(S("schfa"), S(""), 6, S::npos); - test(S("igdsc"), S("qngpd"), 6, S::npos); - test(S("brqgo"), S("rodhqklgmb"), 6, S::npos); - test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos); - test(S("hcjitbfapl"), S(""), 0, S::npos); - test(S("daiprenocl"), S("ashjd"), 0, 0); - test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0); - test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0); - test(S("qpghtfbaji"), S(""), 1, S::npos); - test(S("gfshlcmdjr"), S("nadkh"), 1, 3); - test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1); - test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1); - test(S("crnklpmegd"), S(""), 5, S::npos); - test(S("jsbtafedoc"), S("prqgn"), 5, S::npos); - test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5); - test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5); - test(S("lmofqdhpki"), S(""), 9, S::npos); - test(S("hnefkqimca"), S("rtjpa"), 9, 9); - test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, S::npos); - test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9); - test(S("elgofjmbrq"), S(""), 10, S::npos); - test(S("mjqdgalkpc"), S("dplqa"), 10, S::npos); - test(S("kthqnfcerm"), S("dkacjoptns"), 10, S::npos); - test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos); - test(S("eqsgalomhb"), S(""), 11, S::npos); - test(S("akiteljmoh"), S("lofbc"), 11, S::npos); - test(S("hlbdfreqjo"), S("astoegbfpn"), 11, S::npos); - test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos); - test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 3); - test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0); - test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0); - test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos); - test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 3); - test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1); - test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1); - test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos); - test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10); - test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10); - test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10); - test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos); - test(S("copqdhstbingamjfkler"), S("djkqc"), 19, S::npos); - test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19); - test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19); - test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, S::npos); - test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, S::npos); - test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos); - test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, S::npos); - test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, S::npos); - test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), S(""), S::npos); - test(S(""), S("laenf"), S::npos); - test(S(""), S("pqlnkmbdjo"), S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), S::npos); - test(S("nhmko"), S(""), S::npos); - test(S("lahfb"), S("irkhs"), 2); - test(S("gmfhd"), S("kantesmpgj"), 0); - test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 0); - test(S("eolhfgpjqk"), S(""), S::npos); - test(S("nbatdlmekr"), S("bnrpe"), 0); - test(S("jdmciepkaq"), S("jtdaefblso"), 0); - test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 0); - test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos); - test(S("qjghlnftcaismkropdeb"), S("bjaht"), 1); - test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 0); - test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp deleted file mode 100644 index 307be23708b3c..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_not_of_char_size.pass.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// const size_type find_last_not_of(charT c, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_last_not_of(c, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.find_last_not_of(c) == x); - if (x != S::npos) - assert(x < s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'i', 0, S::npos); - test(S(""), 'i', 1, S::npos); - test(S("kitcj"), 'i', 0, 0); - test(S("qkamf"), 'i', 1, 1); - test(S("nhmko"), 'i', 2, 2); - test(S("tpsaf"), 'i', 4, 4); - test(S("lahfb"), 'i', 5, 4); - test(S("irkhs"), 'i', 6, 4); - test(S("gmfhdaipsr"), 'i', 0, 0); - test(S("kantesmpgj"), 'i', 1, 1); - test(S("odaftiegpm"), 'i', 5, 4); - test(S("oknlrstdpi"), 'i', 9, 8); - test(S("eolhfgpjqk"), 'i', 10, 9); - test(S("pcdrofikas"), 'i', 11, 9); - test(S("nbatdlmekrgcfqsophij"), 'i', 0, 0); - test(S("bnrpehidofmqtcksjgla"), 'i', 1, 1); - test(S("jdmciepkaqgotsrfnhlb"), 'i', 10, 10); - test(S("jtdaefblsokrmhpgcnqi"), 'i', 19, 18); - test(S("hkbgspofltajcnedqmri"), 'i', 20, 18); - test(S("oselktgbcapndfjihrmq"), 'i', 21, 19); - - test(S(""), 'i', S::npos); - test(S("csope"), 'i', 4); - test(S("gfsmthlkon"), 'i', 9); - test(S("laenfsbridchgotmkqpj"), 'i', 19); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_not_of( 'i', 0 ) == SV::npos, "" ); - static_assert (sv1.find_last_not_of( 'i', 1 ) == SV::npos, "" ); - static_assert (sv2.find_last_not_of( 'a', 0 ) == SV::npos, "" ); - static_assert (sv2.find_last_not_of( 'a', 1 ) == 1, "" ); - static_assert (sv2.find_last_not_of( 'e', 5 ) == 3, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp deleted file mode 100644 index b0d3f0636b21d..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size.pass.cpp +++ /dev/null @@ -1,166 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_last_not_of(str, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.find_last_not_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, S::npos); - test(S(""), "laenf", 0, S::npos); - test(S(""), "pqlnkmbdjo", 0, S::npos); - test(S(""), "qkamfogpnljdcshbreti", 0, S::npos); - test(S(""), "", 1, S::npos); - test(S(""), "bjaht", 1, S::npos); - test(S(""), "hjlcmgpket", 1, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos); - test(S("fodgq"), "", 0, 0); - test(S("qanej"), "dfkap", 0, 0); - test(S("clbao"), "ihqrfebgad", 0, 0); - test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, S::npos); - test(S("srdfq"), "", 1, 1); - test(S("oemth"), "ikcrq", 1, 1); - test(S("cdaih"), "dmajblfhsg", 1, 0); - test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, S::npos); - test(S("cshmd"), "", 2, 2); - test(S("lhcdo"), "oebqi", 2, 2); - test(S("qnsoh"), "kojhpmbsfe", 2, 1); - test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, S::npos); - test(S("fmtsp"), "", 4, 4); - test(S("khbpm"), "aobjd", 4, 4); - test(S("pbsji"), "pcbahntsje", 4, 4); - test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, S::npos); - test(S("eqmpa"), "", 5, 4); - test(S("omigs"), "kocgb", 5, 4); - test(S("onmje"), "fbslrjiqkm", 5, 4); - test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, S::npos); - test(S("schfa"), "", 6, 4); - test(S("igdsc"), "qngpd", 6, 4); - test(S("brqgo"), "rodhqklgmb", 6, S::npos); - test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, S::npos); - test(S("hcjitbfapl"), "", 0, 0); - test(S("daiprenocl"), "ashjd", 0, S::npos); - test(S("litpcfdghe"), "mgojkldsqh", 0, S::npos); - test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, S::npos); - test(S("qpghtfbaji"), "", 1, 1); - test(S("gfshlcmdjr"), "nadkh", 1, 1); - test(S("nkodajteqp"), "ofdrqmkebl", 1, 0); - test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, S::npos); - test(S("crnklpmegd"), "", 5, 5); - test(S("jsbtafedoc"), "prqgn", 5, 5); - test(S("qnmodrtkeb"), "pejafmnokr", 5, 4); - test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, S::npos); - test(S("lmofqdhpki"), "", 9, 9); - test(S("hnefkqimca"), "rtjpa", 9, 8); - test(S("drtasbgmfp"), "ktsrmnqagd", 9, 9); - test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, S::npos); - test(S("elgofjmbrq"), "", 10, 9); - test(S("mjqdgalkpc"), "dplqa", 10, 9); - test(S("kthqnfcerm"), "dkacjoptns", 10, 9); - test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, S::npos); - test(S("eqsgalomhb"), "", 11, 9); - test(S("akiteljmoh"), "lofbc", 11, 9); - test(S("hlbdfreqjo"), "astoegbfpn", 11, 8); - test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), "", 0, 0); - test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, 0); - test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, S::npos); - test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, S::npos); - test(S("jlnkraeodhcspfgbqitm"), "", 1, 1); - test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, 1); - test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 0); - test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, S::npos); - test(S("hdpkobnsalmcfijregtq"), "", 10, 10); - test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 9); - test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 9); - test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, S::npos); - test(S("niptglfbosehkamrdqcj"), "", 19, 19); - test(S("copqdhstbingamjfkler"), "djkqc", 19, 19); - test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 16); - test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, S::npos); - test(S("eaintpchlqsbdgrkjofm"), "", 20, 19); - test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 18); - test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 19); - test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), "", 21, 19); - test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 19); - test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 19); - test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), "", S::npos); - test(S(""), "laenf", S::npos); - test(S(""), "pqlnkmbdjo", S::npos); - test(S(""), "qkamfogpnljdcshbreti", S::npos); - test(S("nhmko"), "", 4); - test(S("lahfb"), "irkhs", 4); - test(S("gmfhd"), "kantesmpgj", 4); - test(S("odaft"), "oknlrstdpiqmjbaghcfe", S::npos); - test(S("eolhfgpjqk"), "", 9); - test(S("nbatdlmekr"), "bnrpe", 8); - test(S("jdmciepkaq"), "jtdaefblso", 9); - test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", S::npos); - test(S("gprdcokbnjhlsfmtieqa"), "", 19); - test(S("qjghlnftcaismkropdeb"), "bjaht", 18); - test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 17); - test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_not_of( "", 0) == SV::npos, "" ); - static_assert (sv1.find_last_not_of( "irkhs", 5) == SV::npos, "" ); - static_assert (sv2.find_last_not_of( "", 0) == 0, "" ); - static_assert (sv2.find_last_not_of( "gfsrt", 5) == 4, "" ); - static_assert (sv2.find_last_not_of( "lecar", 5) == 3, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp deleted file mode 100644 index 8a591ccbe44ac..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_not_of_pointer_size_size.pass.cpp +++ /dev/null @@ -1,393 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.find_last_not_of(str, pos, n) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, S::npos); - test(S(""), "irkhs", 0, 0, S::npos); - test(S(""), "kante", 0, 1, S::npos); - test(S(""), "oknlr", 0, 2, S::npos); - test(S(""), "pcdro", 0, 4, S::npos); - test(S(""), "bnrpe", 0, 5, S::npos); - test(S(""), "jtdaefblso", 0, 0, S::npos); - test(S(""), "oselktgbca", 0, 1, S::npos); - test(S(""), "eqgaplhckj", 0, 5, S::npos); - test(S(""), "bjahtcmnlp", 0, 9, S::npos); - test(S(""), "hjlcmgpket", 0, 10, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos); - test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos); - test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos); - test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos); - test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos); - test(S(""), "", 1, 0, S::npos); - test(S(""), "lbtqd", 1, 0, S::npos); - test(S(""), "tboim", 1, 1, S::npos); - test(S(""), "slcer", 1, 2, S::npos); - test(S(""), "cbjfs", 1, 4, S::npos); - test(S(""), "aqibs", 1, 5, S::npos); - test(S(""), "gtfblmqinc", 1, 0, S::npos); - test(S(""), "mkqpbtdalg", 1, 1, S::npos); - test(S(""), "kphatlimcd", 1, 5, S::npos); - test(S(""), "pblasqogic", 1, 9, S::npos); - test(S(""), "arosdhcfme", 1, 10, S::npos); - test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos); - test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos); - test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos); - test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos); - test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos); - test(S("eaint"), "", 0, 0, 0); - test(S("binja"), "gfsrt", 0, 0, 0); - test(S("latkm"), "pfsoc", 0, 1, 0); - test(S("lecfr"), "tpflm", 0, 2, 0); - test(S("eqkst"), "sgkec", 0, 4, S::npos); - test(S("cdafr"), "romds", 0, 5, 0); - test(S("prbhe"), "qhjistlgmr", 0, 0, 0); - test(S("lbisk"), "pedfirsglo", 0, 1, 0); - test(S("hrlpd"), "aqcoslgrmk", 0, 5, 0); - test(S("ehmja"), "dabckmepqj", 0, 9, S::npos); - test(S("mhqgd"), "pqscrjthli", 0, 10, 0); - test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, 0); - test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, 0); - test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, 0); - test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, S::npos); - test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, S::npos); - test(S("clrgb"), "", 1, 0, 1); - test(S("tjmek"), "osmia", 1, 0, 1); - test(S("bgstp"), "ckonl", 1, 1, 1); - test(S("hstrk"), "ilcaj", 1, 2, 1); - test(S("kmspj"), "lasiq", 1, 4, 1); - test(S("tjboh"), "kfqmr", 1, 5, 1); - test(S("ilbcj"), "klnitfaobg", 1, 0, 1); - test(S("jkngf"), "gjhmdlqikp", 1, 1, 1); - test(S("gfcql"), "skbgtahqej", 1, 5, 1); - test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 1); - test(S("bthpg"), "bjgfmnlkio", 1, 10, 1); - test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, 1); - test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, 1); - test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, S::npos); - test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, S::npos); - test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, S::npos); - test(S("ndrhl"), "", 2, 0, 2); - test(S("mrecp"), "otkgb", 2, 0, 2); - test(S("qlasf"), "cqsjl", 2, 1, 2); - test(S("smaqd"), "dpifl", 2, 2, 2); - test(S("hjeni"), "oapht", 2, 4, 2); - test(S("ocmfj"), "cifts", 2, 5, 2); - test(S("hmftq"), "nmsckbgalo", 2, 0, 2); - test(S("fklad"), "tpksqhamle", 2, 1, 2); - test(S("dirnm"), "tpdrchmkji", 2, 5, 1); - test(S("hrgdc"), "ijagfkblst", 2, 9, 1); - test(S("ifakg"), "kpocsignjb", 2, 10, 2); - test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, 2); - test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, 2); - test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 2); - test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, S::npos); - test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, S::npos); - test(S("cjgao"), "", 4, 0, 4); - test(S("kjplq"), "mabns", 4, 0, 4); - test(S("herni"), "bdnrp", 4, 1, 4); - test(S("tadrb"), "scidp", 4, 2, 4); - test(S("pkfeo"), "agbjl", 4, 4, 4); - test(S("hoser"), "jfmpr", 4, 5, 3); - test(S("kgrsp"), "rbpefghsmj", 4, 0, 4); - test(S("pgejb"), "apsfntdoqc", 4, 1, 4); - test(S("thlnq"), "ndkjeisgcl", 4, 5, 4); - test(S("nbmit"), "rnfpqatdeo", 4, 9, 3); - test(S("jgmib"), "bntjlqrfik", 4, 10, 2); - test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, 4); - test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, 4); - test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 3); - test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 2); - test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, S::npos); - test(S("klopi"), "", 5, 0, 4); - test(S("dajhn"), "psthd", 5, 0, 4); - test(S("jbgno"), "rpmjd", 5, 1, 4); - test(S("hkjae"), "dfsmk", 5, 2, 4); -} - -template <class S> -void test1() -{ - test(S("gbhqo"), "skqne", 5, 4, 4); - test(S("ktdor"), "kipnf", 5, 5, 4); - test(S("ldprn"), "hmrnqdgifl", 5, 0, 4); - test(S("egmjk"), "fsmjcdairn", 5, 1, 4); - test(S("armql"), "pcdgltbrfj", 5, 5, 3); - test(S("cdhjo"), "aekfctpirg", 5, 9, 4); - test(S("jcons"), "ledihrsgpf", 5, 10, 3); - test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, 4); - test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, 4); - test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 1); - test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 2); - test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, S::npos); - test(S("gajqn"), "", 6, 0, 4); - test(S("stedk"), "hrnat", 6, 0, 4); - test(S("tjkaf"), "gsqdt", 6, 1, 4); - test(S("dthpe"), "bspkd", 6, 2, 4); - test(S("klhde"), "ohcmb", 6, 4, 4); - test(S("bhlki"), "heatr", 6, 5, 4); - test(S("lqmoh"), "pmblckedfn", 6, 0, 4); - test(S("mtqin"), "aceqmsrbik", 6, 1, 4); - test(S("dpqbr"), "lmbtdehjrn", 6, 5, 4); - test(S("kdhmo"), "teqmcrlgib", 6, 9, 4); - test(S("jblqp"), "njolbmspac", 6, 10, 3); - test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, 4); - test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, 4); - test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 1); - test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, S::npos); - test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, S::npos); - test(S("jnkrfhotgl"), "", 0, 0, 0); - test(S("dltjfngbko"), "rqegt", 0, 0, 0); - test(S("bmjlpkiqde"), "dashm", 0, 1, 0); - test(S("skrflobnqm"), "jqirk", 0, 2, 0); - test(S("jkpldtshrm"), "rckeg", 0, 4, 0); - test(S("ghasdbnjqo"), "jscie", 0, 5, 0); - test(S("igrkhpbqjt"), "efsphndliq", 0, 0, 0); - test(S("ikthdgcamf"), "gdicosleja", 0, 1, 0); - test(S("pcofgeniam"), "qcpjibosfl", 0, 5, S::npos); - test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, S::npos); - test(S("itphbqsker"), "dtablcrseo", 0, 10, 0); - test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, 0); - test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, 0); - test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, 0); - test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, S::npos); - test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, S::npos); - test(S("shbcqnmoar"), "", 1, 0, 1); - test(S("bdoshlmfin"), "ontrs", 1, 0, 1); - test(S("khfrebnsgq"), "pfkna", 1, 1, 1); - test(S("getcrsaoji"), "ekosa", 1, 2, 0); - test(S("fjiknedcpq"), "anqhk", 1, 4, 1); - test(S("tkejgnafrm"), "jekca", 1, 5, 0); - test(S("jnakolqrde"), "ikemsjgacf", 1, 0, 1); - test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, 1); - test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 0); - test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 1); - test(S("cigfqkated"), "sqcflrgtim", 1, 10, S::npos); - test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, 1); - test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, 1); - test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, S::npos); - test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, S::npos); - test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, S::npos); - test(S("ectnhskflp"), "", 5, 0, 5); - test(S("fgtianblpq"), "pijag", 5, 0, 5); - test(S("mfeqklirnh"), "jrckd", 5, 1, 5); - test(S("astedncjhk"), "qcloh", 5, 2, 5); - test(S("fhlqgcajbr"), "thlmp", 5, 4, 5); - test(S("epfhocmdng"), "qidmo", 5, 5, 5); - test(S("apcnsibger"), "lnegpsjqrd", 5, 0, 5); - test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 4); - test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, 5); - test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 3); - test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 5); - test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, 5); - test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, 5); - test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 1); - test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, S::npos); - test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, S::npos); - test(S("shoiedtcjb"), "", 9, 0, 9); - test(S("ebcinjgads"), "tqbnh", 9, 0, 9); - test(S("dqmregkcfl"), "akmle", 9, 1, 9); - test(S("ngcrieqajf"), "iqfkm", 9, 2, 9); - test(S("qosmilgnjb"), "tqjsr", 9, 4, 9); - test(S("ikabsjtdfl"), "jplqg", 9, 5, 8); - test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, 9); - test(S("fdnplotmgh"), "morkglpesn", 9, 1, 9); - test(S("fdbicojerm"), "dmicerngat", 9, 5, 8); - test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 9); - test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 9); - test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, 9); - test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 9); - test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 9); - test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 3); - test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, S::npos); - test(S("ncjpmaekbs"), "", 10, 0, 9); - test(S("hlbosgmrak"), "hpmsd", 10, 0, 9); - test(S("pqfhsgilen"), "qnpor", 10, 1, 9); - test(S("gqtjsbdckh"), "otdma", 10, 2, 9); - test(S("cfkqpjlegi"), "efhjg", 10, 4, 9); - test(S("beanrfodgj"), "odpte", 10, 5, 9); - test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, 9); - test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 9); -} - -template <class S> -void test2() -{ - test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 8); - test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 9); - test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 8); - test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, 9); - test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 9); - test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 7); - test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 5); - test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, S::npos); - test(S("cqjohampgd"), "", 11, 0, 9); - test(S("hobitmpsan"), "aocjb", 11, 0, 9); - test(S("tjehkpsalm"), "jbrnk", 11, 1, 9); - test(S("ngfbojitcl"), "tqedg", 11, 2, 9); - test(S("rcfkdbhgjo"), "nqskp", 11, 4, 9); - test(S("qghptonrea"), "eaqkl", 11, 5, 7); - test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, 9); - test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 9); - test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 9); - test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 7); - test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 8); - test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, 9); - test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, 9); - test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 8); - test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, S::npos); - test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, S::npos); - test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, 0); - test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, 0); - test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, 0); - test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, 0); - test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, 0); - test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, 0); - test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, 0); - test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, 0); - test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, 0); - test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, 0); - test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, 0); - test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, 0); - test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, 0); - test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, 0); - test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, S::npos); - test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, S::npos); - test(S("febhmqtjanokscdirpgl"), "", 1, 0, 1); - test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, 1); - test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, 1); - test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 0); - test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 0); - test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, 1); - test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, 1); - test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, 1); - test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, 1); - test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 0); - test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 0); - test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, 1); - test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, 1); - test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 0); - test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, S::npos); - test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, S::npos); - test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, 10); - test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, 10); - test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, 10); - test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 10); - test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 9); - test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 10); - test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, 10); - test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 10); - test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 10); - test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 8); - test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 10); - test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, 10); - test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, 10); - test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 8); - test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, S::npos); - test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, S::npos); - test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, 19); - test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, 19); - test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 19); - test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 19); - test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 19); - test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 17); - test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, 19); - test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 19); - test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 19); - test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 19); - test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 19); - test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, 19); - test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 19); - test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 18); - test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 7); - test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, S::npos); - test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, 19); - test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, 19); - test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 19); - test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 19); - test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 18); - test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 18); - test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, 19); - test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 19); - test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 18); - test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 18); - test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 17); - test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, 19); -} - -template <class S> -void test3() -{ - test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 19); - test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 19); - test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 1); - test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, S::npos); - test(S("ecgdanriptblhjfqskom"), "", 21, 0, 19); - test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, 19); - test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 19); - test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 19); - test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 19); - test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 19); - test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, 19); - test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 19); - test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 18); - test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 19); - test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 19); - test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, 19); - test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 19); - test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 19); - test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 7); - test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_not_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv1.find_last_not_of( "irkhs", 0, 5) == SV::npos, "" ); - static_assert (sv2.find_last_not_of( "", 0, 0) == 0, "" ); - static_assert (sv2.find_last_not_of( "gfsrt", 5, 0) == 4, "" ); - static_assert (sv2.find_last_not_of( "lecar", 5, 0) == 4, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp deleted file mode 100644 index 40c867d6b46c8..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_not_of_string_view_size.pass.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// size_type find_last_not_of(const basic_string& str, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.find_last_not_of(str, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.find_last_not_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, S::npos); - test(S(""), S("laenf"), 0, S::npos); - test(S(""), S("pqlnkmbdjo"), 0, S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos); - test(S(""), S(""), 1, S::npos); - test(S(""), S("bjaht"), 1, S::npos); - test(S(""), S("hjlcmgpket"), 1, S::npos); - test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos); - test(S("fodgq"), S(""), 0, 0); - test(S("qanej"), S("dfkap"), 0, 0); - test(S("clbao"), S("ihqrfebgad"), 0, 0); - test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, S::npos); - test(S("srdfq"), S(""), 1, 1); - test(S("oemth"), S("ikcrq"), 1, 1); - test(S("cdaih"), S("dmajblfhsg"), 1, 0); - test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, S::npos); - test(S("cshmd"), S(""), 2, 2); - test(S("lhcdo"), S("oebqi"), 2, 2); - test(S("qnsoh"), S("kojhpmbsfe"), 2, 1); - test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, S::npos); - test(S("fmtsp"), S(""), 4, 4); - test(S("khbpm"), S("aobjd"), 4, 4); - test(S("pbsji"), S("pcbahntsje"), 4, 4); - test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, S::npos); - test(S("eqmpa"), S(""), 5, 4); - test(S("omigs"), S("kocgb"), 5, 4); - test(S("onmje"), S("fbslrjiqkm"), 5, 4); - test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, S::npos); - test(S("schfa"), S(""), 6, 4); - test(S("igdsc"), S("qngpd"), 6, 4); - test(S("brqgo"), S("rodhqklgmb"), 6, S::npos); - test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, S::npos); - test(S("hcjitbfapl"), S(""), 0, 0); - test(S("daiprenocl"), S("ashjd"), 0, S::npos); - test(S("litpcfdghe"), S("mgojkldsqh"), 0, S::npos); - test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, S::npos); - test(S("qpghtfbaji"), S(""), 1, 1); - test(S("gfshlcmdjr"), S("nadkh"), 1, 1); - test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 0); - test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, S::npos); - test(S("crnklpmegd"), S(""), 5, 5); - test(S("jsbtafedoc"), S("prqgn"), 5, 5); - test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 4); - test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, S::npos); - test(S("lmofqdhpki"), S(""), 9, 9); - test(S("hnefkqimca"), S("rtjpa"), 9, 8); - test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 9); - test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, S::npos); - test(S("elgofjmbrq"), S(""), 10, 9); - test(S("mjqdgalkpc"), S("dplqa"), 10, 9); - test(S("kthqnfcerm"), S("dkacjoptns"), 10, 9); - test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, S::npos); - test(S("eqsgalomhb"), S(""), 11, 9); - test(S("akiteljmoh"), S("lofbc"), 11, 9); - test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 8); - test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, S::npos); - test(S("snafbdlghrjkpqtoceim"), S(""), 0, 0); - test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, 0); - test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, S::npos); - test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, S::npos); - test(S("jlnkraeodhcspfgbqitm"), S(""), 1, 1); - test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, 1); - test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 0); - test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, S::npos); - test(S("hdpkobnsalmcfijregtq"), S(""), 10, 10); - test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 9); - test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 9); - test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, S::npos); - test(S("niptglfbosehkamrdqcj"), S(""), 19, 19); - test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 19); - test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 16); - test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, S::npos); - test(S("eaintpchlqsbdgrkjofm"), S(""), 20, 19); - test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 18); - test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 19); - test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, S::npos); - test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, 19); - test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 19); - test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 19); - test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), S(""), S::npos); - test(S(""), S("laenf"), S::npos); - test(S(""), S("pqlnkmbdjo"), S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), S::npos); - test(S("nhmko"), S(""), 4); - test(S("lahfb"), S("irkhs"), 4); - test(S("gmfhd"), S("kantesmpgj"), 4); - test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), S::npos); - test(S("eolhfgpjqk"), S(""), 9); - test(S("nbatdlmekr"), S("bnrpe"), 8); - test(S("jdmciepkaq"), S("jtdaefblso"), 9); - test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), S::npos); - test(S("gprdcokbnjhlsfmtieqa"), S(""), 19); - test(S("qjghlnftcaismkropdeb"), S("bjaht"), 18); - test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 17); - test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp deleted file mode 100644 index b949eec1b3c39..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_of_char_size.pass.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_last_of(charT c, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_last_of(c, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.find_last_of(c) == x); - if (x != S::npos) - assert(x < s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'm', 0, S::npos); - test(S(""), 'm', 1, S::npos); - test(S("kitcj"), 'm', 0, S::npos); - test(S("qkamf"), 'm', 1, S::npos); - test(S("nhmko"), 'm', 2, 2); - test(S("tpsaf"), 'm', 4, S::npos); - test(S("lahfb"), 'm', 5, S::npos); - test(S("irkhs"), 'm', 6, S::npos); - test(S("gmfhdaipsr"), 'm', 0, S::npos); - test(S("kantesmpgj"), 'm', 1, S::npos); - test(S("odaftiegpm"), 'm', 5, S::npos); - test(S("oknlrstdpi"), 'm', 9, S::npos); - test(S("eolhfgpjqk"), 'm', 10, S::npos); - test(S("pcdrofikas"), 'm', 11, S::npos); - test(S("nbatdlmekrgcfqsophij"), 'm', 0, S::npos); - test(S("bnrpehidofmqtcksjgla"), 'm', 1, S::npos); - test(S("jdmciepkaqgotsrfnhlb"), 'm', 10, 2); - test(S("jtdaefblsokrmhpgcnqi"), 'm', 19, 12); - test(S("hkbgspofltajcnedqmri"), 'm', 20, 17); - test(S("oselktgbcapndfjihrmq"), 'm', 21, 18); - - test(S(""), 'm', S::npos); - test(S("csope"), 'm', S::npos); - test(S("gfsmthlkon"), 'm', 3); - test(S("laenfsbridchgotmkqpj"), 'm', 15); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_of( 'i', 0 ) == SV::npos, "" ); - static_assert (sv1.find_last_of( 'i', 1 ) == SV::npos, "" ); - static_assert (sv2.find_last_of( 'a', 0 ) == 0, "" ); - static_assert (sv2.find_last_of( 'a', 1 ) == 0, "" ); - static_assert (sv2.find_last_of( 'e', 5 ) == 4, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp deleted file mode 100644 index 3755b2653d197..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size.pass.cpp +++ /dev/null @@ -1,166 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_last_of(const charT* s, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find_last_of(str, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.find_last_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, S::npos); - test(S(""), "laenf", 0, S::npos); - test(S(""), "pqlnkmbdjo", 0, S::npos); - test(S(""), "qkamfogpnljdcshbreti", 0, S::npos); - test(S(""), "", 1, S::npos); - test(S(""), "bjaht", 1, S::npos); - test(S(""), "hjlcmgpket", 1, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 1, S::npos); - test(S("fodgq"), "", 0, S::npos); - test(S("qanej"), "dfkap", 0, S::npos); - test(S("clbao"), "ihqrfebgad", 0, S::npos); - test(S("mekdn"), "ngtjfcalbseiqrphmkdo", 0, 0); - test(S("srdfq"), "", 1, S::npos); - test(S("oemth"), "ikcrq", 1, S::npos); - test(S("cdaih"), "dmajblfhsg", 1, 1); - test(S("qohtk"), "oqftjhdmkgsblacenirp", 1, 1); - test(S("cshmd"), "", 2, S::npos); - test(S("lhcdo"), "oebqi", 2, S::npos); - test(S("qnsoh"), "kojhpmbsfe", 2, 2); - test(S("pkrof"), "acbsjqogpltdkhinfrem", 2, 2); - test(S("fmtsp"), "", 4, S::npos); - test(S("khbpm"), "aobjd", 4, 2); - test(S("pbsji"), "pcbahntsje", 4, 3); - test(S("mprdj"), "fhepcrntkoagbmldqijs", 4, 4); - test(S("eqmpa"), "", 5, S::npos); - test(S("omigs"), "kocgb", 5, 3); - test(S("onmje"), "fbslrjiqkm", 5, 3); - test(S("oqmrj"), "jeidpcmalhfnqbgtrsko", 5, 4); - test(S("schfa"), "", 6, S::npos); - test(S("igdsc"), "qngpd", 6, 2); - test(S("brqgo"), "rodhqklgmb", 6, 4); - test(S("tnrph"), "thdjgafrlbkoiqcspmne", 6, 4); - test(S("hcjitbfapl"), "", 0, S::npos); - test(S("daiprenocl"), "ashjd", 0, 0); - test(S("litpcfdghe"), "mgojkldsqh", 0, 0); - test(S("aidjksrolc"), "imqnaghkfrdtlopbjesc", 0, 0); - test(S("qpghtfbaji"), "", 1, S::npos); - test(S("gfshlcmdjr"), "nadkh", 1, S::npos); - test(S("nkodajteqp"), "ofdrqmkebl", 1, 1); - test(S("gbmetiprqd"), "bdfjqgatlksriohemnpc", 1, 1); - test(S("crnklpmegd"), "", 5, S::npos); - test(S("jsbtafedoc"), "prqgn", 5, S::npos); - test(S("qnmodrtkeb"), "pejafmnokr", 5, 5); - test(S("cpebqsfmnj"), "odnqkgijrhabfmcestlp", 5, 5); - test(S("lmofqdhpki"), "", 9, S::npos); - test(S("hnefkqimca"), "rtjpa", 9, 9); - test(S("drtasbgmfp"), "ktsrmnqagd", 9, 7); - test(S("lsaijeqhtr"), "rtdhgcisbnmoaqkfpjle", 9, 9); - test(S("elgofjmbrq"), "", 10, S::npos); - test(S("mjqdgalkpc"), "dplqa", 10, 8); - test(S("kthqnfcerm"), "dkacjoptns", 10, 6); - test(S("dfsjhanorc"), "hqfimtrgnbekpdcsjalo", 10, 9); - test(S("eqsgalomhb"), "", 11, S::npos); - test(S("akiteljmoh"), "lofbc", 11, 8); - test(S("hlbdfreqjo"), "astoegbfpn", 11, 9); - test(S("taqobhlerg"), "pdgreqomsncafklhtibj", 11, 9); - test(S("snafbdlghrjkpqtoceim"), "", 0, S::npos); - test(S("aemtbrgcklhndjisfpoq"), "lbtqd", 0, S::npos); - test(S("pnracgfkjdiholtbqsem"), "tboimldpjh", 0, 0); - test(S("dicfltehbsgrmojnpkaq"), "slcerthdaiqjfnobgkpm", 0, 0); - test(S("jlnkraeodhcspfgbqitm"), "", 1, S::npos); - test(S("lhosrngtmfjikbqpcade"), "aqibs", 1, S::npos); - test(S("rbtaqjhgkneisldpmfoc"), "gtfblmqinc", 1, 1); - test(S("gpifsqlrdkbonjtmheca"), "mkqpbtdalgniorhfescj", 1, 1); - test(S("hdpkobnsalmcfijregtq"), "", 10, S::npos); - test(S("jtlshdgqaiprkbcoenfm"), "pblas", 10, 10); - test(S("fkdrbqltsgmcoiphneaj"), "arosdhcfme", 10, 10); - test(S("crsplifgtqedjohnabmk"), "blkhjeogicatqfnpdmsr", 10, 10); - test(S("niptglfbosehkamrdqcj"), "", 19, S::npos); - test(S("copqdhstbingamjfkler"), "djkqc", 19, 16); - test(S("mrtaefilpdsgocnhqbjk"), "lgokshjtpb", 19, 19); - test(S("kojatdhlcmigpbfrqnes"), "bqjhtkfepimcnsgrlado", 19, 19); - test(S("eaintpchlqsbdgrkjofm"), "", 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), "nocfa", 20, 19); - test(S("spocfaktqdbiejlhngmr"), "bgtajmiedc", 20, 18); - test(S("rphmlekgfscndtaobiqj"), "lsckfnqgdahejiopbtmr", 20, 19); - test(S("liatsqdoegkmfcnbhrpj"), "", 21, S::npos); - test(S("binjagtfldkrspcomqeh"), "gfsrt", 21, 12); - test(S("latkmisecnorjbfhqpdg"), "pfsocbhjtm", 21, 17); - test(S("lecfratdjkhnsmqpoigb"), "tpflmdnoicjgkberhqsa", 21, 19); -} - -template <class S> -void test1() -{ - test(S(""), "", S::npos); - test(S(""), "laenf", S::npos); - test(S(""), "pqlnkmbdjo", S::npos); - test(S(""), "qkamfogpnljdcshbreti", S::npos); - test(S("nhmko"), "", S::npos); - test(S("lahfb"), "irkhs", 2); - test(S("gmfhd"), "kantesmpgj", 1); - test(S("odaft"), "oknlrstdpiqmjbaghcfe", 4); - test(S("eolhfgpjqk"), "", S::npos); - test(S("nbatdlmekr"), "bnrpe", 9); - test(S("jdmciepkaq"), "jtdaefblso", 8); - test(S("hkbgspoflt"), "oselktgbcapndfjihrmq", 9); - test(S("gprdcokbnjhlsfmtieqa"), "", S::npos); - test(S("qjghlnftcaismkropdeb"), "bjaht", 19); - test(S("pnalfrdtkqcmojiesbhg"), "hjlcmgpket", 19); - test(S("pniotcfrhqsmgdkjbael"), "htaobedqikfplcgjsmrn", 19); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_of( "", 0) == SV::npos, "" ); - static_assert (sv1.find_last_of( "irkhs", 5) == SV::npos, "" ); - static_assert (sv2.find_last_of( "", 0) == SV::npos, "" ); - static_assert (sv2.find_last_of( "gfsrt", 5) == SV::npos, "" ); - static_assert (sv2.find_last_of( "lecar", 5) == 4, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp deleted file mode 100644 index 64b29ec7da6f4..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp +++ /dev/null @@ -1,393 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.find_last_of(str, pos, n) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, S::npos); - test(S(""), "irkhs", 0, 0, S::npos); - test(S(""), "kante", 0, 1, S::npos); - test(S(""), "oknlr", 0, 2, S::npos); - test(S(""), "pcdro", 0, 4, S::npos); - test(S(""), "bnrpe", 0, 5, S::npos); - test(S(""), "jtdaefblso", 0, 0, S::npos); - test(S(""), "oselktgbca", 0, 1, S::npos); - test(S(""), "eqgaplhckj", 0, 5, S::npos); - test(S(""), "bjahtcmnlp", 0, 9, S::npos); - test(S(""), "hjlcmgpket", 0, 10, S::npos); - test(S(""), "htaobedqikfplcgjsmrn", 0, 0, S::npos); - test(S(""), "hpqiarojkcdlsgnmfetb", 0, 1, S::npos); - test(S(""), "dfkaprhjloqetcsimnbg", 0, 10, S::npos); - test(S(""), "ihqrfebgadntlpmjksoc", 0, 19, S::npos); - test(S(""), "ngtjfcalbseiqrphmkdo", 0, 20, S::npos); - test(S(""), "", 1, 0, S::npos); - test(S(""), "lbtqd", 1, 0, S::npos); - test(S(""), "tboim", 1, 1, S::npos); - test(S(""), "slcer", 1, 2, S::npos); - test(S(""), "cbjfs", 1, 4, S::npos); - test(S(""), "aqibs", 1, 5, S::npos); - test(S(""), "gtfblmqinc", 1, 0, S::npos); - test(S(""), "mkqpbtdalg", 1, 1, S::npos); - test(S(""), "kphatlimcd", 1, 5, S::npos); - test(S(""), "pblasqogic", 1, 9, S::npos); - test(S(""), "arosdhcfme", 1, 10, S::npos); - test(S(""), "blkhjeogicatqfnpdmsr", 1, 0, S::npos); - test(S(""), "bmhineprjcoadgstflqk", 1, 1, S::npos); - test(S(""), "djkqcmetslnghpbarfoi", 1, 10, S::npos); - test(S(""), "lgokshjtpbemarcdqnfi", 1, 19, S::npos); - test(S(""), "bqjhtkfepimcnsgrlado", 1, 20, S::npos); - test(S("eaint"), "", 0, 0, S::npos); - test(S("binja"), "gfsrt", 0, 0, S::npos); - test(S("latkm"), "pfsoc", 0, 1, S::npos); - test(S("lecfr"), "tpflm", 0, 2, S::npos); - test(S("eqkst"), "sgkec", 0, 4, 0); - test(S("cdafr"), "romds", 0, 5, S::npos); - test(S("prbhe"), "qhjistlgmr", 0, 0, S::npos); - test(S("lbisk"), "pedfirsglo", 0, 1, S::npos); - test(S("hrlpd"), "aqcoslgrmk", 0, 5, S::npos); - test(S("ehmja"), "dabckmepqj", 0, 9, 0); - test(S("mhqgd"), "pqscrjthli", 0, 10, S::npos); - test(S("tgklq"), "kfphdcsjqmobliagtren", 0, 0, S::npos); - test(S("bocjs"), "rokpefncljibsdhqtagm", 0, 1, S::npos); - test(S("grbsd"), "afionmkphlebtcjqsgrd", 0, 10, S::npos); - test(S("ofjqr"), "aenmqplidhkofrjbctsg", 0, 19, 0); - test(S("btlfi"), "osjmbtcadhiklegrpqnf", 0, 20, 0); - test(S("clrgb"), "", 1, 0, S::npos); - test(S("tjmek"), "osmia", 1, 0, S::npos); - test(S("bgstp"), "ckonl", 1, 1, S::npos); - test(S("hstrk"), "ilcaj", 1, 2, S::npos); - test(S("kmspj"), "lasiq", 1, 4, S::npos); - test(S("tjboh"), "kfqmr", 1, 5, S::npos); - test(S("ilbcj"), "klnitfaobg", 1, 0, S::npos); - test(S("jkngf"), "gjhmdlqikp", 1, 1, S::npos); - test(S("gfcql"), "skbgtahqej", 1, 5, 0); - test(S("dqtlg"), "bjsdgtlpkf", 1, 9, 0); - test(S("bthpg"), "bjgfmnlkio", 1, 10, 0); - test(S("dgsnq"), "lbhepotfsjdqigcnamkr", 1, 0, S::npos); - test(S("rmfhp"), "tebangckmpsrqdlfojhi", 1, 1, S::npos); - test(S("jfdam"), "joflqbdkhtegimscpanr", 1, 10, 1); - test(S("edapb"), "adpmcohetfbsrjinlqkg", 1, 19, 1); - test(S("brfsm"), "iacldqjpfnogbsrhmetk", 1, 20, 1); - test(S("ndrhl"), "", 2, 0, S::npos); - test(S("mrecp"), "otkgb", 2, 0, S::npos); - test(S("qlasf"), "cqsjl", 2, 1, S::npos); - test(S("smaqd"), "dpifl", 2, 2, S::npos); - test(S("hjeni"), "oapht", 2, 4, 0); - test(S("ocmfj"), "cifts", 2, 5, 1); - test(S("hmftq"), "nmsckbgalo", 2, 0, S::npos); - test(S("fklad"), "tpksqhamle", 2, 1, S::npos); - test(S("dirnm"), "tpdrchmkji", 2, 5, 2); - test(S("hrgdc"), "ijagfkblst", 2, 9, 2); - test(S("ifakg"), "kpocsignjb", 2, 10, 0); - test(S("ebrgd"), "pecqtkjsnbdrialgmohf", 2, 0, S::npos); - test(S("rcjml"), "aiortphfcmkjebgsndql", 2, 1, S::npos); - test(S("peqmt"), "sdbkeamglhipojqftrcn", 2, 10, 1); - test(S("frehn"), "ljqncehgmfktroapidbs", 2, 19, 2); - test(S("tqolf"), "rtcfodilamkbenjghqps", 2, 20, 2); - test(S("cjgao"), "", 4, 0, S::npos); - test(S("kjplq"), "mabns", 4, 0, S::npos); - test(S("herni"), "bdnrp", 4, 1, S::npos); - test(S("tadrb"), "scidp", 4, 2, S::npos); - test(S("pkfeo"), "agbjl", 4, 4, S::npos); - test(S("hoser"), "jfmpr", 4, 5, 4); - test(S("kgrsp"), "rbpefghsmj", 4, 0, S::npos); - test(S("pgejb"), "apsfntdoqc", 4, 1, S::npos); - test(S("thlnq"), "ndkjeisgcl", 4, 5, 3); - test(S("nbmit"), "rnfpqatdeo", 4, 9, 4); - test(S("jgmib"), "bntjlqrfik", 4, 10, 4); - test(S("ncrfj"), "kcrtmpolnaqejghsfdbi", 4, 0, S::npos); - test(S("ncsik"), "lobheanpkmqidsrtcfgj", 4, 1, S::npos); - test(S("sgbfh"), "athdkljcnreqbgpmisof", 4, 10, 4); - test(S("dktbn"), "qkdmjialrscpbhefgont", 4, 19, 4); - test(S("fthqm"), "dmasojntqleribkgfchp", 4, 20, 4); - test(S("klopi"), "", 5, 0, S::npos); - test(S("dajhn"), "psthd", 5, 0, S::npos); - test(S("jbgno"), "rpmjd", 5, 1, S::npos); - test(S("hkjae"), "dfsmk", 5, 2, S::npos); -} - -template <class S> -void test1() -{ - test(S("gbhqo"), "skqne", 5, 4, 3); - test(S("ktdor"), "kipnf", 5, 5, 0); - test(S("ldprn"), "hmrnqdgifl", 5, 0, S::npos); - test(S("egmjk"), "fsmjcdairn", 5, 1, S::npos); - test(S("armql"), "pcdgltbrfj", 5, 5, 4); - test(S("cdhjo"), "aekfctpirg", 5, 9, 0); - test(S("jcons"), "ledihrsgpf", 5, 10, 4); - test(S("cbrkp"), "mqcklahsbtirgopefndj", 5, 0, S::npos); - test(S("fhgna"), "kmlthaoqgecrnpdbjfis", 5, 1, S::npos); - test(S("ejfcd"), "sfhbamcdptojlkrenqgi", 5, 10, 4); - test(S("kqjhe"), "pbniofmcedrkhlstgaqj", 5, 19, 4); - test(S("pbdjl"), "mongjratcskbhqiepfdl", 5, 20, 4); - test(S("gajqn"), "", 6, 0, S::npos); - test(S("stedk"), "hrnat", 6, 0, S::npos); - test(S("tjkaf"), "gsqdt", 6, 1, S::npos); - test(S("dthpe"), "bspkd", 6, 2, S::npos); - test(S("klhde"), "ohcmb", 6, 4, 2); - test(S("bhlki"), "heatr", 6, 5, 1); - test(S("lqmoh"), "pmblckedfn", 6, 0, S::npos); - test(S("mtqin"), "aceqmsrbik", 6, 1, S::npos); - test(S("dpqbr"), "lmbtdehjrn", 6, 5, 3); - test(S("kdhmo"), "teqmcrlgib", 6, 9, 3); - test(S("jblqp"), "njolbmspac", 6, 10, 4); - test(S("qmjgl"), "pofnhidklamecrbqjgst", 6, 0, S::npos); - test(S("rothp"), "jbhckmtgrqnosafedpli", 6, 1, S::npos); - test(S("ghknq"), "dobntpmqklicsahgjerf", 6, 10, 4); - test(S("eopfi"), "tpdshainjkbfoemlrgcq", 6, 19, 4); - test(S("dsnmg"), "oldpfgeakrnitscbjmqh", 6, 20, 4); - test(S("jnkrfhotgl"), "", 0, 0, S::npos); - test(S("dltjfngbko"), "rqegt", 0, 0, S::npos); - test(S("bmjlpkiqde"), "dashm", 0, 1, S::npos); - test(S("skrflobnqm"), "jqirk", 0, 2, S::npos); - test(S("jkpldtshrm"), "rckeg", 0, 4, S::npos); - test(S("ghasdbnjqo"), "jscie", 0, 5, S::npos); - test(S("igrkhpbqjt"), "efsphndliq", 0, 0, S::npos); - test(S("ikthdgcamf"), "gdicosleja", 0, 1, S::npos); - test(S("pcofgeniam"), "qcpjibosfl", 0, 5, 0); - test(S("rlfjgesqhc"), "lrhmefnjcq", 0, 9, 0); - test(S("itphbqsker"), "dtablcrseo", 0, 10, S::npos); - test(S("skjafcirqm"), "apckjsftedbhgomrnilq", 0, 0, S::npos); - test(S("tcqomarsfd"), "pcbrgflehjtiadnsokqm", 0, 1, S::npos); - test(S("rocfeldqpk"), "nsiadegjklhobrmtqcpf", 0, 10, S::npos); - test(S("cfpegndlkt"), "cpmajdqnolikhgsbretf", 0, 19, 0); - test(S("fqbtnkeasj"), "jcflkntmgiqrphdosaeb", 0, 20, 0); - test(S("shbcqnmoar"), "", 1, 0, S::npos); - test(S("bdoshlmfin"), "ontrs", 1, 0, S::npos); - test(S("khfrebnsgq"), "pfkna", 1, 1, S::npos); - test(S("getcrsaoji"), "ekosa", 1, 2, 1); - test(S("fjiknedcpq"), "anqhk", 1, 4, S::npos); - test(S("tkejgnafrm"), "jekca", 1, 5, 1); - test(S("jnakolqrde"), "ikemsjgacf", 1, 0, S::npos); - test(S("lcjptsmgbe"), "arolgsjkhm", 1, 1, S::npos); - test(S("itfsmcjorl"), "oftkbldhre", 1, 5, 1); - test(S("omchkfrjea"), "gbkqdoeftl", 1, 9, 0); - test(S("cigfqkated"), "sqcflrgtim", 1, 10, 1); - test(S("tscenjikml"), "fmhbkislrjdpanogqcet", 1, 0, S::npos); - test(S("qcpaemsinf"), "rnioadktqlgpbcjsmhef", 1, 1, S::npos); - test(S("gltkojeipd"), "oakgtnldpsefihqmjcbr", 1, 10, 1); - test(S("qistfrgnmp"), "gbnaelosidmcjqktfhpr", 1, 19, 1); - test(S("bdnpfcqaem"), "akbripjhlosndcmqgfet", 1, 20, 1); - test(S("ectnhskflp"), "", 5, 0, S::npos); - test(S("fgtianblpq"), "pijag", 5, 0, S::npos); - test(S("mfeqklirnh"), "jrckd", 5, 1, S::npos); - test(S("astedncjhk"), "qcloh", 5, 2, S::npos); - test(S("fhlqgcajbr"), "thlmp", 5, 4, 2); - test(S("epfhocmdng"), "qidmo", 5, 5, 4); - test(S("apcnsibger"), "lnegpsjqrd", 5, 0, S::npos); - test(S("aqkocrbign"), "rjqdablmfs", 5, 1, 5); - test(S("ijsmdtqgce"), "enkgpbsjaq", 5, 5, S::npos); - test(S("clobgsrken"), "kdsgoaijfh", 5, 9, 5); - test(S("jbhcfposld"), "trfqgmckbe", 5, 10, 4); - test(S("oqnpblhide"), "igetsracjfkdnpoblhqm", 5, 0, S::npos); - test(S("lroeasctif"), "nqctfaogirshlekbdjpm", 5, 1, S::npos); - test(S("bpjlgmiedh"), "csehfgomljdqinbartkp", 5, 10, 5); - test(S("pamkeoidrj"), "qahoegcmplkfsjbdnitr", 5, 19, 5); - test(S("espogqbthk"), "dpteiajrqmsognhlfbkc", 5, 20, 5); - test(S("shoiedtcjb"), "", 9, 0, S::npos); - test(S("ebcinjgads"), "tqbnh", 9, 0, S::npos); - test(S("dqmregkcfl"), "akmle", 9, 1, S::npos); - test(S("ngcrieqajf"), "iqfkm", 9, 2, 6); - test(S("qosmilgnjb"), "tqjsr", 9, 4, 8); - test(S("ikabsjtdfl"), "jplqg", 9, 5, 9); - test(S("ersmicafdh"), "oilnrbcgtj", 9, 0, S::npos); - test(S("fdnplotmgh"), "morkglpesn", 9, 1, 7); - test(S("fdbicojerm"), "dmicerngat", 9, 5, 9); - test(S("mbtafndjcq"), "radgeskbtc", 9, 9, 6); - test(S("mlenkpfdtc"), "ljikprsmqo", 9, 10, 5); - test(S("ahlcifdqgs"), "trqihkcgsjamfdbolnpe", 9, 0, S::npos); - test(S("bgjemaltks"), "lqmthbsrekajgnofcipd", 9, 1, 6); - test(S("pdhslbqrfc"), "jtalmedribkgqsopcnfh", 9, 10, 7); - test(S("dirhtsnjkc"), "spqfoiclmtagejbndkrh", 9, 19, 9); - test(S("dlroktbcja"), "nmotklspigjrdhcfaebq", 9, 20, 9); - test(S("ncjpmaekbs"), "", 10, 0, S::npos); - test(S("hlbosgmrak"), "hpmsd", 10, 0, S::npos); - test(S("pqfhsgilen"), "qnpor", 10, 1, 1); - test(S("gqtjsbdckh"), "otdma", 10, 2, 2); - test(S("cfkqpjlegi"), "efhjg", 10, 4, 7); - test(S("beanrfodgj"), "odpte", 10, 5, 7); - test(S("adtkqpbjfi"), "bctdgfmolr", 10, 0, S::npos); - test(S("iomkfthagj"), "oaklidrbqg", 10, 1, 1); -} - -template <class S> -void test2() -{ - test(S("sdpcilonqj"), "dnjfsagktr", 10, 5, 9); - test(S("gtfbdkqeml"), "nejaktmiqg", 10, 9, 8); - test(S("bmeqgcdorj"), "pjqonlebsf", 10, 10, 9); - test(S("etqlcanmob"), "dshmnbtolcjepgaikfqr", 10, 0, S::npos); - test(S("roqmkbdtia"), "iogfhpabtjkqlrnemcds", 10, 1, 8); - test(S("kadsithljf"), "ngridfabjsecpqltkmoh", 10, 10, 9); - test(S("sgtkpbfdmh"), "athmknplcgofrqejsdib", 10, 19, 9); - test(S("qgmetnabkl"), "ldobhmqcafnjtkeisgrp", 10, 20, 9); - test(S("cqjohampgd"), "", 11, 0, S::npos); - test(S("hobitmpsan"), "aocjb", 11, 0, S::npos); - test(S("tjehkpsalm"), "jbrnk", 11, 1, 1); - test(S("ngfbojitcl"), "tqedg", 11, 2, 7); - test(S("rcfkdbhgjo"), "nqskp", 11, 4, 3); - test(S("qghptonrea"), "eaqkl", 11, 5, 9); - test(S("hnprfgqjdl"), "reaoicljqm", 11, 0, S::npos); - test(S("hlmgabenti"), "lsftgajqpm", 11, 1, 1); - test(S("ofcjanmrbs"), "rlpfogmits", 11, 5, 7); - test(S("jqedtkornm"), "shkncmiaqj", 11, 9, 9); - test(S("rfedlasjmg"), "fpnatrhqgs", 11, 10, 9); - test(S("talpqjsgkm"), "sjclemqhnpdbgikarfot", 11, 0, S::npos); - test(S("lrkcbtqpie"), "otcmedjikgsfnqbrhpla", 11, 1, S::npos); - test(S("cipogdskjf"), "bonsaefdqiprkhlgtjcm", 11, 10, 9); - test(S("nqedcojahi"), "egpscmahijlfnkrodqtb", 11, 19, 9); - test(S("hefnrkmctj"), "kmqbfepjthgilscrndoa", 11, 20, 9); - test(S("atqirnmekfjolhpdsgcb"), "", 0, 0, S::npos); - test(S("echfkmlpribjnqsaogtd"), "prboq", 0, 0, S::npos); - test(S("qnhiftdgcleajbpkrosm"), "fjcqh", 0, 1, S::npos); - test(S("chamfknorbedjitgslpq"), "fmosa", 0, 2, S::npos); - test(S("njhqpibfmtlkaecdrgso"), "qdbok", 0, 4, S::npos); - test(S("ebnghfsqkprmdcljoiat"), "amslg", 0, 5, S::npos); - test(S("letjomsgihfrpqbkancd"), "smpltjneqb", 0, 0, S::npos); - test(S("nblgoipcrqeaktshjdmf"), "flitskrnge", 0, 1, S::npos); - test(S("cehkbngtjoiflqapsmrd"), "pgqihmlbef", 0, 5, S::npos); - test(S("mignapfoklbhcqjetdrs"), "cfpdqjtgsb", 0, 9, S::npos); - test(S("ceatbhlsqjgpnokfrmdi"), "htpsiaflom", 0, 10, S::npos); - test(S("ocihkjgrdelpfnmastqb"), "kpjfiaceghsrdtlbnomq", 0, 0, S::npos); - test(S("noelgschdtbrjfmiqkap"), "qhtbomidljgafneksprc", 0, 1, S::npos); - test(S("dkclqfombepritjnghas"), "nhtjobkcefldimpsaqgr", 0, 10, S::npos); - test(S("miklnresdgbhqcojftap"), "prabcjfqnoeskilmtgdh", 0, 19, 0); - test(S("htbcigojaqmdkfrnlsep"), "dtrgmchilkasqoebfpjn", 0, 20, 0); - test(S("febhmqtjanokscdirpgl"), "", 1, 0, S::npos); - test(S("loakbsqjpcrdhftniegm"), "sqome", 1, 0, S::npos); - test(S("reagphsqflbitdcjmkno"), "smfte", 1, 1, S::npos); - test(S("jitlfrqemsdhkopncabg"), "ciboh", 1, 2, 1); - test(S("mhtaepscdnrjqgbkifol"), "haois", 1, 4, 1); - test(S("tocesrfmnglpbjihqadk"), "abfki", 1, 5, S::npos); - test(S("lpfmctjrhdagneskbqoi"), "frdkocntmq", 1, 0, S::npos); - test(S("lsmqaepkdhncirbtjfgo"), "oasbpedlnr", 1, 1, S::npos); - test(S("epoiqmtldrabnkjhcfsg"), "kltqmhgand", 1, 5, S::npos); - test(S("emgasrilpknqojhtbdcf"), "gdtfjchpmr", 1, 9, 1); - test(S("hnfiagdpcklrjetqbsom"), "ponmcqblet", 1, 10, 1); - test(S("nsdfebgajhmtricpoklq"), "sgphqdnofeiklatbcmjr", 1, 0, S::npos); - test(S("atjgfsdlpobmeiqhncrk"), "ljqprsmigtfoneadckbh", 1, 1, S::npos); - test(S("sitodfgnrejlahcbmqkp"), "ligeojhafnkmrcsqtbdp", 1, 10, 1); - test(S("fraghmbiceknltjpqosd"), "lsimqfnjarbopedkhcgt", 1, 19, 1); - test(S("pmafenlhqtdbkirjsogc"), "abedmfjlghniorcqptks", 1, 20, 1); - test(S("pihgmoeqtnakrjslcbfd"), "", 10, 0, S::npos); - test(S("gjdkeprctqblnhiafsom"), "hqtoa", 10, 0, S::npos); - test(S("mkpnblfdsahrcqijteog"), "cahif", 10, 1, S::npos); - test(S("gckarqnelodfjhmbptis"), "kehis", 10, 2, 7); - test(S("gqpskidtbclomahnrjfe"), "kdlmh", 10, 4, 10); - test(S("pkldjsqrfgitbhmaecno"), "paeql", 10, 5, 6); - test(S("aftsijrbeklnmcdqhgop"), "aghoqiefnb", 10, 0, S::npos); - test(S("mtlgdrhafjkbiepqnsoc"), "jrbqaikpdo", 10, 1, 9); - test(S("pqgirnaefthokdmbsclj"), "smjonaeqcl", 10, 5, 5); - test(S("kpdbgjmtherlsfcqoina"), "eqbdrkcfah", 10, 9, 10); - test(S("jrlbothiknqmdgcfasep"), "kapmsienhf", 10, 10, 9); - test(S("mjogldqferckabinptsh"), "jpqotrlenfcsbhkaimdg", 10, 0, S::npos); - test(S("apoklnefbhmgqcdrisjt"), "jlbmhnfgtcqprikeados", 10, 1, S::npos); - test(S("ifeopcnrjbhkdgatmqls"), "stgbhfmdaljnpqoicker", 10, 10, 10); - test(S("ckqhaiesmjdnrgolbtpf"), "oihcetflbjagdsrkmqpn", 10, 19, 10); - test(S("bnlgapfimcoterskqdjh"), "adtclebmnpjsrqfkigoh", 10, 20, 10); - test(S("kgdlrobpmjcthqsafeni"), "", 19, 0, S::npos); - test(S("dfkechomjapgnslbtqir"), "beafg", 19, 0, S::npos); - test(S("rloadknfbqtgmhcsipje"), "iclat", 19, 1, 16); - test(S("mgjhkolrnadqbpetcifs"), "rkhnf", 19, 2, 7); - test(S("cmlfakiojdrgtbsphqen"), "clshq", 19, 4, 16); - test(S("kghbfipeomsntdalrqjc"), "dtcoj", 19, 5, 19); - test(S("eldiqckrnmtasbghjfpo"), "rqosnjmfth", 19, 0, S::npos); - test(S("abqjcfedgotihlnspkrm"), "siatdfqglh", 19, 1, 15); - test(S("qfbadrtjsimkolcenhpg"), "mrlshtpgjq", 19, 5, 17); - test(S("abseghclkjqifmtodrnp"), "adlcskgqjt", 19, 9, 16); - test(S("ibmsnlrjefhtdokacqpg"), "drshcjknaf", 19, 10, 16); - test(S("mrkfciqjebaponsthldg"), "etsaqroinghpkjdlfcbm", 19, 0, S::npos); - test(S("mjkticdeoqshpalrfbgn"), "sgepdnkqliambtrocfhj", 19, 1, 10); - test(S("rqnoclbdejgiphtfsakm"), "nlmcjaqgbsortfdihkpe", 19, 10, 19); - test(S("plkqbhmtfaeodjcrsing"), "racfnpmosldibqkghjet", 19, 19, 19); - test(S("oegalhmstjrfickpbndq"), "fjhdsctkqeiolagrnmbp", 19, 20, 19); - test(S("rdtgjcaohpblniekmsfq"), "", 20, 0, S::npos); - test(S("ofkqbnjetrmsaidphglc"), "ejanp", 20, 0, S::npos); - test(S("grkpahljcftesdmonqib"), "odife", 20, 1, 15); - test(S("jimlgbhfqkteospardcn"), "okaqd", 20, 2, 12); - test(S("gftenihpmslrjkqadcob"), "lcdbi", 20, 4, 19); - test(S("bmhldogtckrfsanijepq"), "fsqbj", 20, 5, 19); - test(S("nfqkrpjdesabgtlcmoih"), "bigdomnplq", 20, 0, S::npos); - test(S("focalnrpiqmdkstehbjg"), "apiblotgcd", 20, 1, 3); - test(S("rhqdspkmebiflcotnjga"), "acfhdenops", 20, 5, 19); - test(S("rahdtmsckfboqlpniegj"), "jopdeamcrk", 20, 9, 19); - test(S("fbkeiopclstmdqranjhg"), "trqncbkgmh", 20, 10, 19); - test(S("lifhpdgmbconstjeqark"), "tomglrkencbsfjqpihda", 20, 0, S::npos); -} - -template <class S> -void test3() -{ - test(S("pboqganrhedjmltsicfk"), "gbkhdnpoietfcmrslajq", 20, 1, 4); - test(S("klchabsimetjnqgorfpd"), "rtfnmbsglkjaichoqedp", 20, 10, 17); - test(S("sirfgmjqhctndbklaepo"), "ohkmdpfqbsacrtjnlgei", 20, 19, 19); - test(S("rlbdsiceaonqjtfpghkm"), "dlbrteoisgphmkncajfq", 20, 20, 19); - test(S("ecgdanriptblhjfqskom"), "", 21, 0, S::npos); - test(S("fdmiarlpgcskbhoteqjn"), "sjrlo", 21, 0, S::npos); - test(S("rlbstjqopignecmfadkh"), "qjpor", 21, 1, 6); - test(S("grjpqmbshektdolcafni"), "odhfn", 21, 2, 13); - test(S("sakfcohtqnibprjmlged"), "qtfin", 21, 4, 10); - test(S("mjtdglasihqpocebrfkn"), "hpqfo", 21, 5, 17); - test(S("okaplfrntghqbmeicsdj"), "fabmertkos", 21, 0, S::npos); - test(S("sahngemrtcjidqbklfpo"), "brqtgkmaej", 21, 1, 14); - test(S("dlmsipcnekhbgoaftqjr"), "nfrdeihsgl", 21, 5, 19); - test(S("ahegrmqnoiklpfsdbcjt"), "hlfrosekpi", 21, 9, 14); - test(S("hdsjbnmlegtkqripacof"), "atgbkrjdsm", 21, 10, 16); - test(S("pcnedrfjihqbalkgtoms"), "blnrptjgqmaifsdkhoec", 21, 0, S::npos); - test(S("qjidealmtpskrbfhocng"), "ctpmdahebfqjgknloris", 21, 1, 17); - test(S("qeindtagmokpfhsclrbj"), "apnkeqthrmlbfodiscgj", 21, 10, 17); - test(S("kpfegbjhsrnodltqciam"), "jdgictpframeoqlsbknh", 21, 19, 19); - test(S("hnbrcplsjfgiktoedmaq"), "qprlsfojamgndekthibc", 21, 20, 19); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find_last_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv1.find_last_of( "irkhs", 0, 5) == SV::npos, "" ); - static_assert (sv2.find_last_of( "", 0, 0) == SV::npos, "" ); - static_assert (sv2.find_last_of( "gfsrt", 5, 5) == SV::npos, "" ); - static_assert (sv2.find_last_of( "lecar", 5, 5) == 4, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp deleted file mode 100644 index 6fd3772fcc7dc..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_last_of_string_view_size.pass.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// size_type find_last_of(const basic_string& str, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.find_last_of(str, pos) == x); - if (x != S::npos) - assert(x <= pos && x < s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.find_last_of(str) == x); - if (x != S::npos) - assert(x < s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, S::npos); - test(S(""), S("laenf"), 0, S::npos); - test(S(""), S("pqlnkmbdjo"), 0, S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), 0, S::npos); - test(S(""), S(""), 1, S::npos); - test(S(""), S("bjaht"), 1, S::npos); - test(S(""), S("hjlcmgpket"), 1, S::npos); - test(S(""), S("htaobedqikfplcgjsmrn"), 1, S::npos); - test(S("fodgq"), S(""), 0, S::npos); - test(S("qanej"), S("dfkap"), 0, S::npos); - test(S("clbao"), S("ihqrfebgad"), 0, S::npos); - test(S("mekdn"), S("ngtjfcalbseiqrphmkdo"), 0, 0); - test(S("srdfq"), S(""), 1, S::npos); - test(S("oemth"), S("ikcrq"), 1, S::npos); - test(S("cdaih"), S("dmajblfhsg"), 1, 1); - test(S("qohtk"), S("oqftjhdmkgsblacenirp"), 1, 1); - test(S("cshmd"), S(""), 2, S::npos); - test(S("lhcdo"), S("oebqi"), 2, S::npos); - test(S("qnsoh"), S("kojhpmbsfe"), 2, 2); - test(S("pkrof"), S("acbsjqogpltdkhinfrem"), 2, 2); - test(S("fmtsp"), S(""), 4, S::npos); - test(S("khbpm"), S("aobjd"), 4, 2); - test(S("pbsji"), S("pcbahntsje"), 4, 3); - test(S("mprdj"), S("fhepcrntkoagbmldqijs"), 4, 4); - test(S("eqmpa"), S(""), 5, S::npos); - test(S("omigs"), S("kocgb"), 5, 3); - test(S("onmje"), S("fbslrjiqkm"), 5, 3); - test(S("oqmrj"), S("jeidpcmalhfnqbgtrsko"), 5, 4); - test(S("schfa"), S(""), 6, S::npos); - test(S("igdsc"), S("qngpd"), 6, 2); - test(S("brqgo"), S("rodhqklgmb"), 6, 4); - test(S("tnrph"), S("thdjgafrlbkoiqcspmne"), 6, 4); - test(S("hcjitbfapl"), S(""), 0, S::npos); - test(S("daiprenocl"), S("ashjd"), 0, 0); - test(S("litpcfdghe"), S("mgojkldsqh"), 0, 0); - test(S("aidjksrolc"), S("imqnaghkfrdtlopbjesc"), 0, 0); - test(S("qpghtfbaji"), S(""), 1, S::npos); - test(S("gfshlcmdjr"), S("nadkh"), 1, S::npos); - test(S("nkodajteqp"), S("ofdrqmkebl"), 1, 1); - test(S("gbmetiprqd"), S("bdfjqgatlksriohemnpc"), 1, 1); - test(S("crnklpmegd"), S(""), 5, S::npos); - test(S("jsbtafedoc"), S("prqgn"), 5, S::npos); - test(S("qnmodrtkeb"), S("pejafmnokr"), 5, 5); - test(S("cpebqsfmnj"), S("odnqkgijrhabfmcestlp"), 5, 5); - test(S("lmofqdhpki"), S(""), 9, S::npos); - test(S("hnefkqimca"), S("rtjpa"), 9, 9); - test(S("drtasbgmfp"), S("ktsrmnqagd"), 9, 7); - test(S("lsaijeqhtr"), S("rtdhgcisbnmoaqkfpjle"), 9, 9); - test(S("elgofjmbrq"), S(""), 10, S::npos); - test(S("mjqdgalkpc"), S("dplqa"), 10, 8); - test(S("kthqnfcerm"), S("dkacjoptns"), 10, 6); - test(S("dfsjhanorc"), S("hqfimtrgnbekpdcsjalo"), 10, 9); - test(S("eqsgalomhb"), S(""), 11, S::npos); - test(S("akiteljmoh"), S("lofbc"), 11, 8); - test(S("hlbdfreqjo"), S("astoegbfpn"), 11, 9); - test(S("taqobhlerg"), S("pdgreqomsncafklhtibj"), 11, 9); - test(S("snafbdlghrjkpqtoceim"), S(""), 0, S::npos); - test(S("aemtbrgcklhndjisfpoq"), S("lbtqd"), 0, S::npos); - test(S("pnracgfkjdiholtbqsem"), S("tboimldpjh"), 0, 0); - test(S("dicfltehbsgrmojnpkaq"), S("slcerthdaiqjfnobgkpm"), 0, 0); - test(S("jlnkraeodhcspfgbqitm"), S(""), 1, S::npos); - test(S("lhosrngtmfjikbqpcade"), S("aqibs"), 1, S::npos); - test(S("rbtaqjhgkneisldpmfoc"), S("gtfblmqinc"), 1, 1); - test(S("gpifsqlrdkbonjtmheca"), S("mkqpbtdalgniorhfescj"), 1, 1); - test(S("hdpkobnsalmcfijregtq"), S(""), 10, S::npos); - test(S("jtlshdgqaiprkbcoenfm"), S("pblas"), 10, 10); - test(S("fkdrbqltsgmcoiphneaj"), S("arosdhcfme"), 10, 10); - test(S("crsplifgtqedjohnabmk"), S("blkhjeogicatqfnpdmsr"), 10, 10); - test(S("niptglfbosehkamrdqcj"), S(""), 19, S::npos); - test(S("copqdhstbingamjfkler"), S("djkqc"), 19, 16); - test(S("mrtaefilpdsgocnhqbjk"), S("lgokshjtpb"), 19, 19); - test(S("kojatdhlcmigpbfrqnes"), S("bqjhtkfepimcnsgrlado"), 19, 19); - test(S("eaintpchlqsbdgrkjofm"), S(""), 20, S::npos); - test(S("gjnhidfsepkrtaqbmclo"), S("nocfa"), 20, 19); - test(S("spocfaktqdbiejlhngmr"), S("bgtajmiedc"), 20, 18); - test(S("rphmlekgfscndtaobiqj"), S("lsckfnqgdahejiopbtmr"), 20, 19); - test(S("liatsqdoegkmfcnbhrpj"), S(""), 21, S::npos); - test(S("binjagtfldkrspcomqeh"), S("gfsrt"), 21, 12); - test(S("latkmisecnorjbfhqpdg"), S("pfsocbhjtm"), 21, 17); - test(S("lecfratdjkhnsmqpoigb"), S("tpflmdnoicjgkberhqsa"), 21, 19); -} - -template <class S> -void test1() -{ - test(S(""), S(""), S::npos); - test(S(""), S("laenf"), S::npos); - test(S(""), S("pqlnkmbdjo"), S::npos); - test(S(""), S("qkamfogpnljdcshbreti"), S::npos); - test(S("nhmko"), S(""), S::npos); - test(S("lahfb"), S("irkhs"), 2); - test(S("gmfhd"), S("kantesmpgj"), 1); - test(S("odaft"), S("oknlrstdpiqmjbaghcfe"), 4); - test(S("eolhfgpjqk"), S(""), S::npos); - test(S("nbatdlmekr"), S("bnrpe"), 9); - test(S("jdmciepkaq"), S("jtdaefblso"), 8); - test(S("hkbgspoflt"), S("oselktgbcapndfjihrmq"), 9); - test(S("gprdcokbnjhlsfmtieqa"), S(""), S::npos); - test(S("qjghlnftcaismkropdeb"), S("bjaht"), 19); - test(S("pnalfrdtkqcmojiesbhg"), S("hjlcmgpket"), 19); - test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 19); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } -} diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp deleted file mode 100644 index bdccb2f22645d..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_pointer_size.pass.cpp +++ /dev/null @@ -1,172 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// constexpr size_type find(const charT* s, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.find(str, pos) == x); - if (x != S::npos) - { - typename S::size_type n = S::traits_type::length(str); - assert(pos <= x && x + n <= s.size()); - } -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.find(str) == x); - if (x != S::npos) - { - typename S::size_type n = S::traits_type::length(str); - assert(0 <= x && x + n <= s.size()); - } -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0); - test(S(""), "abcde", 0, S::npos); - test(S(""), "abcdeabcde", 0, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S(""), "", 1, S::npos); - test(S(""), "abcde", 1, S::npos); - test(S(""), "abcdeabcde", 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcde"), "", 0, 0); - test(S("abcde"), "abcde", 0, 0); - test(S("abcde"), "abcdeabcde", 0, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S("abcde"), "", 1, 1); - test(S("abcde"), "abcde", 1, S::npos); - test(S("abcde"), "abcdeabcde", 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcde"), "", 2, 2); - test(S("abcde"), "abcde", 2, S::npos); - test(S("abcde"), "abcdeabcde", 2, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos); - test(S("abcde"), "", 4, 4); - test(S("abcde"), "abcde", 4, S::npos); - test(S("abcde"), "abcdeabcde", 4, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos); - test(S("abcde"), "", 5, 5); - test(S("abcde"), "abcde", 5, S::npos); - test(S("abcde"), "abcdeabcde", 5, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos); - test(S("abcde"), "", 6, S::npos); - test(S("abcde"), "abcde", 6, S::npos); - test(S("abcde"), "abcdeabcde", 6, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos); - test(S("abcdeabcde"), "", 0, 0); - test(S("abcdeabcde"), "abcde", 0, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S("abcdeabcde"), "", 1, 1); - test(S("abcdeabcde"), "abcde", 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 1, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcdeabcde"), "", 5, 5); - test(S("abcdeabcde"), "abcde", 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos); - test(S("abcdeabcde"), "", 9, 9); - test(S("abcdeabcde"), "abcde", 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 9, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos); - test(S("abcdeabcde"), "", 10, 10); - test(S("abcdeabcde"), "abcde", 10, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos); - test(S("abcdeabcde"), "", 11, S::npos); - test(S("abcdeabcde"), "abcde", 11, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "", 1, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 19, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 20, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), "", 0); - test(S(""), "abcde", S::npos); - test(S(""), "abcdeabcde", S::npos); - test(S(""), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcde"), "", 0); - test(S("abcde"), "abcde", 0); - test(S("abcde"), "abcdeabcde", S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcdeabcde"), "", 0); - test(S("abcdeabcde"), "abcde", 0); - test(S("abcdeabcde"), "abcdeabcde", 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find( "") == 0, "" ); - static_assert (sv1.find( "abcde") == SV::npos, "" ); - static_assert (sv2.find( "") == 0, "" ); - static_assert (sv2.find( "abcde") == 0, "" ); - static_assert (sv2.find( "abcde", 1) == SV::npos, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp deleted file mode 100644 index 856dc4a3a072e..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_pointer_size_size.pass.cpp +++ /dev/null @@ -1,394 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.find(str, pos, n) == x); - if (x != S::npos) - assert(pos <= x && x + n <= s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, 0); - test(S(""), "abcde", 0, 0, 0); - test(S(""), "abcde", 0, 1, S::npos); - test(S(""), "abcde", 0, 2, S::npos); - test(S(""), "abcde", 0, 4, S::npos); - test(S(""), "abcde", 0, 5, S::npos); - test(S(""), "abcdeabcde", 0, 0, 0); - test(S(""), "abcdeabcde", 0, 1, S::npos); - test(S(""), "abcdeabcde", 0, 5, S::npos); - test(S(""), "abcdeabcde", 0, 9, S::npos); - test(S(""), "abcdeabcde", 0, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S(""), "", 1, 0, S::npos); - test(S(""), "abcde", 1, 0, S::npos); - test(S(""), "abcde", 1, 1, S::npos); - test(S(""), "abcde", 1, 2, S::npos); - test(S(""), "abcde", 1, 4, S::npos); - test(S(""), "abcde", 1, 5, S::npos); - test(S(""), "abcdeabcde", 1, 0, S::npos); - test(S(""), "abcdeabcde", 1, 1, S::npos); - test(S(""), "abcdeabcde", 1, 5, S::npos); - test(S(""), "abcdeabcde", 1, 9, S::npos); - test(S(""), "abcdeabcde", 1, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 0, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcde"), "", 0, 0, 0); - test(S("abcde"), "abcde", 0, 0, 0); - test(S("abcde"), "abcde", 0, 1, 0); - test(S("abcde"), "abcde", 0, 2, 0); - test(S("abcde"), "abcde", 0, 4, 0); - test(S("abcde"), "abcde", 0, 5, 0); - test(S("abcde"), "abcdeabcde", 0, 0, 0); - test(S("abcde"), "abcdeabcde", 0, 1, 0); - test(S("abcde"), "abcdeabcde", 0, 5, 0); - test(S("abcde"), "abcdeabcde", 0, 9, S::npos); - test(S("abcde"), "abcdeabcde", 0, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S("abcde"), "", 1, 0, 1); - test(S("abcde"), "abcde", 1, 0, 1); - test(S("abcde"), "abcde", 1, 1, S::npos); - test(S("abcde"), "abcde", 1, 2, S::npos); - test(S("abcde"), "abcde", 1, 4, S::npos); - test(S("abcde"), "abcde", 1, 5, S::npos); - test(S("abcde"), "abcdeabcde", 1, 0, 1); - test(S("abcde"), "abcdeabcde", 1, 1, S::npos); - test(S("abcde"), "abcdeabcde", 1, 5, S::npos); - test(S("abcde"), "abcdeabcde", 1, 9, S::npos); - test(S("abcde"), "abcdeabcde", 1, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcde"), "", 2, 0, 2); - test(S("abcde"), "abcde", 2, 0, 2); - test(S("abcde"), "abcde", 2, 1, S::npos); - test(S("abcde"), "abcde", 2, 2, S::npos); - test(S("abcde"), "abcde", 2, 4, S::npos); - test(S("abcde"), "abcde", 2, 5, S::npos); - test(S("abcde"), "abcdeabcde", 2, 0, 2); - test(S("abcde"), "abcdeabcde", 2, 1, S::npos); - test(S("abcde"), "abcdeabcde", 2, 5, S::npos); - test(S("abcde"), "abcdeabcde", 2, 9, S::npos); - test(S("abcde"), "abcdeabcde", 2, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos); - test(S("abcde"), "", 4, 0, 4); - test(S("abcde"), "abcde", 4, 0, 4); - test(S("abcde"), "abcde", 4, 1, S::npos); - test(S("abcde"), "abcde", 4, 2, S::npos); - test(S("abcde"), "abcde", 4, 4, S::npos); - test(S("abcde"), "abcde", 4, 5, S::npos); - test(S("abcde"), "abcdeabcde", 4, 0, 4); - test(S("abcde"), "abcdeabcde", 4, 1, S::npos); - test(S("abcde"), "abcdeabcde", 4, 5, S::npos); - test(S("abcde"), "abcdeabcde", 4, 9, S::npos); - test(S("abcde"), "abcdeabcde", 4, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos); - test(S("abcde"), "", 5, 0, 5); - test(S("abcde"), "abcde", 5, 0, 5); - test(S("abcde"), "abcde", 5, 1, S::npos); - test(S("abcde"), "abcde", 5, 2, S::npos); -} - -template <class S> -void test1() -{ - test(S("abcde"), "abcde", 5, 4, S::npos); - test(S("abcde"), "abcde", 5, 5, S::npos); - test(S("abcde"), "abcdeabcde", 5, 0, 5); - test(S("abcde"), "abcdeabcde", 5, 1, S::npos); - test(S("abcde"), "abcdeabcde", 5, 5, S::npos); - test(S("abcde"), "abcdeabcde", 5, 9, S::npos); - test(S("abcde"), "abcdeabcde", 5, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos); - test(S("abcde"), "", 6, 0, S::npos); - test(S("abcde"), "abcde", 6, 0, S::npos); - test(S("abcde"), "abcde", 6, 1, S::npos); - test(S("abcde"), "abcde", 6, 2, S::npos); - test(S("abcde"), "abcde", 6, 4, S::npos); - test(S("abcde"), "abcde", 6, 5, S::npos); - test(S("abcde"), "abcdeabcde", 6, 0, S::npos); - test(S("abcde"), "abcdeabcde", 6, 1, S::npos); - test(S("abcde"), "abcdeabcde", 6, 5, S::npos); - test(S("abcde"), "abcdeabcde", 6, 9, S::npos); - test(S("abcde"), "abcdeabcde", 6, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos); - test(S("abcdeabcde"), "", 0, 0, 0); - test(S("abcdeabcde"), "abcde", 0, 0, 0); - test(S("abcdeabcde"), "abcde", 0, 1, 0); - test(S("abcdeabcde"), "abcde", 0, 2, 0); - test(S("abcdeabcde"), "abcde", 0, 4, 0); - test(S("abcdeabcde"), "abcde", 0, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S("abcdeabcde"), "", 1, 0, 1); - test(S("abcdeabcde"), "abcde", 1, 0, 1); - test(S("abcdeabcde"), "abcde", 1, 1, 5); - test(S("abcdeabcde"), "abcde", 1, 2, 5); - test(S("abcdeabcde"), "abcde", 1, 4, 5); - test(S("abcdeabcde"), "abcde", 1, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1); - test(S("abcdeabcde"), "abcdeabcde", 1, 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 1, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 1, 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 1, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcdeabcde"), "", 5, 0, 5); - test(S("abcdeabcde"), "abcde", 5, 0, 5); - test(S("abcdeabcde"), "abcde", 5, 1, 5); - test(S("abcdeabcde"), "abcde", 5, 2, 5); - test(S("abcdeabcde"), "abcde", 5, 4, 5); - test(S("abcdeabcde"), "abcde", 5, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 5, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos); - test(S("abcdeabcde"), "", 9, 0, 9); - test(S("abcdeabcde"), "abcde", 9, 0, 9); - test(S("abcdeabcde"), "abcde", 9, 1, S::npos); - test(S("abcdeabcde"), "abcde", 9, 2, S::npos); - test(S("abcdeabcde"), "abcde", 9, 4, S::npos); - test(S("abcdeabcde"), "abcde", 9, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9); - test(S("abcdeabcde"), "abcdeabcde", 9, 1, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 9, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 9, 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 9, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos); - test(S("abcdeabcde"), "", 10, 0, 10); - test(S("abcdeabcde"), "abcde", 10, 0, 10); - test(S("abcdeabcde"), "abcde", 10, 1, S::npos); - test(S("abcdeabcde"), "abcde", 10, 2, S::npos); - test(S("abcdeabcde"), "abcde", 10, 4, S::npos); - test(S("abcdeabcde"), "abcde", 10, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10); - test(S("abcdeabcde"), "abcdeabcde", 10, 1, S::npos); -} - -template <class S> -void test2() -{ - test(S("abcdeabcde"), "abcdeabcde", 10, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 10, 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 10, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos); - test(S("abcdeabcde"), "", 11, 0, S::npos); - test(S("abcdeabcde"), "abcde", 11, 0, S::npos); - test(S("abcdeabcde"), "abcde", 11, 1, S::npos); - test(S("abcdeabcde"), "abcde", 11, 2, S::npos); - test(S("abcdeabcde"), "abcde", 11, 4, S::npos); - test(S("abcdeabcde"), "abcde", 11, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, 0, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, 1, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, 5, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, 9, S::npos); - test(S("abcdeabcde"), "abcdeabcde", 11, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 5); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 5); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 5); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 5); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20); -} - -template <class S> -void test3() -{ - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 21, 0, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, S::npos); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find( "", 0, 0 ) == 0, "" ); - static_assert (sv1.find( "abcde", 0, 0 ) == 0, "" ); - static_assert (sv1.find( "abcde", 0, 1 ) == SV::npos, "" ); - static_assert (sv2.find( "", 0, 0 ) == 0, "" ); - static_assert (sv2.find( "abcde", 0, 0 ) == 0, "" ); - static_assert (sv2.find( "abcde", 0, 1 ) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp deleted file mode 100644 index f25efdd020725..0000000000000 --- a/test/std/experimental/string.view/string.view.find/find_string_view_size.pass.cpp +++ /dev/null @@ -1,165 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type find(const basic_string_view& str, size_type pos = 0) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.find(str, pos) == x); - if (x != S::npos) - assert(pos <= x && x + str.size() <= s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.find(str) == x); - if (x != S::npos) - assert(0 <= x && x + str.size() <= s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, 0); - test(S(""), S("abcde"), 0, S::npos); - test(S(""), S("abcdeabcde"), 0, S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S(""), S(""), 1, S::npos); - test(S(""), S("abcde"), 1, S::npos); - test(S(""), S("abcdeabcde"), 1, S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcde"), S(""), 0, 0); - test(S("abcde"), S("abcde"), 0, 0); - test(S("abcde"), S("abcdeabcde"), 0, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S("abcde"), S(""), 1, 1); - test(S("abcde"), S("abcde"), 1, S::npos); - test(S("abcde"), S("abcdeabcde"), 1, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcde"), S(""), 2, 2); - test(S("abcde"), S("abcde"), 2, S::npos); - test(S("abcde"), S("abcdeabcde"), 2, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos); - test(S("abcde"), S(""), 4, 4); - test(S("abcde"), S("abcde"), 4, S::npos); - test(S("abcde"), S("abcdeabcde"), 4, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos); - test(S("abcde"), S(""), 5, 5); - test(S("abcde"), S("abcde"), 5, S::npos); - test(S("abcde"), S("abcdeabcde"), 5, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos); - test(S("abcde"), S(""), 6, S::npos); - test(S("abcde"), S("abcde"), 6, S::npos); - test(S("abcde"), S("abcdeabcde"), 6, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos); - test(S("abcdeabcde"), S(""), 0, 0); - test(S("abcdeabcde"), S("abcde"), 0, 0); - test(S("abcdeabcde"), S("abcdeabcde"), 0, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S("abcdeabcde"), S(""), 1, 1); - test(S("abcdeabcde"), S("abcde"), 1, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 1, S::npos); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcdeabcde"), S(""), 5, 5); - test(S("abcdeabcde"), S("abcde"), 5, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 5, S::npos); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos); - test(S("abcdeabcde"), S(""), 9, 9); - test(S("abcdeabcde"), S("abcde"), 9, S::npos); - test(S("abcdeabcde"), S("abcdeabcde"), 9, S::npos); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos); - test(S("abcdeabcde"), S(""), 10, 10); - test(S("abcdeabcde"), S("abcde"), 10, S::npos); - test(S("abcdeabcde"), S("abcdeabcde"), 10, S::npos); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos); - test(S("abcdeabcde"), S(""), 11, S::npos); - test(S("abcdeabcde"), S("abcde"), 11, S::npos); - test(S("abcdeabcde"), S("abcdeabcde"), 11, S::npos); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 5); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 5); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, S::npos); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, S::npos); -} - -template <class S> -void test1() -{ - test(S(""), S(""), 0); - test(S(""), S("abcde"), S::npos); - test(S(""), S("abcdeabcde"), S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcde"), S(""), 0); - test(S("abcde"), S("abcde"), 0); - test(S("abcde"), S("abcdeabcde"), S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcdeabcde"), S(""), 0); - test(S("abcdeabcde"), S("abcde"), 0); - test(S("abcdeabcde"), S("abcdeabcde"), 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 0); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.find(sv1) == 0, "" ); - static_assert (sv1.find(sv2) == SV::npos, "" ); - static_assert (sv2.find(sv1) == 0, "" ); - static_assert (sv2.find(sv2) == 0, "" ); - static_assert (sv2.find(sv2, 1 ) == SV::npos, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp deleted file mode 100644 index f07071101c772..0000000000000 --- a/test/std/experimental/string.view/string.view.find/rfind_char_size.pass.cpp +++ /dev/null @@ -1,84 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> -// constexpr size_type rfind(charT c, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.rfind(c, pos) == x); - if (x != S::npos) - assert(x <= pos && x + 1 <= s.size()); -} - -template <class S> -void -test(const S& s, typename S::value_type c, typename S::size_type x) -{ - assert(s.rfind(c) == x); - if (x != S::npos) - assert(x + 1 <= s.size()); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test(S(""), 'b', 0, S::npos); - test(S(""), 'b', 1, S::npos); - test(S("abcde"), 'b', 0, S::npos); - test(S("abcde"), 'b', 1, 1); - test(S("abcde"), 'b', 2, 1); - test(S("abcde"), 'b', 4, 1); - test(S("abcde"), 'b', 5, 1); - test(S("abcde"), 'b', 6, 1); - test(S("abcdeabcde"), 'b', 0, S::npos); - test(S("abcdeabcde"), 'b', 1, 1); - test(S("abcdeabcde"), 'b', 5, 1); - test(S("abcdeabcde"), 'b', 9, 6); - test(S("abcdeabcde"), 'b', 10, 6); - test(S("abcdeabcde"), 'b', 11, 6); - test(S("abcdeabcdeabcdeabcde"), 'b', 0, S::npos); - test(S("abcdeabcdeabcdeabcde"), 'b', 1, 1); - test(S("abcdeabcdeabcdeabcde"), 'b', 10, 6); - test(S("abcdeabcdeabcdeabcde"), 'b', 19, 16); - test(S("abcdeabcdeabcdeabcde"), 'b', 20, 16); - test(S("abcdeabcdeabcdeabcde"), 'b', 21, 16); - - test(S(""), 'b', S::npos); - test(S("abcde"), 'b', 1); - test(S("abcdeabcde"), 'b', 6); - test(S("abcdeabcdeabcdeabcde"), 'b', 16); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.rfind( 'b', 0 ) == SV::npos, "" ); - static_assert (sv1.rfind( 'b', 1 ) == SV::npos, "" ); - static_assert (sv2.rfind( 'b', 0 ) == SV::npos, "" ); - static_assert (sv2.rfind( 'b', 1 ) == 1, "" ); - static_assert (sv2.rfind( 'b', 2 ) == 1, "" ); - static_assert (sv2.rfind( 'b', 3 ) == 1, "" ); - static_assert (sv2.rfind( 'b', 4 ) == 1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp deleted file mode 100644 index 7a8795be08164..0000000000000 --- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size.pass.cpp +++ /dev/null @@ -1,172 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> -// constexpr size_type rfind(const charT* s, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type x) -{ - assert(s.rfind(str, pos) == x); - if (x != S::npos) - { - typename S::size_type n = S::traits_type::length(str); - assert(x <= pos && x + n <= s.size()); - } -} - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type x) -{ - assert(s.rfind(str) == x); - if (x != S::npos) - { - typename S::size_type pos = s.size(); - typename S::size_type n = S::traits_type::length(str); - assert(x <= pos && x + n <= s.size()); - } -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0); - test(S(""), "abcde", 0, S::npos); - test(S(""), "abcdeabcde", 0, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S(""), "", 1, 0); - test(S(""), "abcde", 1, S::npos); - test(S(""), "abcdeabcde", 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcde"), "", 0, 0); - test(S("abcde"), "abcde", 0, 0); - test(S("abcde"), "abcdeabcde", 0, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S("abcde"), "", 1, 1); - test(S("abcde"), "abcde", 1, 0); - test(S("abcde"), "abcdeabcde", 1, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcde"), "", 2, 2); - test(S("abcde"), "abcde", 2, 0); - test(S("abcde"), "abcdeabcde", 2, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, S::npos); - test(S("abcde"), "", 4, 4); - test(S("abcde"), "abcde", 4, 0); - test(S("abcde"), "abcdeabcde", 4, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, S::npos); - test(S("abcde"), "", 5, 5); - test(S("abcde"), "abcde", 5, 0); - test(S("abcde"), "abcdeabcde", 5, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, S::npos); - test(S("abcde"), "", 6, 5); - test(S("abcde"), "abcde", 6, 0); - test(S("abcde"), "abcdeabcde", 6, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, S::npos); - test(S("abcdeabcde"), "", 0, 0); - test(S("abcdeabcde"), "abcde", 0, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, S::npos); - test(S("abcdeabcde"), "", 1, 1); - test(S("abcdeabcde"), "abcde", 1, 0); - test(S("abcdeabcde"), "abcdeabcde", 1, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, S::npos); - test(S("abcdeabcde"), "", 5, 5); - test(S("abcdeabcde"), "abcde", 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, S::npos); - test(S("abcdeabcde"), "", 9, 9); - test(S("abcdeabcde"), "abcde", 9, 5); - test(S("abcdeabcde"), "abcdeabcde", 9, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, S::npos); - test(S("abcdeabcde"), "", 10, 10); - test(S("abcdeabcde"), "abcde", 10, 5); - test(S("abcdeabcde"), "abcdeabcde", 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, S::npos); - test(S("abcdeabcde"), "", 11, 10); - test(S("abcdeabcde"), "abcde", 11, 5); - test(S("abcdeabcde"), "abcdeabcde", 11, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0); - test(S("abcdeabcdeabcdeabcde"), "", 1, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0); - test(S("abcdeabcdeabcdeabcde"), "", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0); - test(S("abcdeabcdeabcdeabcde"), "", 19, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0); - test(S("abcdeabcdeabcdeabcde"), "", 20, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 21, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0); -} - -template <class S> -void test1() -{ - test(S(""), "", 0); - test(S(""), "abcde", S::npos); - test(S(""), "abcdeabcde", S::npos); - test(S(""), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcde"), "", 5); - test(S("abcde"), "abcde", 0); - test(S("abcde"), "abcdeabcde", S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcdeabcde"), "", 10); - test(S("abcdeabcde"), "abcde", 5); - test(S("abcdeabcde"), "abcdeabcde", 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.rfind( "") == 0, "" ); - static_assert (sv1.rfind( "abcde") == SV::npos, "" ); - static_assert (sv2.rfind( "") == 5, "" ); - static_assert (sv2.rfind( "abcde") == 0, "" ); - static_assert (sv2.rfind( "abcde", 1) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp deleted file mode 100644 index 2755d2c567b61..0000000000000 --- a/test/std/experimental/string.view/string.view.find/rfind_pointer_size_size.pass.cpp +++ /dev/null @@ -1,393 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> -// constexpr size_type rfind(const charT* s, size_type pos, size_type n) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const typename S::value_type* str, typename S::size_type pos, - typename S::size_type n, typename S::size_type x) -{ - assert(s.rfind(str, pos, n) == x); - if (x != S::npos) - assert(x <= pos && x + n <= s.size()); -} - -template <class S> -void test0() -{ - test(S(""), "", 0, 0, 0); - test(S(""), "abcde", 0, 0, 0); - test(S(""), "abcde", 0, 1, S::npos); - test(S(""), "abcde", 0, 2, S::npos); - test(S(""), "abcde", 0, 4, S::npos); - test(S(""), "abcde", 0, 5, S::npos); - test(S(""), "abcdeabcde", 0, 0, 0); - test(S(""), "abcdeabcde", 0, 1, S::npos); - test(S(""), "abcdeabcde", 0, 5, S::npos); - test(S(""), "abcdeabcde", 0, 9, S::npos); - test(S(""), "abcdeabcde", 0, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S(""), "abcdeabcdeabcdeabcde", 0, 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S(""), "", 1, 0, 0); - test(S(""), "abcde", 1, 0, 0); - test(S(""), "abcde", 1, 1, S::npos); - test(S(""), "abcde", 1, 2, S::npos); - test(S(""), "abcde", 1, 4, S::npos); - test(S(""), "abcde", 1, 5, S::npos); - test(S(""), "abcdeabcde", 1, 0, 0); - test(S(""), "abcdeabcde", 1, 1, S::npos); - test(S(""), "abcdeabcde", 1, 5, S::npos); - test(S(""), "abcdeabcde", 1, 9, S::npos); - test(S(""), "abcdeabcde", 1, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 0, 0); - test(S(""), "abcdeabcdeabcdeabcde", 1, 1, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 10, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S(""), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcde"), "", 0, 0, 0); - test(S("abcde"), "abcde", 0, 0, 0); - test(S("abcde"), "abcde", 0, 1, 0); - test(S("abcde"), "abcde", 0, 2, 0); - test(S("abcde"), "abcde", 0, 4, 0); - test(S("abcde"), "abcde", 0, 5, 0); - test(S("abcde"), "abcdeabcde", 0, 0, 0); - test(S("abcde"), "abcdeabcde", 0, 1, 0); - test(S("abcde"), "abcdeabcde", 0, 5, 0); - test(S("abcde"), "abcdeabcde", 0, 9, S::npos); - test(S("abcde"), "abcdeabcde", 0, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S("abcde"), "", 1, 0, 1); - test(S("abcde"), "abcde", 1, 0, 1); - test(S("abcde"), "abcde", 1, 1, 0); - test(S("abcde"), "abcde", 1, 2, 0); - test(S("abcde"), "abcde", 1, 4, 0); - test(S("abcde"), "abcde", 1, 5, 0); - test(S("abcde"), "abcdeabcde", 1, 0, 1); - test(S("abcde"), "abcdeabcde", 1, 1, 0); - test(S("abcde"), "abcdeabcde", 1, 5, 0); - test(S("abcde"), "abcdeabcde", 1, 9, S::npos); - test(S("abcde"), "abcdeabcde", 1, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcde"), "", 2, 0, 2); - test(S("abcde"), "abcde", 2, 0, 2); - test(S("abcde"), "abcde", 2, 1, 0); - test(S("abcde"), "abcde", 2, 2, 0); - test(S("abcde"), "abcde", 2, 4, 0); - test(S("abcde"), "abcde", 2, 5, 0); - test(S("abcde"), "abcdeabcde", 2, 0, 2); - test(S("abcde"), "abcdeabcde", 2, 1, 0); - test(S("abcde"), "abcdeabcde", 2, 5, 0); - test(S("abcde"), "abcdeabcde", 2, 9, S::npos); - test(S("abcde"), "abcdeabcde", 2, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 0, 2); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 2, 20, S::npos); - test(S("abcde"), "", 4, 0, 4); - test(S("abcde"), "abcde", 4, 0, 4); - test(S("abcde"), "abcde", 4, 1, 0); - test(S("abcde"), "abcde", 4, 2, 0); - test(S("abcde"), "abcde", 4, 4, 0); - test(S("abcde"), "abcde", 4, 5, 0); - test(S("abcde"), "abcdeabcde", 4, 0, 4); - test(S("abcde"), "abcdeabcde", 4, 1, 0); - test(S("abcde"), "abcdeabcde", 4, 5, 0); - test(S("abcde"), "abcdeabcde", 4, 9, S::npos); - test(S("abcde"), "abcdeabcde", 4, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 0, 4); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 4, 20, S::npos); - test(S("abcde"), "", 5, 0, 5); - test(S("abcde"), "abcde", 5, 0, 5); - test(S("abcde"), "abcde", 5, 1, 0); - test(S("abcde"), "abcde", 5, 2, 0); -} - -template <class S> -void test1() -{ - test(S("abcde"), "abcde", 5, 4, 0); - test(S("abcde"), "abcde", 5, 5, 0); - test(S("abcde"), "abcdeabcde", 5, 0, 5); - test(S("abcde"), "abcdeabcde", 5, 1, 0); - test(S("abcde"), "abcdeabcde", 5, 5, 0); - test(S("abcde"), "abcdeabcde", 5, 9, S::npos); - test(S("abcde"), "abcdeabcde", 5, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 0, 5); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos); - test(S("abcde"), "", 6, 0, 5); - test(S("abcde"), "abcde", 6, 0, 5); - test(S("abcde"), "abcde", 6, 1, 0); - test(S("abcde"), "abcde", 6, 2, 0); - test(S("abcde"), "abcde", 6, 4, 0); - test(S("abcde"), "abcde", 6, 5, 0); - test(S("abcde"), "abcdeabcde", 6, 0, 5); - test(S("abcde"), "abcdeabcde", 6, 1, 0); - test(S("abcde"), "abcdeabcde", 6, 5, 0); - test(S("abcde"), "abcdeabcde", 6, 9, S::npos); - test(S("abcde"), "abcdeabcde", 6, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 0, 5); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 1, 0); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 10, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 19, S::npos); - test(S("abcde"), "abcdeabcdeabcdeabcde", 6, 20, S::npos); - test(S("abcdeabcde"), "", 0, 0, 0); - test(S("abcdeabcde"), "abcde", 0, 0, 0); - test(S("abcdeabcde"), "abcde", 0, 1, 0); - test(S("abcdeabcde"), "abcde", 0, 2, 0); - test(S("abcdeabcde"), "abcde", 0, 4, 0); - test(S("abcdeabcde"), "abcde", 0, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 0, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 1, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 0, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, S::npos); - test(S("abcdeabcde"), "", 1, 0, 1); - test(S("abcdeabcde"), "abcde", 1, 0, 1); - test(S("abcdeabcde"), "abcde", 1, 1, 0); - test(S("abcdeabcde"), "abcde", 1, 2, 0); - test(S("abcdeabcde"), "abcde", 1, 4, 0); - test(S("abcdeabcde"), "abcde", 1, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 1, 0, 1); - test(S("abcdeabcde"), "abcdeabcde", 1, 1, 0); - test(S("abcdeabcde"), "abcdeabcde", 1, 5, 0); - test(S("abcdeabcde"), "abcdeabcde", 1, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 1, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, S::npos); - test(S("abcdeabcde"), "", 5, 0, 5); - test(S("abcdeabcde"), "abcde", 5, 0, 5); - test(S("abcdeabcde"), "abcde", 5, 1, 5); - test(S("abcdeabcde"), "abcde", 5, 2, 5); - test(S("abcdeabcde"), "abcde", 5, 4, 5); - test(S("abcdeabcde"), "abcde", 5, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 0, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 5, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 5, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 0, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 5, 20, S::npos); - test(S("abcdeabcde"), "", 9, 0, 9); - test(S("abcdeabcde"), "abcde", 9, 0, 9); - test(S("abcdeabcde"), "abcde", 9, 1, 5); - test(S("abcdeabcde"), "abcde", 9, 2, 5); - test(S("abcdeabcde"), "abcde", 9, 4, 5); - test(S("abcdeabcde"), "abcde", 9, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 9, 0, 9); - test(S("abcdeabcde"), "abcdeabcde", 9, 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 9, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 9, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 9, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 0, 9); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 9, 20, S::npos); - test(S("abcdeabcde"), "", 10, 0, 10); - test(S("abcdeabcde"), "abcde", 10, 0, 10); - test(S("abcdeabcde"), "abcde", 10, 1, 5); - test(S("abcdeabcde"), "abcde", 10, 2, 5); - test(S("abcdeabcde"), "abcde", 10, 4, 5); - test(S("abcdeabcde"), "abcde", 10, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 10, 0, 10); - test(S("abcdeabcde"), "abcdeabcde", 10, 1, 5); -} - -template <class S> -void test2() -{ - test(S("abcdeabcde"), "abcdeabcde", 10, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 10, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 10, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, S::npos); - test(S("abcdeabcde"), "", 11, 0, 10); - test(S("abcdeabcde"), "abcde", 11, 0, 10); - test(S("abcdeabcde"), "abcde", 11, 1, 5); - test(S("abcdeabcde"), "abcde", 11, 2, 5); - test(S("abcdeabcde"), "abcde", 11, 4, 5); - test(S("abcdeabcde"), "abcde", 11, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 11, 0, 10); - test(S("abcdeabcde"), "abcdeabcde", 11, 1, 5); - test(S("abcdeabcde"), "abcdeabcde", 11, 5, 5); - test(S("abcdeabcde"), "abcdeabcde", 11, 9, 0); - test(S("abcdeabcde"), "abcdeabcde", 11, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 0, 10); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 1, 5); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 10, 0); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 19, S::npos); - test(S("abcdeabcde"), "abcdeabcdeabcdeabcde", 11, 20, S::npos); - test(S("abcdeabcdeabcdeabcde"), "", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 2, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 4, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 0, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 9, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 0, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 0, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 2, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 4, 0); - test(S("abcdeabcdeabcdeabcde"), "abcde", 1, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 5, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 9, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 1, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 0, 1); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 1, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 10, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 1, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 2, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 4, 10); - test(S("abcdeabcdeabcdeabcde"), "abcde", 10, 5, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 5, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 9, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 10, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 0, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 1, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 10, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 2, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 4, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 19, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 9, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 19, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 0, 19); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 19, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 2, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 4, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 20, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 9, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 20, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 0, 20); -} - -template <class S> -void test3() -{ - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 20, 20, 0); - test(S("abcdeabcdeabcdeabcde"), "", 21, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 2, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 4, 15); - test(S("abcdeabcdeabcdeabcde"), "abcde", 21, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 5, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 9, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcde", 21, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 0, 20); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 1, 15); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 10, 10); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 19, 0); - test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 21, 20, 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - test2<S>(); - test3<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.rfind( "", 0, 0 ) == 0, "" ); - static_assert (sv1.rfind( "abcde", 0, 0 ) == 0, "" ); - static_assert (sv1.rfind( "abcde", 0, 1 ) == SV::npos, "" ); - static_assert (sv2.rfind( "", 0, 0 ) == 0, "" ); - static_assert (sv2.rfind( "abcde", 0, 0 ) == 0, "" ); - static_assert (sv2.rfind( "abcde", 0, 1 ) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp b/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp deleted file mode 100644 index e77d668d79ba3..0000000000000 --- a/test/std/experimental/string.view/string.view.find/rfind_string_view_size.pass.cpp +++ /dev/null @@ -1,165 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr size_type rfind(const basic_string& str, size_type pos = npos) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -template <class S> -void -test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) -{ - assert(s.rfind(str, pos) == x); - if (x != S::npos) - assert(x <= pos && x + str.size() <= s.size()); -} - -template <class S> -void -test(const S& s, const S& str, typename S::size_type x) -{ - assert(s.rfind(str) == x); - if (x != S::npos) - assert(0 <= x && x + str.size() <= s.size()); -} - -template <class S> -void test0() -{ - test(S(""), S(""), 0, 0); - test(S(""), S("abcde"), 0, S::npos); - test(S(""), S("abcdeabcde"), 0, S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S(""), S(""), 1, 0); - test(S(""), S("abcde"), 1, S::npos); - test(S(""), S("abcdeabcde"), 1, S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcde"), S(""), 0, 0); - test(S("abcde"), S("abcde"), 0, 0); - test(S("abcde"), S("abcdeabcde"), 0, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S("abcde"), S(""), 1, 1); - test(S("abcde"), S("abcde"), 1, 0); - test(S("abcde"), S("abcdeabcde"), 1, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcde"), S(""), 2, 2); - test(S("abcde"), S("abcde"), 2, 0); - test(S("abcde"), S("abcdeabcde"), 2, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 2, S::npos); - test(S("abcde"), S(""), 4, 4); - test(S("abcde"), S("abcde"), 4, 0); - test(S("abcde"), S("abcdeabcde"), 4, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 4, S::npos); - test(S("abcde"), S(""), 5, 5); - test(S("abcde"), S("abcde"), 5, 0); - test(S("abcde"), S("abcdeabcde"), 5, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos); - test(S("abcde"), S(""), 6, 5); - test(S("abcde"), S("abcde"), 6, 0); - test(S("abcde"), S("abcdeabcde"), 6, S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), 6, S::npos); - test(S("abcdeabcde"), S(""), 0, 0); - test(S("abcdeabcde"), S("abcde"), 0, 0); - test(S("abcdeabcde"), S("abcdeabcde"), 0, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, S::npos); - test(S("abcdeabcde"), S(""), 1, 1); - test(S("abcdeabcde"), S("abcde"), 1, 0); - test(S("abcdeabcde"), S("abcdeabcde"), 1, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, S::npos); - test(S("abcdeabcde"), S(""), 5, 5); - test(S("abcdeabcde"), S("abcde"), 5, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 5, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 5, S::npos); - test(S("abcdeabcde"), S(""), 9, 9); - test(S("abcdeabcde"), S("abcde"), 9, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 9, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 9, S::npos); - test(S("abcdeabcde"), S(""), 10, 10); - test(S("abcdeabcde"), S("abcde"), 10, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 10, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, S::npos); - test(S("abcdeabcde"), S(""), 11, 10); - test(S("abcdeabcde"), S("abcde"), 11, 5); - test(S("abcdeabcde"), S("abcdeabcde"), 11, 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), 11, S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 1, 1); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 1, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 1, 0); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 1, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 10, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 19, 19); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 19, 15); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 19, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 19, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 20, 20); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 20, 15); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 20, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 20, 0); - test(S("abcdeabcdeabcdeabcde"), S(""), 21, 20); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 21, 15); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 21, 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 21, 0); -} - -template <class S> -void test1() -{ - test(S(""), S(""), 0); - test(S(""), S("abcde"), S::npos); - test(S(""), S("abcdeabcde"), S::npos); - test(S(""), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcde"), S(""), 5); - test(S("abcde"), S("abcde"), 0); - test(S("abcde"), S("abcdeabcde"), S::npos); - test(S("abcde"), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcdeabcde"), S(""), 10); - test(S("abcdeabcde"), S("abcde"), 5); - test(S("abcdeabcde"), S("abcdeabcde"), 0); - test(S("abcdeabcde"), S("abcdeabcdeabcdeabcde"), S::npos); - test(S("abcdeabcdeabcdeabcde"), S(""), 20); - test(S("abcdeabcdeabcdeabcde"), S("abcde"), 15); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcde"), 10); - test(S("abcdeabcdeabcdeabcde"), S("abcdeabcdeabcdeabcde"), 0); -} - -int main() -{ - { - typedef std::experimental::string_view S; - test0<S>(); - test1<S>(); - } - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - - static_assert (sv1.rfind(sv1) == 0, "" ); - static_assert (sv1.rfind(sv2) == SV::npos, "" ); - static_assert (sv2.rfind(sv1) == 5, "" ); - static_assert (sv2.rfind(sv2) == 0, "" ); - static_assert (sv2.rfind(sv2, 1) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp b/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp deleted file mode 100644 index 6b16971bfeb2b..0000000000000 --- a/test/std/experimental/string.view/string.view.hash/string_view.pass.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <functional> - -// template <class T> -// struct hash -// : public unary_function<T, size_t> -// { -// size_t operator()(T val) const; -// }; - -// Not very portable - -#include <experimental/string_view> -#include <cassert> -#include <type_traits> - -using std::experimental::string_view; - -template <class T> -void -test() -{ - typedef std::hash<T> H; - static_assert((std::is_same<typename H::argument_type, T>::value), "" ); - static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" ); - H h; -// std::string g1 = "1234567890"; -// std::string g2 = "1234567891"; - typedef typename T::value_type char_type; - char_type g1 [ 10 ]; - char_type g2 [ 10 ]; - for ( int i = 0; i < 10; ++i ) - g1[i] = g2[9-i] = '0' + i; - T s1(g1, 10); - T s2(g2, 10); - assert(h(s1) != h(s2)); -} - -int main() -{ - test<std::experimental::string_view>(); -#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - test<std::experimental::u16string_view>(); - test<std::experimental::u32string_view>(); -#endif // _LIBCPP_HAS_NO_UNICODE_CHARS - test<std::experimental::wstring_view>(); -} diff --git a/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp b/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp deleted file mode 100644 index 4f3f962a3111a..0000000000000 --- a/test/std/experimental/string.view/string.view.io/stream_insert.pass.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_ostream<charT, traits>& -// operator<<(basic_ostream<charT, traits>& os, -// const basic_string_view<charT,traits> str); - -#include <experimental/string_view> -#include <sstream> -#include <cassert> - -using std::experimental::string_view; -using std::experimental::wstring_view; - -int main() -{ - { - std::ostringstream out; - string_view sv("some text"); - out << sv; - assert(out.good()); - assert(sv == out.str()); - } - { - std::ostringstream out; - std::string s("some text"); - string_view sv(s); - out.width(12); - out << sv; - assert(out.good()); - assert(" " + s == out.str()); - } - { - std::wostringstream out; - wstring_view sv(L"some text"); - out << sv; - assert(out.good()); - assert(sv == out.str()); - } - { - std::wostringstream out; - std::wstring s(L"some text"); - wstring_view sv(s); - out.width(12); - out << sv; - assert(out.good()); - assert(L" " + s == out.str()); - } -} diff --git a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp b/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp deleted file mode 100644 index 5f28f63f82757..0000000000000 --- a/test/std/experimental/string.view/string.view.iterators/begin.pass.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr const_iterator begin() const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <class S> -void -test(S s) -{ - const S& cs = s; - typename S::iterator b = s.begin(); - typename S::const_iterator cb1 = cs.begin(); - typename S::const_iterator cb2 = s.cbegin(); - if (!s.empty()) - { - assert( *b == s[0]); - assert( &*b == &s[0]); - assert( *cb1 == s[0]); - assert(&*cb1 == &s[0]); - assert( *cb2 == s[0]); - assert(&*cb2 == &s[0]); - - } - assert( b == cb1); - assert( b == cb2); - assert(cb1 == cb2); -} - - -int main() -{ - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test(string_view ()); - test(u16string_view()); - test(u32string_view()); - test(wstring_view ()); - test(string_view ( "123")); - test(wstring_view (L"123")); -#if TEST_STD_VER >= 11 - test(u16string_view{u"123"}); - test(u32string_view{U"123"}); -#endif - -#if TEST_STD_VER > 11 - { - constexpr string_view sv { "123", 3 }; - constexpr u16string_view u16sv {u"123", 3 }; - constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; - - static_assert ( *sv.begin() == sv[0], "" ); - static_assert ( *u16sv.begin() == u16sv[0], "" ); - static_assert ( *u32sv.begin() == u32sv[0], "" ); - static_assert ( *wsv.begin() == wsv[0], "" ); - - static_assert ( *sv.cbegin() == sv[0], "" ); - static_assert ( *u16sv.cbegin() == u16sv[0], "" ); - static_assert ( *u32sv.cbegin() == u32sv[0], "" ); - static_assert ( *wsv.cbegin() == wsv[0], "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp b/test/std/experimental/string.view/string.view.iterators/end.pass.cpp deleted file mode 100644 index 1f22b3fbe4ba1..0000000000000 --- a/test/std/experimental/string.view/string.view.iterators/end.pass.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr const_iterator end() const; - -#include <experimental/string_view> -#include <cstddef> -#include <cassert> - -#include "test_macros.h" - -template <class S> -void -test(S s) -{ - const S& cs = s; - typename S::iterator e = s.end(); - typename S::const_iterator ce1 = cs.end(); - typename S::const_iterator ce2 = s.cend(); - - if (s.empty()) - { - assert( e == s.begin()); - assert(ce1 == cs.begin()); - assert(ce2 == s.begin()); - } - else - { - assert( e != s.begin()); - assert(ce1 != cs.begin()); - assert(ce2 != s.begin()); - } - - assert( e - s.begin() == static_cast<std::ptrdiff_t>(s.size())); - assert(ce1 - cs.begin() == static_cast<std::ptrdiff_t>(cs.size())); - assert(ce2 - s.cbegin() == static_cast<std::ptrdiff_t>(s.size())); - - assert( e == ce1); - assert( e == ce2); - assert(ce1 == ce2); -} - - -int main() -{ - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test(string_view ()); - test(u16string_view()); - test(u32string_view()); - test(wstring_view ()); - test(string_view ( "123")); - test(wstring_view (L"123")); -#if TEST_STD_VER >= 11 - test(u16string_view{u"123"}); - test(u32string_view{U"123"}); -#endif - -#if TEST_STD_VER > 11 - { - constexpr string_view sv { "123", 3 }; - constexpr u16string_view u16sv {u"123", 3 }; - constexpr u32string_view u32sv {U"123", 3 }; - constexpr wstring_view wsv {L"123", 3 }; - - static_assert ( sv.begin() != sv.end(), "" ); - static_assert ( u16sv.begin() != u16sv.end(), "" ); - static_assert ( u32sv.begin() != u32sv.end(), "" ); - static_assert ( wsv.begin() != wsv.end(), "" ); - - static_assert ( sv.begin() != sv.cend(), "" ); - static_assert ( u16sv.begin() != u16sv.cend(), "" ); - static_assert ( u32sv.begin() != u32sv.cend(), "" ); - static_assert ( wsv.begin() != wsv.cend(), "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp b/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp deleted file mode 100644 index 068557e398635..0000000000000 --- a/test/std/experimental/string.view/string.view.iterators/rbegin.pass.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// const_iterator rbegin() const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template <class S> -void -test(S s) -{ - const S& cs = s; - typename S::reverse_iterator b = s.rbegin(); - typename S::const_reverse_iterator cb1 = cs.rbegin(); - typename S::const_reverse_iterator cb2 = s.crbegin(); - if (!s.empty()) - { - const size_t last = s.size() - 1; - assert( *b == s[last]); - assert( &*b == &s[last]); - assert( *cb1 == s[last]); - assert(&*cb1 == &s[last]); - assert( *cb2 == s[last]); - assert(&*cb2 == &s[last]); - - } - assert( b == cb1); - assert( b == cb2); - assert(cb1 == cb2); -} - - -int main() -{ - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test(string_view ()); - test(u16string_view()); - test(u32string_view()); - test(wstring_view ()); - test(string_view ( "123")); - test(wstring_view (L"123")); -#if TEST_STD_VER >= 11 - test(u16string_view{u"123"}); - test(u32string_view{U"123"}); -#endif -} diff --git a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp b/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp deleted file mode 100644 index bd24c327e0905..0000000000000 --- a/test/std/experimental/string.view/string.view.iterators/rend.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr const_iterator rend() const; - -#include <experimental/string_view> -#include <cstddef> -#include <cassert> - -#include "test_macros.h" - -template <class S> -void -test(S s) -{ - const S& cs = s; - typename S::reverse_iterator e = s.rend(); - typename S::const_reverse_iterator ce1 = cs.rend(); - typename S::const_reverse_iterator ce2 = s.crend(); - - if (s.empty()) - { - assert( e == s.rbegin()); - assert(ce1 == cs.rbegin()); - assert(ce2 == s.rbegin()); - } - else - { - assert( e != s.rbegin()); - assert(ce1 != cs.rbegin()); - assert(ce2 != s.rbegin()); - } - - assert( e - s.rbegin() == static_cast<std::ptrdiff_t>(s.size())); - assert(ce1 - cs.rbegin() == static_cast<std::ptrdiff_t>(cs.size())); - assert(ce2 - s.crbegin() == static_cast<std::ptrdiff_t>(s.size())); - - assert( e == ce1); - assert( e == ce2); - assert(ce1 == ce2); -} - - -int main() -{ - typedef std::experimental::string_view string_view; - typedef std::experimental::u16string_view u16string_view; - typedef std::experimental::u32string_view u32string_view; - typedef std::experimental::wstring_view wstring_view; - - test(string_view ()); - test(u16string_view()); - test(u32string_view()); - test(wstring_view ()); - test(string_view ( "123")); - test(wstring_view (L"123")); -#if TEST_STD_VER >= 11 - test(u16string_view{u"123"}); - test(u32string_view{U"123"}); -#endif -} diff --git a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp deleted file mode 100644 index 00b0661d85f56..0000000000000 --- a/test/std/experimental/string.view/string.view.modifiers/clear.pass.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// void clear() noexcept - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s, size_t len ) { - typedef std::experimental::basic_string_view<CharT> SV; - { - SV sv1 ( s ); - assert ( sv1.size() == len ); - assert ( sv1.data() == s ); - - sv1.clear (); - assert ( sv1.data() == nullptr ); - assert ( sv1.size() == 0 ); - assert ( sv1 == SV()); - } -} - -#if TEST_STD_VER > 11 -constexpr size_t test_ce ( size_t n ) { - typedef std::experimental::basic_string_view<char> SV; - SV sv1{ "ABCDEFGHIJKL", n }; - sv1.clear(); - return sv1.size(); -} -#endif - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - test ( "", 0 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - test ( L"", 0 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - test ( u"", 0 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); - test ( U"", 0 ); -#endif - -#if TEST_STD_VER > 11 - static_assert ( test_ce (5) == 0, "" ); -#endif - -} diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp deleted file mode 100644 index 03484a0b5ebba..0000000000000 --- a/test/std/experimental/string.view/string.view.modifiers/remove_prefix.pass.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// void remove_prefix(size_type _n) - -#include <experimental/string_view> -#include <cassert> -#include <iostream> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s, size_t len ) { - typedef std::experimental::basic_string_view<CharT> SV; - { - SV sv1 ( s ); - assert ( sv1.size() == len ); - assert ( sv1.data() == s ); - - if ( len > 0 ) { - sv1.remove_prefix ( 1 ); - assert ( sv1.size() == (len - 1)); - assert ( sv1.data() == (s + 1)); - sv1.remove_prefix ( len - 1 ); - } - - assert ( sv1.size() == 0 ); - sv1.remove_prefix ( 0 ); - assert ( sv1.size() == 0 ); - } -} - -#if TEST_STD_VER > 11 -constexpr size_t test_ce ( size_t n, size_t k ) { - typedef std::experimental::basic_string_view<char> SV; - SV sv1{ "ABCDEFGHIJKL", n }; - sv1.remove_prefix ( k ); - return sv1.size(); -} -#endif - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - test ( "", 0 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - test ( L"", 0 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - test ( u"", 0 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); - test ( U"", 0 ); -#endif - -#if TEST_STD_VER > 11 - { - static_assert ( test_ce ( 5, 0 ) == 5, "" ); - static_assert ( test_ce ( 5, 1 ) == 4, "" ); - static_assert ( test_ce ( 5, 5 ) == 0, "" ); - static_assert ( test_ce ( 9, 3 ) == 6, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp deleted file mode 100644 index 6b632d0efad83..0000000000000 --- a/test/std/experimental/string.view/string.view.modifiers/remove_suffix.pass.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// void remove_suffix(size_type _n) - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s, size_t len ) { - typedef std::experimental::basic_string_view<CharT> SV; - { - SV sv1 ( s ); - assert ( sv1.size() == len ); - assert ( sv1.data() == s ); - - if ( len > 0 ) { - sv1.remove_suffix ( 1 ); - assert ( sv1.size() == (len - 1)); - assert ( sv1.data() == s); - sv1.remove_suffix ( len - 1 ); - } - - assert ( sv1.size() == 0 ); - sv1.remove_suffix ( 0 ); - assert ( sv1.size() == 0 ); - } - -} - -#if TEST_STD_VER > 11 -constexpr size_t test_ce ( size_t n, size_t k ) { - typedef std::experimental::basic_string_view<char> SV; - SV sv1{ "ABCDEFGHIJKL", n }; - sv1.remove_suffix ( k ); - return sv1.size(); -} -#endif - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - test ( "", 0 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - test ( L"", 0 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - test ( u"", 0 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); - test ( U"", 0 ); -#endif - -#if TEST_STD_VER > 11 - { - static_assert ( test_ce ( 5, 0 ) == 5, "" ); - static_assert ( test_ce ( 5, 1 ) == 4, "" ); - static_assert ( test_ce ( 5, 5 ) == 0, "" ); - static_assert ( test_ce ( 9, 3 ) == 6, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp b/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp deleted file mode 100644 index 2912fd8b91500..0000000000000 --- a/test/std/experimental/string.view/string.view.modifiers/swap.pass.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// void swap(basic_string_view& _other) noexcept - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s, size_t len ) { - typedef std::experimental::basic_string_view<CharT> SV; - { - SV sv1(s); - SV sv2; - - assert ( sv1.size() == len ); - assert ( sv1.data() == s ); - assert ( sv2.size() == 0 ); - - sv1.swap ( sv2 ); - assert ( sv1.size() == 0 ); - assert ( sv2.size() == len ); - assert ( sv2.data() == s ); - } - -} - -#if TEST_STD_VER > 11 -constexpr size_t test_ce ( size_t n, size_t k ) { - typedef std::experimental::basic_string_view<char> SV; - SV sv1{ "ABCDEFGHIJKL", n }; - SV sv2 { sv1.data(), k }; - sv1.swap ( sv2 ); - return sv1.size(); -} -#endif - - -int main () { - test ( "ABCDE", 5 ); - test ( "a", 1 ); - test ( "", 0 ); - - test ( L"ABCDE", 5 ); - test ( L"a", 1 ); - test ( L"", 0 ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDE", 5 ); - test ( u"a", 1 ); - test ( u"", 0 ); - - test ( U"ABCDE", 5 ); - test ( U"a", 1 ); - test ( U"", 0 ); -#endif - -#if TEST_STD_VER > 11 - { - static_assert ( test_ce (2, 3) == 3, "" ); - static_assert ( test_ce (5, 3) == 3, "" ); - static_assert ( test_ce (0, 1) == 1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp b/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp deleted file mode 100644 index 202e9ced451f4..0000000000000 --- a/test/std/experimental/string.view/string.view.nonmem/quoted.pass.cpp +++ /dev/null @@ -1,214 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <iomanip> - -// quoted - -#include <iomanip> -#include <sstream> -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -#if TEST_STD_VER > 11 -// quoted is C++14 only - -bool is_skipws ( const std::istream *is ) { - return ( is->flags() & std::ios_base::skipws ) != 0; - } - - -bool is_skipws ( const std::wistream *is ) { - return ( is->flags() & std::ios_base::skipws ) != 0; - } - -void round_trip ( const char *p ) { - std::stringstream ss; - bool skippingws = is_skipws ( &ss ); - std::experimental::string_view sv {p}; - - ss << std::quoted(sv); - std::string s; - ss >> std::quoted(s); - assert ( s == sv ); - assert ( skippingws == is_skipws ( &ss )); - } - -void round_trip_ws ( const char *p ) { - std::stringstream ss; - std::noskipws ( ss ); - bool skippingws = is_skipws ( &ss ); - std::experimental::string_view sv {p}; - - ss << std::quoted(sv); - std::string s; - ss >> std::quoted(s); - assert ( s == sv ); - assert ( skippingws == is_skipws ( &ss )); - } - -void round_trip_d ( const char *p, char delim ) { - std::stringstream ss; - std::experimental::string_view sv {p}; - - ss << std::quoted(sv, delim); - std::string s; - ss >> std::quoted(s, delim); - assert ( s == sv ); - } - -void round_trip_e ( const char *p, char escape ) { - std::stringstream ss; - std::experimental::string_view sv {p}; - - ss << std::quoted(sv, '"', escape ); - std::string s; - ss >> std::quoted(s, '"', escape ); - assert ( s == sv ); - } - - - -std::string quote ( const char *p, char delim='"', char escape='\\' ) { - std::stringstream ss; - ss << std::quoted(p, delim, escape); - std::string s; - ss >> s; // no quote - return s; -} - -std::string unquote ( const char *p, char delim='"', char escape='\\' ) { - std::stringstream ss; - ss << p; - std::string s; - ss >> std::quoted(s, delim, escape); - return s; -} - - -void round_trip ( const wchar_t *p ) { - std::wstringstream ss; - bool skippingws = is_skipws ( &ss ); - std::experimental::wstring_view sv {p}; - - ss << std::quoted(sv); - std::wstring s; - ss >> std::quoted(s); - assert ( s == sv ); - assert ( skippingws == is_skipws ( &ss )); - } - - -void round_trip_ws ( const wchar_t *p ) { - std::wstringstream ss; - std::noskipws ( ss ); - bool skippingws = is_skipws ( &ss ); - std::experimental::wstring_view sv {p}; - - ss << std::quoted(sv); - std::wstring s; - ss >> std::quoted(s); - assert ( s == sv ); - assert ( skippingws == is_skipws ( &ss )); - } - -void round_trip_d ( const wchar_t *p, wchar_t delim ) { - std::wstringstream ss; - std::experimental::wstring_view sv {p}; - - ss << std::quoted(sv, delim); - std::wstring s; - ss >> std::quoted(s, delim); - assert ( s == sv ); - } - -void round_trip_e ( const wchar_t *p, wchar_t escape ) { - std::wstringstream ss; - std::experimental::wstring_view sv {p}; - - ss << std::quoted(sv, wchar_t('"'), escape ); - std::wstring s; - ss >> std::quoted(s, wchar_t('"'), escape ); - assert ( s == sv ); - } - - -std::wstring quote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) { - std::wstringstream ss; - std::experimental::wstring_view sv {p}; - - ss << std::quoted(sv, delim, escape); - std::wstring s; - ss >> s; // no quote - return s; -} - -std::wstring unquote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\' ) { - std::wstringstream ss; - std::experimental::wstring_view sv {p}; - - ss << sv; - std::wstring s; - ss >> std::quoted(s, delim, escape); - return s; -} - -int main() -{ - round_trip ( "" ); - round_trip_ws ( "" ); - round_trip_d ( "", 'q' ); - round_trip_e ( "", 'q' ); - - round_trip ( L"" ); - round_trip_ws ( L"" ); - round_trip_d ( L"", 'q' ); - round_trip_e ( L"", 'q' ); - - round_trip ( "Hi" ); - round_trip_ws ( "Hi" ); - round_trip_d ( "Hi", '!' ); - round_trip_e ( "Hi", '!' ); - assert ( quote ( "Hi", '!' ) == "!Hi!" ); - assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" ); - - round_trip ( L"Hi" ); - round_trip_ws ( L"Hi" ); - round_trip_d ( L"Hi", '!' ); - round_trip_e ( L"Hi", '!' ); - assert ( quote ( L"Hi", '!' ) == L"!Hi!" ); - assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" ); - - round_trip ( "Hi Mom" ); - round_trip_ws ( "Hi Mom" ); - round_trip ( L"Hi Mom" ); - round_trip_ws ( L"Hi Mom" ); - - assert ( quote ( "" ) == "\"\"" ); - assert ( quote ( L"" ) == L"\"\"" ); - assert ( quote ( "a" ) == "\"a\"" ); - assert ( quote ( L"a" ) == L"\"a\"" ); - -// missing end quote - must not hang - assert ( unquote ( "\"abc" ) == "abc" ); - assert ( unquote ( L"\"abc" ) == L"abc" ); - - assert ( unquote ( "abc" ) == "abc" ); // no delimiter - assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter - assert ( unquote ( "abc def" ) == "abc" ); // no delimiter - assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter - - assert ( unquote ( "" ) == "" ); // nothing there - assert ( unquote ( L"" ) == L"" ); // nothing there - } -#else -int main() {} -#endif diff --git a/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp b/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp deleted file mode 100644 index a29bb15f5ac9c..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/basic_string.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// template<class _Allocator> -// explicit operator basic_string<_CharT, _Traits, _Allocator>() const - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test ( const CharT *s ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - typedef std::basic_string<CharT> string_t; - - { - string_view_t sv1 ( s ); - string_t str = (string_t) sv1; - - assert ( sv1.size() == str.size ()); - assert ( std::char_traits<CharT>::compare ( sv1.data(), str.data(), sv1.size()) == 0 ); - } - - { - string_view_t sv1; - string_t str = (string_t) sv1; - - assert ( sv1.size() == 0); - assert ( sv1.size() == str.size ()); - } -} - -int main () { - test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( "ABCDE"); - test ( "a" ); - test ( "" ); - - test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( L"ABCDE" ); - test ( L"a" ); - test ( L"" ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( u"ABCDE" ); - test ( u"a" ); - test ( u"" ); - - test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( U"ABCDE" ); - test ( U"a" ); - test ( U"" ); -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp deleted file mode 100644 index 93014ea119f9e..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.pointer.pass.cpp +++ /dev/null @@ -1,127 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr int compare(const charT* s) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, const CharT *s, int expected ) { - assert ( sign( sv1.compare(s)) == sign(expected)); -} - -template<typename CharT> -void -test( const CharT *s1, const CharT *s2, int expected) -{ - typedef std::experimental::basic_string_view<CharT> string_view_t; - string_view_t sv1 ( s1 ); - test1 ( sv1, s2, expected ); -} - -int main() -{ - { - test("", "", 0); - test("", "abcde", -5); - test("", "abcdefghij", -10); - test("", "abcdefghijklmnopqrst", -20); - test("abcde", "", 5); - test("abcde", "abcde", 0); - test("abcde", "abcdefghij", -5); - test("abcde", "abcdefghijklmnopqrst", -15); - test("abcdefghij", "", 10); - test("abcdefghij", "abcde", 5); - test("abcdefghij", "abcdefghij", 0); - test("abcdefghij", "abcdefghijklmnopqrst", -10); - test("abcdefghijklmnopqrst", "", 20); - test("abcdefghijklmnopqrst", "abcde", 15); - test("abcdefghijklmnopqrst", "abcdefghij", 10); - test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0); - } - - { - test(L"", L"", 0); - test(L"", L"abcde", -5); - test(L"", L"abcdefghij", -10); - test(L"", L"abcdefghijklmnopqrst", -20); - test(L"abcde", L"", 5); - test(L"abcde", L"abcde", 0); - test(L"abcde", L"abcdefghij", -5); - test(L"abcde", L"abcdefghijklmnopqrst", -15); - test(L"abcdefghij", L"", 10); - test(L"abcdefghij", L"abcde", 5); - test(L"abcdefghij", L"abcdefghij", 0); - test(L"abcdefghij", L"abcdefghijklmnopqrst", -10); - test(L"abcdefghijklmnopqrst", L"", 20); - test(L"abcdefghijklmnopqrst", L"abcde", 15); - test(L"abcdefghijklmnopqrst", L"abcdefghij", 10); - test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0); - } - -#if TEST_STD_VER >= 11 - { - test(U"", U"", 0); - test(U"", U"abcde", -5); - test(U"", U"abcdefghij", -10); - test(U"", U"abcdefghijklmnopqrst", -20); - test(U"abcde", U"", 5); - test(U"abcde", U"abcde", 0); - test(U"abcde", U"abcdefghij", -5); - test(U"abcde", U"abcdefghijklmnopqrst", -15); - test(U"abcdefghij", U"", 10); - test(U"abcdefghij", U"abcde", 5); - test(U"abcdefghij", U"abcdefghij", 0); - test(U"abcdefghij", U"abcdefghijklmnopqrst", -10); - test(U"abcdefghijklmnopqrst", U"", 20); - test(U"abcdefghijklmnopqrst", U"abcde", 15); - test(U"abcdefghijklmnopqrst", U"abcdefghij", 10); - test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0); - } - - { - test(u"", u"", 0); - test(u"", u"abcde", -5); - test(u"", u"abcdefghij", -10); - test(u"", u"abcdefghijklmnopqrst", -20); - test(u"abcde", u"", 5); - test(u"abcde", u"abcde", 0); - test(u"abcde", u"abcdefghij", -5); - test(u"abcde", u"abcdefghijklmnopqrst", -15); - test(u"abcdefghij", u"", 10); - test(u"abcdefghij", u"abcde", 5); - test(u"abcdefghij", u"abcdefghij", 0); - test(u"abcdefghij", u"abcdefghijklmnopqrst", -10); - test(u"abcdefghijklmnopqrst", u"", 20); - test(u"abcdefghijklmnopqrst", u"abcde", 15); - test(u"abcdefghijklmnopqrst", u"abcdefghij", 10); - test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0); - } -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - static_assert ( sv1.compare("") == 0, "" ); - static_assert ( sv1.compare("abcde") == -1, "" ); - static_assert ( sv2.compare("") == 1, "" ); - static_assert ( sv2.compare("abcde") == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp deleted file mode 100644 index cfe35fcb47193..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.pointer_size.pass.cpp +++ /dev/null @@ -1,453 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr int compare(size_type pos1, size_type n1, const charT* s) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, - size_t pos1, size_t n1, const CharT *s, int expected ) { - if (pos1 > sv1.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - sv1.compare(pos1, n1, s); - assert(false); - } catch (const std::out_of_range&) { - } catch (...) { - assert(false); - } -#endif - } else { - assert(sign(sv1.compare(pos1, n1, s)) == sign(expected)); - } -} - -template<typename CharT> -void -test( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected) -{ - typedef std::experimental::basic_string_view<CharT> string_view_t; - string_view_t sv1 ( s1 ); - test1 ( sv1, pos1, n1, s2, expected ); -} - -void test0() -{ - test("", 0, 0, "", 0); - test("", 0, 0, "abcde", -5); - test("", 0, 0, "abcdefghij", -10); - test("", 0, 0, "abcdefghijklmnopqrst", -20); - test("", 0, 1, "", 0); - test("", 0, 1, "abcde", -5); - test("", 0, 1, "abcdefghij", -10); - test("", 0, 1, "abcdefghijklmnopqrst", -20); - test("", 1, 0, "", 0); - test("", 1, 0, "abcde", 0); - test("", 1, 0, "abcdefghij", 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0); - test("abcde", 0, 0, "", 0); - test("abcde", 0, 0, "abcde", -5); - test("abcde", 0, 0, "abcdefghij", -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 0, 1, "", 1); - test("abcde", 0, 1, "abcde", -4); - test("abcde", 0, 1, "abcdefghij", -9); - test("abcde", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcde", 0, 2, "", 2); - test("abcde", 0, 2, "abcde", -3); - test("abcde", 0, 2, "abcdefghij", -8); - test("abcde", 0, 2, "abcdefghijklmnopqrst", -18); - test("abcde", 0, 4, "", 4); - test("abcde", 0, 4, "abcde", -1); - test("abcde", 0, 4, "abcdefghij", -6); - test("abcde", 0, 4, "abcdefghijklmnopqrst", -16); - test("abcde", 0, 5, "", 5); - test("abcde", 0, 5, "abcde", 0); - test("abcde", 0, 5, "abcdefghij", -5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", -15); - test("abcde", 0, 6, "", 5); - test("abcde", 0, 6, "abcde", 0); - test("abcde", 0, 6, "abcdefghij", -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", -15); - test("abcde", 1, 0, "", 0); - test("abcde", 1, 0, "abcde", -5); - test("abcde", 1, 0, "abcdefghij", -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 1, 1, "", 1); - test("abcde", 1, 1, "abcde", 1); - test("abcde", 1, 1, "abcdefghij", 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 2, "", 2); - test("abcde", 1, 2, "abcde", 1); - test("abcde", 1, 2, "abcdefghij", 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 3, "", 3); - test("abcde", 1, 3, "abcde", 1); - test("abcde", 1, 3, "abcdefghij", 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 4, "", 4); - test("abcde", 1, 4, "abcde", 1); - test("abcde", 1, 4, "abcdefghij", 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 5, "", 4); - test("abcde", 1, 5, "abcde", 1); - test("abcde", 1, 5, "abcdefghij", 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1); - test("abcde", 2, 0, "", 0); - test("abcde", 2, 0, "abcde", -5); - test("abcde", 2, 0, "abcdefghij", -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 2, 1, "", 1); - test("abcde", 2, 1, "abcde", 2); - test("abcde", 2, 1, "abcdefghij", 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 2, "", 2); - test("abcde", 2, 2, "abcde", 2); - test("abcde", 2, 2, "abcdefghij", 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 3, "", 3); - test("abcde", 2, 3, "abcde", 2); - test("abcde", 2, 3, "abcdefghij", 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 4, "", 3); - test("abcde", 2, 4, "abcde", 2); - test("abcde", 2, 4, "abcdefghij", 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 2); - test("abcde", 4, 0, "", 0); - test("abcde", 4, 0, "abcde", -5); - test("abcde", 4, 0, "abcdefghij", -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 4, 1, "", 1); - test("abcde", 4, 1, "abcde", 4); - test("abcde", 4, 1, "abcdefghij", 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 4); - test("abcde", 4, 2, "", 1); - test("abcde", 4, 2, "abcde", 4); - test("abcde", 4, 2, "abcdefghij", 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 4); - test("abcde", 5, 0, "", 0); - test("abcde", 5, 0, "abcde", -5); - test("abcde", 5, 0, "abcdefghij", -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 5, 1, "", 0); - test("abcde", 5, 1, "abcde", -5); - test("abcde", 5, 1, "abcdefghij", -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", -20); -} - -void test1() -{ - test("abcde", 6, 0, "", 0); - test("abcde", 6, 0, "abcde", 0); - test("abcde", 6, 0, "abcdefghij", 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0); - test("abcdefghij", 0, 0, "", 0); - test("abcdefghij", 0, 0, "abcde", -5); - test("abcdefghij", 0, 0, "abcdefghij", -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 0, 1, "", 1); - test("abcdefghij", 0, 1, "abcde", -4); - test("abcdefghij", 0, 1, "abcdefghij", -9); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcdefghij", 0, 5, "", 5); - test("abcdefghij", 0, 5, "abcde", 0); - test("abcdefghij", 0, 5, "abcdefghij", -5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15); - test("abcdefghij", 0, 9, "", 9); - test("abcdefghij", 0, 9, "abcde", 4); - test("abcdefghij", 0, 9, "abcdefghij", -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11); - test("abcdefghij", 0, 10, "", 10); - test("abcdefghij", 0, 10, "abcde", 5); - test("abcdefghij", 0, 10, "abcdefghij", 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10); - test("abcdefghij", 0, 11, "", 10); - test("abcdefghij", 0, 11, "abcde", 5); - test("abcdefghij", 0, 11, "abcdefghij", 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10); - test("abcdefghij", 1, 0, "", 0); - test("abcdefghij", 1, 0, "abcde", -5); - test("abcdefghij", 1, 0, "abcdefghij", -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 1, 1, "", 1); - test("abcdefghij", 1, 1, "abcde", 1); - test("abcdefghij", 1, 1, "abcdefghij", 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 4, "", 4); - test("abcdefghij", 1, 4, "abcde", 1); - test("abcdefghij", 1, 4, "abcdefghij", 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 8, "", 8); - test("abcdefghij", 1, 8, "abcde", 1); - test("abcdefghij", 1, 8, "abcdefghij", 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 9, "", 9); - test("abcdefghij", 1, 9, "abcde", 1); - test("abcdefghij", 1, 9, "abcdefghij", 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 10, "", 9); - test("abcdefghij", 1, 10, "abcde", 1); - test("abcdefghij", 1, 10, "abcdefghij", 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 5, 0, "", 0); - test("abcdefghij", 5, 0, "abcde", -5); - test("abcdefghij", 5, 0, "abcdefghij", -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 5, 1, "", 1); - test("abcdefghij", 5, 1, "abcde", 5); - test("abcdefghij", 5, 1, "abcdefghij", 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 2, "", 2); - test("abcdefghij", 5, 2, "abcde", 5); - test("abcdefghij", 5, 2, "abcdefghij", 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 4, "", 4); - test("abcdefghij", 5, 4, "abcde", 5); - test("abcdefghij", 5, 4, "abcdefghij", 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 5, "", 5); - test("abcdefghij", 5, 5, "abcde", 5); - test("abcdefghij", 5, 5, "abcdefghij", 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 6, "", 5); - test("abcdefghij", 5, 6, "abcde", 5); - test("abcdefghij", 5, 6, "abcdefghij", 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 9, 0, "", 0); - test("abcdefghij", 9, 0, "abcde", -5); - test("abcdefghij", 9, 0, "abcdefghij", -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 9, 1, "", 1); - test("abcdefghij", 9, 1, "abcde", 9); - test("abcdefghij", 9, 1, "abcdefghij", 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9); - test("abcdefghij", 9, 2, "", 1); - test("abcdefghij", 9, 2, "abcde", 9); - test("abcdefghij", 9, 2, "abcdefghij", 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9); - test("abcdefghij", 10, 0, "", 0); - test("abcdefghij", 10, 0, "abcde", -5); - test("abcdefghij", 10, 0, "abcdefghij", -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 10, 1, "", 0); - test("abcdefghij", 10, 1, "abcde", -5); - test("abcdefghij", 10, 1, "abcdefghij", -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 11, 0, "", 0); - test("abcdefghij", 11, 0, "abcde", 0); - test("abcdefghij", 11, 0, "abcdefghij", 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0); -} - -void test2() -{ - test("abcdefghijklmnopqrst", 0, 0, "", 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 0, 1, "", 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", -4); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcdefghijklmnopqrst", 0, 10, "", 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10); - test("abcdefghijklmnopqrst", 0, 19, "", 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 14); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1); - test("abcdefghijklmnopqrst", 0, 20, "", 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 15); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0); - test("abcdefghijklmnopqrst", 0, 21, "", 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 15); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0); - test("abcdefghijklmnopqrst", 1, 0, "", 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 1, 1, "", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 9, "", 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 18, "", 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 19, "", 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 20, "", 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 10, 0, "", 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 10, 1, "", 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 5, "", 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 9, "", 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 10, "", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 11, "", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 19, 0, "", 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 19, 1, "", 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19); - test("abcdefghijklmnopqrst", 19, 2, "", 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19); - test("abcdefghijklmnopqrst", 20, 0, "", 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 20, 1, "", 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 21, 0, "", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0); -} - - -int main() -{ - test0(); - test1(); - test2(); - - { - test("", 0, 0, "", 0); - test("", 0, 0, "abcde", -5); - test("", 0, 0, "abcdefghij", -10); - test("", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 0, 2, "", 5); - test("abcde", 0, 6,"abcde", 0); - test("abcde", 0, 6, "abcdefghij", -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", -15); - test("abcdefghij", 3, 3, "", 10); - test("abcdefghij", 3, 3,"abcde", 5); - test("abcdefghij", 3, 3, "def", 0); - test("abcdefghij", 0, 4, "abcdefghijklmnopqrst", -10); - test("abcdefghijklmnopqrst", 5, 5, "", 20); - test("abcdefghijklmnopqrst", 0, 8, "abcde", 15); - test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 0, -1, "abcdefghijklmnopqrst", 0); - } - - { - test(L"", 0, 0, L"", 0); - test(L"", 0, 0, L"abcde", -5); - test(L"", 0, 0, L"abcdefghij", -10); - test(L"", 0, 0, L"abcdefghijklmnopqrst", -20); - test(L"abcde", 0, 2, L"", 5); - test(L"abcde", 0, 6, L"abcde", 0); - test(L"abcde", 0, 6, L"abcdefghij", -5); - test(L"abcde", 0, 6, L"abcdefghijklmnopqrst", -15); - test(L"abcdefghij", 3, 3, L"", 10); - test(L"abcdefghij", 3, 3, L"abcde", 5); - test(L"abcdefghij", 3, 3, L"def", 0); - test(L"abcdefghij", 0, 4, L"abcdefghijklmnopqrst", -10); - test(L"abcdefghijklmnopqrst", 5, 5, L"", 20); - test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15); - test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10); - test(L"abcdefghijklmnopqrst", 0, -1, L"abcdefghijklmnopqrst", 0); - } - -#if TEST_STD_VER >= 11 - { - test(U"", 0, 0, U"", 0); - test(U"", 0, 0, U"abcde", -5); - test(U"", 0, 0, U"abcdefghij", -10); - test(U"", 0, 0, U"abcdefghijklmnopqrst", -20); - test(U"abcde", 0, 2, U"", 5); - test(U"abcde", 0, 6, U"abcde", 0); - test(U"abcde", 0, 6, U"abcdefghij", -5); - test(U"abcde", 0, 6, U"abcdefghijklmnopqrst", -15); - test(U"abcdefghij", 3, 3, U"", 10); - test(U"abcdefghij", 3, 3, U"abcde", 5); - test(U"abcdefghij", 3, 3, U"def", 0); - test(U"abcdefghij", 0, 4, U"abcdefghijklmnopqrst", -10); - test(U"abcdefghijklmnopqrst", 5, 5, U"", 20); - test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15); - test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10); - test(U"abcdefghijklmnopqrst", 0, -1, U"abcdefghijklmnopqrst", 0); - } - - { - test(u"", 0, 0, u"", 0); - test(u"", 0, 0, u"abcde", -5); - test(u"", 0, 0, u"abcdefghij", -10); - test(u"", 0, 0, u"abcdefghijklmnopqrst", -20); - test(u"abcde", 0, 2, u"", 5); - test(u"abcde", 0, 6, u"abcde", 0); - test(u"abcde", 0, 6, u"abcdefghij", -5); - test(u"abcde", 0, 6, u"abcdefghijklmnopqrst", -15); - test(u"abcdefghij", 3, 3, u"", 10); - test(u"abcdefghij", 3, 3, u"abcde", 5); - test(u"abcdefghij", 3, 3, u"def", 0); - test(u"abcdefghij", 0, 4, u"abcdefghijklmnopqrst", -10); - test(u"abcdefghijklmnopqrst", 5, 5, u"", 20); - test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15); - test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10); - test(u"abcdefghijklmnopqrst", 0, -1, u"abcdefghijklmnopqrst", 0); - } -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcde", 5 }; - static_assert ( sv1.compare(0, 0, "") == 0, "" ); - static_assert ( sv1.compare(0, 0, "abcde") == -1, "" ); - static_assert ( sv2.compare(0, 2, "") == 1, "" ); - static_assert ( sv2.compare(0, 6, "abcde") == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp deleted file mode 100644 index 2684d903405e3..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv.pass.cpp +++ /dev/null @@ -1,403 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1, - std::experimental::basic_string_view<CharT> sv2, int expected ) { - - if (pos1 > sv1.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - sv1.compare(pos1, n1, sv2); - assert(false); - } catch (const std::out_of_range&) { - } catch (...) { - assert(false); - } -#endif - } else { - assert ( sign( sv1.compare(pos1, n1, sv2)) == sign(expected)); - } -} - - -template<typename CharT> -void test ( const CharT *s1, size_t pos1, size_t n1, const CharT *s2, int expected ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - string_view_t sv1 ( s1 ); - string_view_t sv2 ( s2 ); - test1(sv1, pos1, n1, sv2, expected); -} - -void test0() -{ - test("", 0, 0, "", 0); - test("", 0, 0, "abcde", -5); - test("", 0, 0, "abcdefghij", -10); - test("", 0, 0, "abcdefghijklmnopqrst", -20); - test("", 0, 1, "", 0); - test("", 0, 1, "abcde", -5); - test("", 0, 1, "abcdefghij", -10); - test("", 0, 1, "abcdefghijklmnopqrst", -20); - test("", 1, 0, "", 0); - test("", 1, 0, "abcde", 0); - test("", 1, 0, "abcdefghij", 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0); - test("abcde", 0, 0, "", 0); - test("abcde", 0, 0, "abcde", -5); - test("abcde", 0, 0, "abcdefghij", -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 0, 1, "", 1); - test("abcde", 0, 1, "abcde", -4); - test("abcde", 0, 1, "abcdefghij", -9); - test("abcde", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcde", 0, 2, "", 2); - test("abcde", 0, 2, "abcde", -3); - test("abcde", 0, 2, "abcdefghij", -8); - test("abcde", 0, 2, "abcdefghijklmnopqrst", -18); - test("abcde", 0, 4, "", 4); - test("abcde", 0, 4, "abcde", -1); - test("abcde", 0, 4, "abcdefghij", -6); - test("abcde", 0, 4, "abcdefghijklmnopqrst", -16); - test("abcde", 0, 5, "", 5); - test("abcde", 0, 5, "abcde", 0); - test("abcde", 0, 5, "abcdefghij", -5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", -15); - test("abcde", 0, 6, "", 5); - test("abcde", 0, 6, "abcde", 0); - test("abcde", 0, 6, "abcdefghij", -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", -15); - test("abcde", 1, 0, "", 0); - test("abcde", 1, 0, "abcde", -5); - test("abcde", 1, 0, "abcdefghij", -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 1, 1, "", 1); - test("abcde", 1, 1, "abcde", 1); - test("abcde", 1, 1, "abcdefghij", 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 2, "", 2); - test("abcde", 1, 2, "abcde", 1); - test("abcde", 1, 2, "abcdefghij", 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 3, "", 3); - test("abcde", 1, 3, "abcde", 1); - test("abcde", 1, 3, "abcdefghij", 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 4, "", 4); - test("abcde", 1, 4, "abcde", 1); - test("abcde", 1, 4, "abcdefghij", 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1); - test("abcde", 1, 5, "", 4); - test("abcde", 1, 5, "abcde", 1); - test("abcde", 1, 5, "abcdefghij", 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1); - test("abcde", 2, 0, "", 0); - test("abcde", 2, 0, "abcde", -5); - test("abcde", 2, 0, "abcdefghij", -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 2, 1, "", 1); - test("abcde", 2, 1, "abcde", 2); - test("abcde", 2, 1, "abcdefghij", 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 2, "", 2); - test("abcde", 2, 2, "abcde", 2); - test("abcde", 2, 2, "abcdefghij", 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 3, "", 3); - test("abcde", 2, 3, "abcde", 2); - test("abcde", 2, 3, "abcdefghij", 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 2); - test("abcde", 2, 4, "", 3); - test("abcde", 2, 4, "abcde", 2); - test("abcde", 2, 4, "abcdefghij", 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 2); - test("abcde", 4, 0, "", 0); - test("abcde", 4, 0, "abcde", -5); - test("abcde", 4, 0, "abcdefghij", -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 4, 1, "", 1); - test("abcde", 4, 1, "abcde", 4); - test("abcde", 4, 1, "abcdefghij", 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 4); - test("abcde", 4, 2, "", 1); - test("abcde", 4, 2, "abcde", 4); - test("abcde", 4, 2, "abcdefghij", 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 4); - test("abcde", 5, 0, "", 0); - test("abcde", 5, 0, "abcde", -5); - test("abcde", 5, 0, "abcdefghij", -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", -20); - test("abcde", 5, 1, "", 0); - test("abcde", 5, 1, "abcde", -5); - test("abcde", 5, 1, "abcdefghij", -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", -20); -} - -void test1() -{ - test("abcde", 6, 0, "", 0); - test("abcde", 6, 0, "abcde", 0); - test("abcde", 6, 0, "abcdefghij", 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0); - test("abcdefghij", 0, 0, "", 0); - test("abcdefghij", 0, 0, "abcde", -5); - test("abcdefghij", 0, 0, "abcdefghij", -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 0, 1, "", 1); - test("abcdefghij", 0, 1, "abcde", -4); - test("abcdefghij", 0, 1, "abcdefghij", -9); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcdefghij", 0, 5, "", 5); - test("abcdefghij", 0, 5, "abcde", 0); - test("abcdefghij", 0, 5, "abcdefghij", -5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", -15); - test("abcdefghij", 0, 9, "", 9); - test("abcdefghij", 0, 9, "abcde", 4); - test("abcdefghij", 0, 9, "abcdefghij", -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", -11); - test("abcdefghij", 0, 10, "", 10); - test("abcdefghij", 0, 10, "abcde", 5); - test("abcdefghij", 0, 10, "abcdefghij", 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", -10); - test("abcdefghij", 0, 11, "", 10); - test("abcdefghij", 0, 11, "abcde", 5); - test("abcdefghij", 0, 11, "abcdefghij", 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", -10); - test("abcdefghij", 1, 0, "", 0); - test("abcdefghij", 1, 0, "abcde", -5); - test("abcdefghij", 1, 0, "abcdefghij", -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 1, 1, "", 1); - test("abcdefghij", 1, 1, "abcde", 1); - test("abcdefghij", 1, 1, "abcdefghij", 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 4, "", 4); - test("abcdefghij", 1, 4, "abcde", 1); - test("abcdefghij", 1, 4, "abcdefghij", 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 8, "", 8); - test("abcdefghij", 1, 8, "abcde", 1); - test("abcdefghij", 1, 8, "abcdefghij", 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 9, "", 9); - test("abcdefghij", 1, 9, "abcde", 1); - test("abcdefghij", 1, 9, "abcdefghij", 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 1, 10, "", 9); - test("abcdefghij", 1, 10, "abcde", 1); - test("abcdefghij", 1, 10, "abcdefghij", 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1); - test("abcdefghij", 5, 0, "", 0); - test("abcdefghij", 5, 0, "abcde", -5); - test("abcdefghij", 5, 0, "abcdefghij", -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 5, 1, "", 1); - test("abcdefghij", 5, 1, "abcde", 5); - test("abcdefghij", 5, 1, "abcdefghij", 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 2, "", 2); - test("abcdefghij", 5, 2, "abcde", 5); - test("abcdefghij", 5, 2, "abcdefghij", 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 4, "", 4); - test("abcdefghij", 5, 4, "abcde", 5); - test("abcdefghij", 5, 4, "abcdefghij", 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 5, "", 5); - test("abcdefghij", 5, 5, "abcde", 5); - test("abcdefghij", 5, 5, "abcdefghij", 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 5, 6, "", 5); - test("abcdefghij", 5, 6, "abcde", 5); - test("abcdefghij", 5, 6, "abcdefghij", 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 5); - test("abcdefghij", 9, 0, "", 0); - test("abcdefghij", 9, 0, "abcde", -5); - test("abcdefghij", 9, 0, "abcdefghij", -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 9, 1, "", 1); - test("abcdefghij", 9, 1, "abcde", 9); - test("abcdefghij", 9, 1, "abcdefghij", 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 9); - test("abcdefghij", 9, 2, "", 1); - test("abcdefghij", 9, 2, "abcde", 9); - test("abcdefghij", 9, 2, "abcdefghij", 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 9); - test("abcdefghij", 10, 0, "", 0); - test("abcdefghij", 10, 0, "abcde", -5); - test("abcdefghij", 10, 0, "abcdefghij", -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 10, 1, "", 0); - test("abcdefghij", 10, 1, "abcde", -5); - test("abcdefghij", 10, 1, "abcdefghij", -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", -20); - test("abcdefghij", 11, 0, "", 0); - test("abcdefghij", 11, 0, "abcde", 0); - test("abcdefghij", 11, 0, "abcdefghij", 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0); -} - -void test2() -{ - test("abcdefghijklmnopqrst", 0, 0, "", 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 0, 1, "", 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", -4); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", -19); - test("abcdefghijklmnopqrst", 0, 10, "", 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", -10); - test("abcdefghijklmnopqrst", 0, 19, "", 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 14); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", -1); - test("abcdefghijklmnopqrst", 0, 20, "", 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 15); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0); - test("abcdefghijklmnopqrst", 0, 21, "", 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 15); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0); - test("abcdefghijklmnopqrst", 1, 0, "", 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 1, 1, "", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 9, "", 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 18, "", 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 19, "", 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 1, 20, "", 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1); - test("abcdefghijklmnopqrst", 10, 0, "", 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 10, 1, "", 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 5, "", 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 9, "", 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 10, "", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 10, 11, "", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10); - test("abcdefghijklmnopqrst", 19, 0, "", 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 19, 1, "", 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19); - test("abcdefghijklmnopqrst", 19, 2, "", 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19); - test("abcdefghijklmnopqrst", 20, 0, "", 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 20, 1, "", 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", -20); - test("abcdefghijklmnopqrst", 21, 0, "", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0); -} - - -int main () { - test0(); - test1(); - test2(); - - { - test("abcde", 5, 1, "", 0); - test("abcde", 2, 4, "", 3); - test("abcde", 2, 4, "abcde", 2); - test("ABCde", 2, 4, "abcde", -1); - } - - { - test(L"abcde", 5, 1, L"", 0); - test(L"abcde", 2, 4, L"", 3); - test(L"abcde", 2, 4, L"abcde", 2); - test(L"ABCde", 2, 4, L"abcde", -1); - } - -#if TEST_STD_VER >= 11 - { - test(u"abcde", 5, 1, u"", 0); - test(u"abcde", 2, 4, u"", 3); - test(u"abcde", 2, 4, u"abcde", 2); - test(u"ABCde", 2, 4, u"abcde", -1); - } - - { - test(U"abcde", 5, 1, U"", 0); - test(U"abcde", 2, 4, U"", 3); - test(U"abcde", 2, 4, U"abcde", 2); - test(U"ABCde", 2, 4, U"abcde", -1); - } -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1 { "abcde", 5 }; - constexpr SV sv2 { "abcde", 0 }; - static_assert ( sv1.compare(5, 1, sv2) == 0, "" ); - static_assert ( sv1.compare(2, 4, sv2) == 1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp deleted file mode 100644 index 69de6335fb5ca..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_pointer_size.pass.cpp +++ /dev/null @@ -1,1356 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr int compare(size_type pos1, size_type n1, -// const charT* s, size_type n2) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1, - const CharT *s2, size_t n2, - int expected ) { - if (pos1 > sv1.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - sv1.compare(pos1, n1, s2, n2); - assert(false); - } catch (const std::out_of_range&) { - return; - } catch (...) { - assert(false); - } -#endif - } else { - assert(sign(sv1.compare(pos1, n1, s2, n2)) == sign(expected)); - } - -} - - -template<typename CharT> -void test ( const CharT *s1, size_t pos1, size_t n1, - const CharT *s2, size_t n2, - int expected ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - string_view_t sv1 ( s1 ); - test1 (sv1, pos1, n1, s2, n2, expected); -} - - -void test0() -{ - test("", 0, 0, "", 0, 0); - test("", 0, 0, "abcde", 0, 0); - test("", 0, 0, "abcde", 1, -1); - test("", 0, 0, "abcde", 2, -2); - test("", 0, 0, "abcde", 4, -4); - test("", 0, 0, "abcde", 5, -5); - test("", 0, 0, "abcdefghij", 0, 0); - test("", 0, 0, "abcdefghij", 1, -1); - test("", 0, 0, "abcdefghij", 5, -5); - test("", 0, 0, "abcdefghij", 9, -9); - test("", 0, 0, "abcdefghij", 10, -10); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 1, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 10, -10); - test("", 0, 0, "abcdefghijklmnopqrst", 19, -19); - test("", 0, 0, "abcdefghijklmnopqrst", 20, -20); - test("", 0, 1, "", 0, 0); - test("", 0, 1, "abcde", 0, 0); - test("", 0, 1, "abcde", 1, -1); - test("", 0, 1, "abcde", 2, -2); - test("", 0, 1, "abcde", 4, -4); - test("", 0, 1, "abcde", 5, -5); - test("", 0, 1, "abcdefghij", 0, 0); - test("", 0, 1, "abcdefghij", 1, -1); - test("", 0, 1, "abcdefghij", 5, -5); - test("", 0, 1, "abcdefghij", 9, -9); - test("", 0, 1, "abcdefghij", 10, -10); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 1, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 10, -10); - test("", 0, 1, "abcdefghijklmnopqrst", 19, -19); - test("", 0, 1, "abcdefghijklmnopqrst", 20, -20); - test("", 1, 0, "", 0, 0); - test("", 1, 0, "abcde", 0, 0); - test("", 1, 0, "abcde", 1, 0); - test("", 1, 0, "abcde", 2, 0); - test("", 1, 0, "abcde", 4, 0); - test("", 1, 0, "abcde", 5, 0); - test("", 1, 0, "abcdefghij", 0, 0); - test("", 1, 0, "abcdefghij", 1, 0); - test("", 1, 0, "abcdefghij", 5, 0); - test("", 1, 0, "abcdefghij", 9, 0); - test("", 1, 0, "abcdefghij", 10, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 19, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 20, 0); - test("abcde", 0, 0, "", 0, 0); - test("abcde", 0, 0, "abcde", 0, 0); - test("abcde", 0, 0, "abcde", 1, -1); - test("abcde", 0, 0, "abcde", 2, -2); - test("abcde", 0, 0, "abcde", 4, -4); - test("abcde", 0, 0, "abcde", 5, -5); - test("abcde", 0, 0, "abcdefghij", 0, 0); - test("abcde", 0, 0, "abcdefghij", 1, -1); - test("abcde", 0, 0, "abcdefghij", 5, -5); - test("abcde", 0, 0, "abcdefghij", 9, -9); - test("abcde", 0, 0, "abcdefghij", 10, -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcde", 0, 1, "", 0, 1); - test("abcde", 0, 1, "abcde", 0, 1); - test("abcde", 0, 1, "abcde", 1, 0); - test("abcde", 0, 1, "abcde", 2, -1); - test("abcde", 0, 1, "abcde", 4, -3); - test("abcde", 0, 1, "abcde", 5, -4); - test("abcde", 0, 1, "abcdefghij", 0, 1); - test("abcde", 0, 1, "abcdefghij", 1, 0); - test("abcde", 0, 1, "abcdefghij", 5, -4); - test("abcde", 0, 1, "abcdefghij", 9, -8); - test("abcde", 0, 1, "abcdefghij", 10, -9); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, -9); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, -18); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, -19); - test("abcde", 0, 2, "", 0, 2); - test("abcde", 0, 2, "abcde", 0, 2); - test("abcde", 0, 2, "abcde", 1, 1); - test("abcde", 0, 2, "abcde", 2, 0); - test("abcde", 0, 2, "abcde", 4, -2); - test("abcde", 0, 2, "abcde", 5, -3); - test("abcde", 0, 2, "abcdefghij", 0, 2); - test("abcde", 0, 2, "abcdefghij", 1, 1); - test("abcde", 0, 2, "abcdefghij", 5, -3); - test("abcde", 0, 2, "abcdefghij", 9, -7); - test("abcde", 0, 2, "abcdefghij", 10, -8); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, -8); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, -17); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, -18); - test("abcde", 0, 4, "", 0, 4); - test("abcde", 0, 4, "abcde", 0, 4); - test("abcde", 0, 4, "abcde", 1, 3); - test("abcde", 0, 4, "abcde", 2, 2); -} - - -void test1() -{ - test("abcde", 0, 4, "abcde", 4, 0); - test("abcde", 0, 4, "abcde", 5, -1); - test("abcde", 0, 4, "abcdefghij", 0, 4); - test("abcde", 0, 4, "abcdefghij", 1, 3); - test("abcde", 0, 4, "abcdefghij", 5, -1); - test("abcde", 0, 4, "abcdefghij", 9, -5); - test("abcde", 0, 4, "abcdefghij", 10, -6); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 3); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, -6); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, -15); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, -16); - test("abcde", 0, 5, "", 0, 5); - test("abcde", 0, 5, "abcde", 0, 5); - test("abcde", 0, 5, "abcde", 1, 4); - test("abcde", 0, 5, "abcde", 2, 3); - test("abcde", 0, 5, "abcde", 4, 1); - test("abcde", 0, 5, "abcde", 5, 0); - test("abcde", 0, 5, "abcdefghij", 0, 5); - test("abcde", 0, 5, "abcdefghij", 1, 4); - test("abcde", 0, 5, "abcdefghij", 5, 0); - test("abcde", 0, 5, "abcdefghij", 9, -4); - test("abcde", 0, 5, "abcdefghij", 10, -5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 4); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, -5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, -14); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, -15); - test("abcde", 0, 6, "", 0, 5); - test("abcde", 0, 6, "abcde", 0, 5); - test("abcde", 0, 6, "abcde", 1, 4); - test("abcde", 0, 6, "abcde", 2, 3); - test("abcde", 0, 6, "abcde", 4, 1); - test("abcde", 0, 6, "abcde", 5, 0); - test("abcde", 0, 6, "abcdefghij", 0, 5); - test("abcde", 0, 6, "abcdefghij", 1, 4); - test("abcde", 0, 6, "abcdefghij", 5, 0); - test("abcde", 0, 6, "abcdefghij", 9, -4); - test("abcde", 0, 6, "abcdefghij", 10, -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 4); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, -14); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, -15); - test("abcde", 1, 0, "", 0, 0); - test("abcde", 1, 0, "abcde", 0, 0); - test("abcde", 1, 0, "abcde", 1, -1); - test("abcde", 1, 0, "abcde", 2, -2); - test("abcde", 1, 0, "abcde", 4, -4); - test("abcde", 1, 0, "abcde", 5, -5); - test("abcde", 1, 0, "abcdefghij", 0, 0); - test("abcde", 1, 0, "abcdefghij", 1, -1); - test("abcde", 1, 0, "abcdefghij", 5, -5); - test("abcde", 1, 0, "abcdefghij", 9, -9); - test("abcde", 1, 0, "abcdefghij", 10, -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcde", 1, 1, "", 0, 1); - test("abcde", 1, 1, "abcde", 0, 1); - test("abcde", 1, 1, "abcde", 1, 1); - test("abcde", 1, 1, "abcde", 2, 1); - test("abcde", 1, 1, "abcde", 4, 1); - test("abcde", 1, 1, "abcde", 5, 1); - test("abcde", 1, 1, "abcdefghij", 0, 1); - test("abcde", 1, 1, "abcdefghij", 1, 1); - test("abcde", 1, 1, "abcdefghij", 5, 1); - test("abcde", 1, 1, "abcdefghij", 9, 1); - test("abcde", 1, 1, "abcdefghij", 10, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1); - test("abcde", 1, 2, "", 0, 2); - test("abcde", 1, 2, "abcde", 0, 2); - test("abcde", 1, 2, "abcde", 1, 1); - test("abcde", 1, 2, "abcde", 2, 1); - test("abcde", 1, 2, "abcde", 4, 1); - test("abcde", 1, 2, "abcde", 5, 1); - test("abcde", 1, 2, "abcdefghij", 0, 2); - test("abcde", 1, 2, "abcdefghij", 1, 1); - test("abcde", 1, 2, "abcdefghij", 5, 1); - test("abcde", 1, 2, "abcdefghij", 9, 1); - test("abcde", 1, 2, "abcdefghij", 10, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1); - test("abcde", 1, 3, "", 0, 3); - test("abcde", 1, 3, "abcde", 0, 3); - test("abcde", 1, 3, "abcde", 1, 1); - test("abcde", 1, 3, "abcde", 2, 1); - test("abcde", 1, 3, "abcde", 4, 1); - test("abcde", 1, 3, "abcde", 5, 1); - test("abcde", 1, 3, "abcdefghij", 0, 3); - test("abcde", 1, 3, "abcdefghij", 1, 1); -} - - -void test2() -{ - test("abcde", 1, 3, "abcdefghij", 5, 1); - test("abcde", 1, 3, "abcdefghij", 9, 1); - test("abcde", 1, 3, "abcdefghij", 10, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1); - test("abcde", 1, 4, "", 0, 4); - test("abcde", 1, 4, "abcde", 0, 4); - test("abcde", 1, 4, "abcde", 1, 1); - test("abcde", 1, 4, "abcde", 2, 1); - test("abcde", 1, 4, "abcde", 4, 1); - test("abcde", 1, 4, "abcde", 5, 1); - test("abcde", 1, 4, "abcdefghij", 0, 4); - test("abcde", 1, 4, "abcdefghij", 1, 1); - test("abcde", 1, 4, "abcdefghij", 5, 1); - test("abcde", 1, 4, "abcdefghij", 9, 1); - test("abcde", 1, 4, "abcdefghij", 10, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1); - test("abcde", 1, 5, "", 0, 4); - test("abcde", 1, 5, "abcde", 0, 4); - test("abcde", 1, 5, "abcde", 1, 1); - test("abcde", 1, 5, "abcde", 2, 1); - test("abcde", 1, 5, "abcde", 4, 1); - test("abcde", 1, 5, "abcde", 5, 1); - test("abcde", 1, 5, "abcdefghij", 0, 4); - test("abcde", 1, 5, "abcdefghij", 1, 1); - test("abcde", 1, 5, "abcdefghij", 5, 1); - test("abcde", 1, 5, "abcdefghij", 9, 1); - test("abcde", 1, 5, "abcdefghij", 10, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1); - test("abcde", 2, 0, "", 0, 0); - test("abcde", 2, 0, "abcde", 0, 0); - test("abcde", 2, 0, "abcde", 1, -1); - test("abcde", 2, 0, "abcde", 2, -2); - test("abcde", 2, 0, "abcde", 4, -4); - test("abcde", 2, 0, "abcde", 5, -5); - test("abcde", 2, 0, "abcdefghij", 0, 0); - test("abcde", 2, 0, "abcdefghij", 1, -1); - test("abcde", 2, 0, "abcdefghij", 5, -5); - test("abcde", 2, 0, "abcdefghij", 9, -9); - test("abcde", 2, 0, "abcdefghij", 10, -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcde", 2, 1, "", 0, 1); - test("abcde", 2, 1, "abcde", 0, 1); - test("abcde", 2, 1, "abcde", 1, 2); - test("abcde", 2, 1, "abcde", 2, 2); - test("abcde", 2, 1, "abcde", 4, 2); - test("abcde", 2, 1, "abcde", 5, 2); - test("abcde", 2, 1, "abcdefghij", 0, 1); - test("abcde", 2, 1, "abcdefghij", 1, 2); - test("abcde", 2, 1, "abcdefghij", 5, 2); - test("abcde", 2, 1, "abcdefghij", 9, 2); - test("abcde", 2, 1, "abcdefghij", 10, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 2); - test("abcde", 2, 2, "", 0, 2); - test("abcde", 2, 2, "abcde", 0, 2); - test("abcde", 2, 2, "abcde", 1, 2); - test("abcde", 2, 2, "abcde", 2, 2); - test("abcde", 2, 2, "abcde", 4, 2); - test("abcde", 2, 2, "abcde", 5, 2); - test("abcde", 2, 2, "abcdefghij", 0, 2); - test("abcde", 2, 2, "abcdefghij", 1, 2); - test("abcde", 2, 2, "abcdefghij", 5, 2); - test("abcde", 2, 2, "abcdefghij", 9, 2); - test("abcde", 2, 2, "abcdefghij", 10, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 2); - test("abcde", 2, 3, "", 0, 3); - test("abcde", 2, 3, "abcde", 0, 3); - test("abcde", 2, 3, "abcde", 1, 2); - test("abcde", 2, 3, "abcde", 2, 2); - test("abcde", 2, 3, "abcde", 4, 2); - test("abcde", 2, 3, "abcde", 5, 2); - test("abcde", 2, 3, "abcdefghij", 0, 3); - test("abcde", 2, 3, "abcdefghij", 1, 2); - test("abcde", 2, 3, "abcdefghij", 5, 2); - test("abcde", 2, 3, "abcdefghij", 9, 2); - test("abcde", 2, 3, "abcdefghij", 10, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 3); -} - - -void test3() -{ - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 2); - test("abcde", 2, 4, "", 0, 3); - test("abcde", 2, 4, "abcde", 0, 3); - test("abcde", 2, 4, "abcde", 1, 2); - test("abcde", 2, 4, "abcde", 2, 2); - test("abcde", 2, 4, "abcde", 4, 2); - test("abcde", 2, 4, "abcde", 5, 2); - test("abcde", 2, 4, "abcdefghij", 0, 3); - test("abcde", 2, 4, "abcdefghij", 1, 2); - test("abcde", 2, 4, "abcdefghij", 5, 2); - test("abcde", 2, 4, "abcdefghij", 9, 2); - test("abcde", 2, 4, "abcdefghij", 10, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 2); - test("abcde", 4, 0, "", 0, 0); - test("abcde", 4, 0, "abcde", 0, 0); - test("abcde", 4, 0, "abcde", 1, -1); - test("abcde", 4, 0, "abcde", 2, -2); - test("abcde", 4, 0, "abcde", 4, -4); - test("abcde", 4, 0, "abcde", 5, -5); - test("abcde", 4, 0, "abcdefghij", 0, 0); - test("abcde", 4, 0, "abcdefghij", 1, -1); - test("abcde", 4, 0, "abcdefghij", 5, -5); - test("abcde", 4, 0, "abcdefghij", 9, -9); - test("abcde", 4, 0, "abcdefghij", 10, -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcde", 4, 1, "", 0, 1); - test("abcde", 4, 1, "abcde", 0, 1); - test("abcde", 4, 1, "abcde", 1, 4); - test("abcde", 4, 1, "abcde", 2, 4); - test("abcde", 4, 1, "abcde", 4, 4); - test("abcde", 4, 1, "abcde", 5, 4); - test("abcde", 4, 1, "abcdefghij", 0, 1); - test("abcde", 4, 1, "abcdefghij", 1, 4); - test("abcde", 4, 1, "abcdefghij", 5, 4); - test("abcde", 4, 1, "abcdefghij", 9, 4); - test("abcde", 4, 1, "abcdefghij", 10, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 4); - test("abcde", 4, 2, "", 0, 1); - test("abcde", 4, 2, "abcde", 0, 1); - test("abcde", 4, 2, "abcde", 1, 4); - test("abcde", 4, 2, "abcde", 2, 4); - test("abcde", 4, 2, "abcde", 4, 4); - test("abcde", 4, 2, "abcde", 5, 4); - test("abcde", 4, 2, "abcdefghij", 0, 1); - test("abcde", 4, 2, "abcdefghij", 1, 4); - test("abcde", 4, 2, "abcdefghij", 5, 4); - test("abcde", 4, 2, "abcdefghij", 9, 4); - test("abcde", 4, 2, "abcdefghij", 10, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 4); - test("abcde", 5, 0, "", 0, 0); - test("abcde", 5, 0, "abcde", 0, 0); - test("abcde", 5, 0, "abcde", 1, -1); - test("abcde", 5, 0, "abcde", 2, -2); - test("abcde", 5, 0, "abcde", 4, -4); - test("abcde", 5, 0, "abcde", 5, -5); - test("abcde", 5, 0, "abcdefghij", 0, 0); - test("abcde", 5, 0, "abcdefghij", 1, -1); - test("abcde", 5, 0, "abcdefghij", 5, -5); - test("abcde", 5, 0, "abcdefghij", 9, -9); - test("abcde", 5, 0, "abcdefghij", 10, -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcde", 5, 1, "", 0, 0); - test("abcde", 5, 1, "abcde", 0, 0); - test("abcde", 5, 1, "abcde", 1, -1); - test("abcde", 5, 1, "abcde", 2, -2); - test("abcde", 5, 1, "abcde", 4, -4); - test("abcde", 5, 1, "abcde", 5, -5); - test("abcde", 5, 1, "abcdefghij", 0, 0); - test("abcde", 5, 1, "abcdefghij", 1, -1); - test("abcde", 5, 1, "abcdefghij", 5, -5); - test("abcde", 5, 1, "abcdefghij", 9, -9); - test("abcde", 5, 1, "abcdefghij", 10, -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, -19); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, -20); -} - - -void test4() -{ - test("abcde", 6, 0, "", 0, 0); - test("abcde", 6, 0, "abcde", 0, 0); - test("abcde", 6, 0, "abcde", 1, 0); - test("abcde", 6, 0, "abcde", 2, 0); - test("abcde", 6, 0, "abcde", 4, 0); - test("abcde", 6, 0, "abcde", 5, 0); - test("abcde", 6, 0, "abcdefghij", 0, 0); - test("abcde", 6, 0, "abcdefghij", 1, 0); - test("abcde", 6, 0, "abcdefghij", 5, 0); - test("abcde", 6, 0, "abcdefghij", 9, 0); - test("abcde", 6, 0, "abcdefghij", 10, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0); - test("abcdefghij", 0, 0, "", 0, 0); - test("abcdefghij", 0, 0, "abcde", 0, 0); - test("abcdefghij", 0, 0, "abcde", 1, -1); - test("abcdefghij", 0, 0, "abcde", 2, -2); - test("abcdefghij", 0, 0, "abcde", 4, -4); - test("abcdefghij", 0, 0, "abcde", 5, -5); - test("abcdefghij", 0, 0, "abcdefghij", 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 1, -1); - test("abcdefghij", 0, 0, "abcdefghij", 5, -5); - test("abcdefghij", 0, 0, "abcdefghij", 9, -9); - test("abcdefghij", 0, 0, "abcdefghij", 10, -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 0, 1, "", 0, 1); - test("abcdefghij", 0, 1, "abcde", 0, 1); - test("abcdefghij", 0, 1, "abcde", 1, 0); - test("abcdefghij", 0, 1, "abcde", 2, -1); - test("abcdefghij", 0, 1, "abcde", 4, -3); - test("abcdefghij", 0, 1, "abcde", 5, -4); - test("abcdefghij", 0, 1, "abcdefghij", 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 0); - test("abcdefghij", 0, 1, "abcdefghij", 5, -4); - test("abcdefghij", 0, 1, "abcdefghij", 9, -8); - test("abcdefghij", 0, 1, "abcdefghij", 10, -9); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, -9); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, -18); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, -19); - test("abcdefghij", 0, 5, "", 0, 5); - test("abcdefghij", 0, 5, "abcde", 0, 5); - test("abcdefghij", 0, 5, "abcde", 1, 4); - test("abcdefghij", 0, 5, "abcde", 2, 3); - test("abcdefghij", 0, 5, "abcde", 4, 1); - test("abcdefghij", 0, 5, "abcde", 5, 0); - test("abcdefghij", 0, 5, "abcdefghij", 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 1, 4); - test("abcdefghij", 0, 5, "abcdefghij", 5, 0); - test("abcdefghij", 0, 5, "abcdefghij", 9, -4); - test("abcdefghij", 0, 5, "abcdefghij", 10, -5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 4); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, -5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, -14); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, -15); - test("abcdefghij", 0, 9, "", 0, 9); - test("abcdefghij", 0, 9, "abcde", 0, 9); - test("abcdefghij", 0, 9, "abcde", 1, 8); - test("abcdefghij", 0, 9, "abcde", 2, 7); - test("abcdefghij", 0, 9, "abcde", 4, 5); - test("abcdefghij", 0, 9, "abcde", 5, 4); - test("abcdefghij", 0, 9, "abcdefghij", 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 1, 8); - test("abcdefghij", 0, 9, "abcdefghij", 5, 4); - test("abcdefghij", 0, 9, "abcdefghij", 9, 0); - test("abcdefghij", 0, 9, "abcdefghij", 10, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 8); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, -11); - test("abcdefghij", 0, 10, "", 0, 10); - test("abcdefghij", 0, 10, "abcde", 0, 10); - test("abcdefghij", 0, 10, "abcde", 1, 9); - test("abcdefghij", 0, 10, "abcde", 2, 8); - test("abcdefghij", 0, 10, "abcde", 4, 6); - test("abcdefghij", 0, 10, "abcde", 5, 5); - test("abcdefghij", 0, 10, "abcdefghij", 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 1, 9); - test("abcdefghij", 0, 10, "abcdefghij", 5, 5); - test("abcdefghij", 0, 10, "abcdefghij", 9, 1); - test("abcdefghij", 0, 10, "abcdefghij", 10, 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, -9); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, -10); - test("abcdefghij", 0, 11, "", 0, 10); - test("abcdefghij", 0, 11, "abcde", 0, 10); - test("abcdefghij", 0, 11, "abcde", 1, 9); - test("abcdefghij", 0, 11, "abcde", 2, 8); -} - - -void test5() -{ - test("abcdefghij", 0, 11, "abcde", 4, 6); - test("abcdefghij", 0, 11, "abcde", 5, 5); - test("abcdefghij", 0, 11, "abcdefghij", 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 1, 9); - test("abcdefghij", 0, 11, "abcdefghij", 5, 5); - test("abcdefghij", 0, 11, "abcdefghij", 9, 1); - test("abcdefghij", 0, 11, "abcdefghij", 10, 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, -9); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, -10); - test("abcdefghij", 1, 0, "", 0, 0); - test("abcdefghij", 1, 0, "abcde", 0, 0); - test("abcdefghij", 1, 0, "abcde", 1, -1); - test("abcdefghij", 1, 0, "abcde", 2, -2); - test("abcdefghij", 1, 0, "abcde", 4, -4); - test("abcdefghij", 1, 0, "abcde", 5, -5); - test("abcdefghij", 1, 0, "abcdefghij", 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 1, -1); - test("abcdefghij", 1, 0, "abcdefghij", 5, -5); - test("abcdefghij", 1, 0, "abcdefghij", 9, -9); - test("abcdefghij", 1, 0, "abcdefghij", 10, -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 1, 1, "", 0, 1); - test("abcdefghij", 1, 1, "abcde", 0, 1); - test("abcdefghij", 1, 1, "abcde", 1, 1); - test("abcdefghij", 1, 1, "abcde", 2, 1); - test("abcdefghij", 1, 1, "abcde", 4, 1); - test("abcdefghij", 1, 1, "abcde", 5, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 1, 1); - test("abcdefghij", 1, 1, "abcdefghij", 5, 1); - test("abcdefghij", 1, 1, "abcdefghij", 9, 1); - test("abcdefghij", 1, 1, "abcdefghij", 10, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghij", 1, 4, "", 0, 4); - test("abcdefghij", 1, 4, "abcde", 0, 4); - test("abcdefghij", 1, 4, "abcde", 1, 1); - test("abcdefghij", 1, 4, "abcde", 2, 1); - test("abcdefghij", 1, 4, "abcde", 4, 1); - test("abcdefghij", 1, 4, "abcde", 5, 1); - test("abcdefghij", 1, 4, "abcdefghij", 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 1, 1); - test("abcdefghij", 1, 4, "abcdefghij", 5, 1); - test("abcdefghij", 1, 4, "abcdefghij", 9, 1); - test("abcdefghij", 1, 4, "abcdefghij", 10, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghij", 1, 8, "", 0, 8); - test("abcdefghij", 1, 8, "abcde", 0, 8); - test("abcdefghij", 1, 8, "abcde", 1, 1); - test("abcdefghij", 1, 8, "abcde", 2, 1); - test("abcdefghij", 1, 8, "abcde", 4, 1); - test("abcdefghij", 1, 8, "abcde", 5, 1); - test("abcdefghij", 1, 8, "abcdefghij", 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 1, 1); - test("abcdefghij", 1, 8, "abcdefghij", 5, 1); - test("abcdefghij", 1, 8, "abcdefghij", 9, 1); - test("abcdefghij", 1, 8, "abcdefghij", 10, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghij", 1, 9, "", 0, 9); - test("abcdefghij", 1, 9, "abcde", 0, 9); - test("abcdefghij", 1, 9, "abcde", 1, 1); - test("abcdefghij", 1, 9, "abcde", 2, 1); - test("abcdefghij", 1, 9, "abcde", 4, 1); - test("abcdefghij", 1, 9, "abcde", 5, 1); - test("abcdefghij", 1, 9, "abcdefghij", 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 1, 1); - test("abcdefghij", 1, 9, "abcdefghij", 5, 1); - test("abcdefghij", 1, 9, "abcdefghij", 9, 1); - test("abcdefghij", 1, 9, "abcdefghij", 10, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghij", 1, 10, "", 0, 9); - test("abcdefghij", 1, 10, "abcde", 0, 9); - test("abcdefghij", 1, 10, "abcde", 1, 1); - test("abcdefghij", 1, 10, "abcde", 2, 1); - test("abcdefghij", 1, 10, "abcde", 4, 1); - test("abcdefghij", 1, 10, "abcde", 5, 1); - test("abcdefghij", 1, 10, "abcdefghij", 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 1, 1); -} - - -void test6() -{ - test("abcdefghij", 1, 10, "abcdefghij", 5, 1); - test("abcdefghij", 1, 10, "abcdefghij", 9, 1); - test("abcdefghij", 1, 10, "abcdefghij", 10, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghij", 5, 0, "", 0, 0); - test("abcdefghij", 5, 0, "abcde", 0, 0); - test("abcdefghij", 5, 0, "abcde", 1, -1); - test("abcdefghij", 5, 0, "abcde", 2, -2); - test("abcdefghij", 5, 0, "abcde", 4, -4); - test("abcdefghij", 5, 0, "abcde", 5, -5); - test("abcdefghij", 5, 0, "abcdefghij", 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 1, -1); - test("abcdefghij", 5, 0, "abcdefghij", 5, -5); - test("abcdefghij", 5, 0, "abcdefghij", 9, -9); - test("abcdefghij", 5, 0, "abcdefghij", 10, -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 5, 1, "", 0, 1); - test("abcdefghij", 5, 1, "abcde", 0, 1); - test("abcdefghij", 5, 1, "abcde", 1, 5); - test("abcdefghij", 5, 1, "abcde", 2, 5); - test("abcdefghij", 5, 1, "abcde", 4, 5); - test("abcdefghij", 5, 1, "abcde", 5, 5); - test("abcdefghij", 5, 1, "abcdefghij", 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 1, 5); - test("abcdefghij", 5, 1, "abcdefghij", 5, 5); - test("abcdefghij", 5, 1, "abcdefghij", 9, 5); - test("abcdefghij", 5, 1, "abcdefghij", 10, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 5); - test("abcdefghij", 5, 2, "", 0, 2); - test("abcdefghij", 5, 2, "abcde", 0, 2); - test("abcdefghij", 5, 2, "abcde", 1, 5); - test("abcdefghij", 5, 2, "abcde", 2, 5); - test("abcdefghij", 5, 2, "abcde", 4, 5); - test("abcdefghij", 5, 2, "abcde", 5, 5); - test("abcdefghij", 5, 2, "abcdefghij", 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 1, 5); - test("abcdefghij", 5, 2, "abcdefghij", 5, 5); - test("abcdefghij", 5, 2, "abcdefghij", 9, 5); - test("abcdefghij", 5, 2, "abcdefghij", 10, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 5); - test("abcdefghij", 5, 4, "", 0, 4); - test("abcdefghij", 5, 4, "abcde", 0, 4); - test("abcdefghij", 5, 4, "abcde", 1, 5); - test("abcdefghij", 5, 4, "abcde", 2, 5); - test("abcdefghij", 5, 4, "abcde", 4, 5); - test("abcdefghij", 5, 4, "abcde", 5, 5); - test("abcdefghij", 5, 4, "abcdefghij", 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 5); - test("abcdefghij", 5, 4, "abcdefghij", 5, 5); - test("abcdefghij", 5, 4, "abcdefghij", 9, 5); - test("abcdefghij", 5, 4, "abcdefghij", 10, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 5); - test("abcdefghij", 5, 5, "", 0, 5); - test("abcdefghij", 5, 5, "abcde", 0, 5); - test("abcdefghij", 5, 5, "abcde", 1, 5); - test("abcdefghij", 5, 5, "abcde", 2, 5); - test("abcdefghij", 5, 5, "abcde", 4, 5); - test("abcdefghij", 5, 5, "abcde", 5, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 1, 5); - test("abcdefghij", 5, 5, "abcdefghij", 5, 5); - test("abcdefghij", 5, 5, "abcdefghij", 9, 5); - test("abcdefghij", 5, 5, "abcdefghij", 10, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 5); - test("abcdefghij", 5, 6, "", 0, 5); - test("abcdefghij", 5, 6, "abcde", 0, 5); - test("abcdefghij", 5, 6, "abcde", 1, 5); - test("abcdefghij", 5, 6, "abcde", 2, 5); - test("abcdefghij", 5, 6, "abcde", 4, 5); - test("abcdefghij", 5, 6, "abcde", 5, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 1, 5); - test("abcdefghij", 5, 6, "abcdefghij", 5, 5); - test("abcdefghij", 5, 6, "abcdefghij", 9, 5); - test("abcdefghij", 5, 6, "abcdefghij", 10, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 5); -} - - -void test7() -{ - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 5); - test("abcdefghij", 9, 0, "", 0, 0); - test("abcdefghij", 9, 0, "abcde", 0, 0); - test("abcdefghij", 9, 0, "abcde", 1, -1); - test("abcdefghij", 9, 0, "abcde", 2, -2); - test("abcdefghij", 9, 0, "abcde", 4, -4); - test("abcdefghij", 9, 0, "abcde", 5, -5); - test("abcdefghij", 9, 0, "abcdefghij", 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 1, -1); - test("abcdefghij", 9, 0, "abcdefghij", 5, -5); - test("abcdefghij", 9, 0, "abcdefghij", 9, -9); - test("abcdefghij", 9, 0, "abcdefghij", 10, -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 9, 1, "", 0, 1); - test("abcdefghij", 9, 1, "abcde", 0, 1); - test("abcdefghij", 9, 1, "abcde", 1, 9); - test("abcdefghij", 9, 1, "abcde", 2, 9); - test("abcdefghij", 9, 1, "abcde", 4, 9); - test("abcdefghij", 9, 1, "abcde", 5, 9); - test("abcdefghij", 9, 1, "abcdefghij", 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 1, 9); - test("abcdefghij", 9, 1, "abcdefghij", 5, 9); - test("abcdefghij", 9, 1, "abcdefghij", 9, 9); - test("abcdefghij", 9, 1, "abcdefghij", 10, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 9); - test("abcdefghij", 9, 2, "", 0, 1); - test("abcdefghij", 9, 2, "abcde", 0, 1); - test("abcdefghij", 9, 2, "abcde", 1, 9); - test("abcdefghij", 9, 2, "abcde", 2, 9); - test("abcdefghij", 9, 2, "abcde", 4, 9); - test("abcdefghij", 9, 2, "abcde", 5, 9); - test("abcdefghij", 9, 2, "abcdefghij", 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 1, 9); - test("abcdefghij", 9, 2, "abcdefghij", 5, 9); - test("abcdefghij", 9, 2, "abcdefghij", 9, 9); - test("abcdefghij", 9, 2, "abcdefghij", 10, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 9); - test("abcdefghij", 10, 0, "", 0, 0); - test("abcdefghij", 10, 0, "abcde", 0, 0); - test("abcdefghij", 10, 0, "abcde", 1, -1); - test("abcdefghij", 10, 0, "abcde", 2, -2); - test("abcdefghij", 10, 0, "abcde", 4, -4); - test("abcdefghij", 10, 0, "abcde", 5, -5); - test("abcdefghij", 10, 0, "abcdefghij", 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 1, -1); - test("abcdefghij", 10, 0, "abcdefghij", 5, -5); - test("abcdefghij", 10, 0, "abcdefghij", 9, -9); - test("abcdefghij", 10, 0, "abcdefghij", 10, -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 10, 1, "", 0, 0); - test("abcdefghij", 10, 1, "abcde", 0, 0); - test("abcdefghij", 10, 1, "abcde", 1, -1); - test("abcdefghij", 10, 1, "abcde", 2, -2); - test("abcdefghij", 10, 1, "abcde", 4, -4); - test("abcdefghij", 10, 1, "abcde", 5, -5); - test("abcdefghij", 10, 1, "abcdefghij", 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 1, -1); - test("abcdefghij", 10, 1, "abcdefghij", 5, -5); - test("abcdefghij", 10, 1, "abcdefghij", 9, -9); - test("abcdefghij", 10, 1, "abcdefghij", 10, -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghij", 11, 0, "", 0, 0); - test("abcdefghij", 11, 0, "abcde", 0, 0); - test("abcdefghij", 11, 0, "abcde", 1, 0); - test("abcdefghij", 11, 0, "abcde", 2, 0); - test("abcdefghij", 11, 0, "abcde", 4, 0); - test("abcdefghij", 11, 0, "abcde", 5, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 0); - test("abcdefghij", 11, 0, "abcdefghij", 9, 0); - test("abcdefghij", 11, 0, "abcdefghij", 10, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0); -} - -void test8() -{ - test("abcdefghijklmnopqrst", 0, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, -2); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 0, 1, "", 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, -3); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, -8); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, -18); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, -19); - test("abcdefghijklmnopqrst", 0, 10, "", 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 9); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 8); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 6); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, -9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, -10); - test("abcdefghijklmnopqrst", 0, 19, "", 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 17); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 15); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 14); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 14); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, -1); - test("abcdefghijklmnopqrst", 0, 20, "", 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 18); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 16); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 15); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 15); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 11); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0); - test("abcdefghijklmnopqrst", 0, 21, "", 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 18); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 16); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 15); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 15); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 11); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0); - test("abcdefghijklmnopqrst", 1, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, -2); -} - - -void test9() -{ - test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 1, 1, "", 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghijklmnopqrst", 1, 9, "", 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghijklmnopqrst", 1, 18, "", 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghijklmnopqrst", 1, 19, "", 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghijklmnopqrst", 1, 20, "", 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1); - test("abcdefghijklmnopqrst", 10, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, -2); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, -1); -} - - -void test10() -{ - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 10, 1, "", 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 10); - test("abcdefghijklmnopqrst", 10, 5, "", 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 10); - test("abcdefghijklmnopqrst", 10, 9, "", 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 10); - test("abcdefghijklmnopqrst", 10, 10, "", 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 10); - test("abcdefghijklmnopqrst", 10, 11, "", 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 10); - test("abcdefghijklmnopqrst", 19, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, -2); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0); -} - - -void test11() -{ - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 19, 1, "", 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 19); - test("abcdefghijklmnopqrst", 19, 2, "", 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 19); - test("abcdefghijklmnopqrst", 20, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, -2); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 20, 1, "", 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, -2); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, -19); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, -20); - test("abcdefghijklmnopqrst", 21, 0, "", 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0); - } - - -int main () { - test0(); - test1(); - test2(); - test3(); - test4(); - test5(); - test6(); - test7(); - test8(); - test9(); - test10(); - test11(); - - { - test("", 0, 0, "abcde", 0, 0); - test("", 0, 0, "abcde", 1, -1); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, -10); - } - - { - test(L"", 0, 0, L"abcde", 0, 0); - test(L"", 0, 0, L"abcde", 1, -1); - test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 0, 0); - test(L"abcdefghijklmnopqrst", 21, 0, L"abcde", 1, 0); - test(L"abcdefghijklmnopqrst", 10, 0, L"abcdefghij", 10, -10); - } - -#if TEST_STD_VER >= 11 - { - test(U"", 0, 0, U"abcde", 0, 0); - test(U"", 0, 0, U"abcde", 1, -1); - test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0); - test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0); - test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10); - } - - { - test(U"", 0, 0, U"abcde", 0, 0); - test(U"", 0, 0, U"abcde", 1, -1); - test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 0, 0); - test(U"abcdefghijklmnopqrst", 21, 0, U"abcde", 1, 0); - test(U"abcdefghijklmnopqrst", 10, 0, U"abcdefghij", 10, -10); - } -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1; - constexpr SV sv2 { "abcdefghijklmnopqrst", 21 }; - static_assert ( sv1.compare(0, 0, "abcde", 0) == 0, "" ); - static_assert ( sv1.compare(0, 0, "abcde", 1) == -1, "" ); - static_assert ( sv2.compare(0, 0, "abcde", 1, 0) == 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp deleted file mode 100644 index 5d5ccc5b5d59f..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.size_size_sv_size_size.pass.cpp +++ /dev/null @@ -1,5849 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr int compare(size_type pos1, size_type n1, basic_string_view str, -// size_type pos2, size_type n2) const; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, size_t pos1, size_t n1, - std::experimental::basic_string_view<CharT> sv2, size_t pos2, size_t n2, - int expected ) { - - if (pos1 > sv1.size() || pos2 > sv2.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - sv1.compare(pos1, n1, sv2, pos2, n2); - assert(false); - } catch (const std::out_of_range&) { - } catch (...) { - assert(false); - } -#endif - } else { - assert (sign( sv1.compare(pos1, n1, sv2, pos2, n2)) == sign(expected)); - } -} - - -template<typename CharT> -void test ( const CharT *s1, size_t pos1, size_t n1, - const CharT *s2, size_t pos2, size_t n2, - int expected ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - - string_view_t sv1 ( s1 ); - string_view_t sv2 ( s2 ); - test1(sv1, pos1, n1, sv2, pos2, n2, expected); -} - -void test0() -{ - test("", 0, 0, "", 0, 0, 0); - test("", 0, 0, "", 0, 1, 0); - test("", 0, 0, "", 1, 0, 0); - test("", 0, 0, "abcde", 0, 0, 0); - test("", 0, 0, "abcde", 0, 1, -1); - test("", 0, 0, "abcde", 0, 2, -2); - test("", 0, 0, "abcde", 0, 4, -4); - test("", 0, 0, "abcde", 0, 5, -5); - test("", 0, 0, "abcde", 0, 6, -5); - test("", 0, 0, "abcde", 1, 0, 0); - test("", 0, 0, "abcde", 1, 1, -1); - test("", 0, 0, "abcde", 1, 2, -2); - test("", 0, 0, "abcde", 1, 3, -3); - test("", 0, 0, "abcde", 1, 4, -4); - test("", 0, 0, "abcde", 1, 5, -4); - test("", 0, 0, "abcde", 2, 0, 0); - test("", 0, 0, "abcde", 2, 1, -1); - test("", 0, 0, "abcde", 2, 2, -2); - test("", 0, 0, "abcde", 2, 3, -3); - test("", 0, 0, "abcde", 2, 4, -3); - test("", 0, 0, "abcde", 4, 0, 0); - test("", 0, 0, "abcde", 4, 1, -1); - test("", 0, 0, "abcde", 4, 2, -1); - test("", 0, 0, "abcde", 5, 0, 0); - test("", 0, 0, "abcde", 5, 1, 0); - test("", 0, 0, "abcde", 6, 0, 0); - test("", 0, 0, "abcdefghij", 0, 0, 0); - test("", 0, 0, "abcdefghij", 0, 1, -1); - test("", 0, 0, "abcdefghij", 0, 5, -5); - test("", 0, 0, "abcdefghij", 0, 9, -9); - test("", 0, 0, "abcdefghij", 0, 10, -10); - test("", 0, 0, "abcdefghij", 0, 11, -10); - test("", 0, 0, "abcdefghij", 1, 0, 0); - test("", 0, 0, "abcdefghij", 1, 1, -1); - test("", 0, 0, "abcdefghij", 1, 4, -4); - test("", 0, 0, "abcdefghij", 1, 8, -8); - test("", 0, 0, "abcdefghij", 1, 9, -9); - test("", 0, 0, "abcdefghij", 1, 10, -9); - test("", 0, 0, "abcdefghij", 5, 0, 0); - test("", 0, 0, "abcdefghij", 5, 1, -1); - test("", 0, 0, "abcdefghij", 5, 2, -2); - test("", 0, 0, "abcdefghij", 5, 4, -4); - test("", 0, 0, "abcdefghij", 5, 5, -5); - test("", 0, 0, "abcdefghij", 5, 6, -5); - test("", 0, 0, "abcdefghij", 9, 0, 0); - test("", 0, 0, "abcdefghij", 9, 1, -1); - test("", 0, 0, "abcdefghij", 9, 2, -1); - test("", 0, 0, "abcdefghij", 10, 0, 0); - test("", 0, 0, "abcdefghij", 10, 1, 0); - test("", 0, 0, "abcdefghij", 11, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("", 0, 1, "", 0, 0, 0); - test("", 0, 1, "", 0, 1, 0); - test("", 0, 1, "", 1, 0, 0); - test("", 0, 1, "abcde", 0, 0, 0); - test("", 0, 1, "abcde", 0, 1, -1); - test("", 0, 1, "abcde", 0, 2, -2); - test("", 0, 1, "abcde", 0, 4, -4); - test("", 0, 1, "abcde", 0, 5, -5); - test("", 0, 1, "abcde", 0, 6, -5); - test("", 0, 1, "abcde", 1, 0, 0); - test("", 0, 1, "abcde", 1, 1, -1); - test("", 0, 1, "abcde", 1, 2, -2); - test("", 0, 1, "abcde", 1, 3, -3); - test("", 0, 1, "abcde", 1, 4, -4); - test("", 0, 1, "abcde", 1, 5, -4); - test("", 0, 1, "abcde", 2, 0, 0); - test("", 0, 1, "abcde", 2, 1, -1); - test("", 0, 1, "abcde", 2, 2, -2); - test("", 0, 1, "abcde", 2, 3, -3); - test("", 0, 1, "abcde", 2, 4, -3); - test("", 0, 1, "abcde", 4, 0, 0); - test("", 0, 1, "abcde", 4, 1, -1); - test("", 0, 1, "abcde", 4, 2, -1); - test("", 0, 1, "abcde", 5, 0, 0); - test("", 0, 1, "abcde", 5, 1, 0); - test("", 0, 1, "abcde", 6, 0, 0); -} - -void test1() -{ - test("", 0, 1, "abcdefghij", 0, 0, 0); - test("", 0, 1, "abcdefghij", 0, 1, -1); - test("", 0, 1, "abcdefghij", 0, 5, -5); - test("", 0, 1, "abcdefghij", 0, 9, -9); - test("", 0, 1, "abcdefghij", 0, 10, -10); - test("", 0, 1, "abcdefghij", 0, 11, -10); - test("", 0, 1, "abcdefghij", 1, 0, 0); - test("", 0, 1, "abcdefghij", 1, 1, -1); - test("", 0, 1, "abcdefghij", 1, 4, -4); - test("", 0, 1, "abcdefghij", 1, 8, -8); - test("", 0, 1, "abcdefghij", 1, 9, -9); - test("", 0, 1, "abcdefghij", 1, 10, -9); - test("", 0, 1, "abcdefghij", 5, 0, 0); - test("", 0, 1, "abcdefghij", 5, 1, -1); - test("", 0, 1, "abcdefghij", 5, 2, -2); - test("", 0, 1, "abcdefghij", 5, 4, -4); - test("", 0, 1, "abcdefghij", 5, 5, -5); - test("", 0, 1, "abcdefghij", 5, 6, -5); - test("", 0, 1, "abcdefghij", 9, 0, 0); - test("", 0, 1, "abcdefghij", 9, 1, -1); - test("", 0, 1, "abcdefghij", 9, 2, -1); - test("", 0, 1, "abcdefghij", 10, 0, 0); - test("", 0, 1, "abcdefghij", 10, 1, 0); - test("", 0, 1, "abcdefghij", 11, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 1, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 10, -10); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 19, -19); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 20, -20); - test("", 0, 1, "abcdefghijklmnopqrst", 0, 21, -20); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 9, -9); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 18, -18); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 19, -19); - test("", 0, 1, "abcdefghijklmnopqrst", 1, 20, -19); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 1, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 5, -5); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("", 0, 1, "abcdefghijklmnopqrst", 19, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 19, 1, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 19, 2, -1); - test("", 0, 1, "abcdefghijklmnopqrst", 20, 0, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 20, 1, 0); - test("", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("", 1, 0, "", 0, 0, 0); - test("", 1, 0, "", 0, 1, 0); - test("", 1, 0, "", 1, 0, 0); - test("", 1, 0, "abcde", 0, 0, 0); - test("", 1, 0, "abcde", 0, 1, 0); - test("", 1, 0, "abcde", 0, 2, 0); - test("", 1, 0, "abcde", 0, 4, 0); - test("", 1, 0, "abcde", 0, 5, 0); - test("", 1, 0, "abcde", 0, 6, 0); - test("", 1, 0, "abcde", 1, 0, 0); - test("", 1, 0, "abcde", 1, 1, 0); - test("", 1, 0, "abcde", 1, 2, 0); - test("", 1, 0, "abcde", 1, 3, 0); - test("", 1, 0, "abcde", 1, 4, 0); - test("", 1, 0, "abcde", 1, 5, 0); - test("", 1, 0, "abcde", 2, 0, 0); - test("", 1, 0, "abcde", 2, 1, 0); - test("", 1, 0, "abcde", 2, 2, 0); - test("", 1, 0, "abcde", 2, 3, 0); - test("", 1, 0, "abcde", 2, 4, 0); - test("", 1, 0, "abcde", 4, 0, 0); - test("", 1, 0, "abcde", 4, 1, 0); - test("", 1, 0, "abcde", 4, 2, 0); - test("", 1, 0, "abcde", 5, 0, 0); - test("", 1, 0, "abcde", 5, 1, 0); - test("", 1, 0, "abcde", 6, 0, 0); - test("", 1, 0, "abcdefghij", 0, 0, 0); - test("", 1, 0, "abcdefghij", 0, 1, 0); - test("", 1, 0, "abcdefghij", 0, 5, 0); - test("", 1, 0, "abcdefghij", 0, 9, 0); - test("", 1, 0, "abcdefghij", 0, 10, 0); - test("", 1, 0, "abcdefghij", 0, 11, 0); - test("", 1, 0, "abcdefghij", 1, 0, 0); - test("", 1, 0, "abcdefghij", 1, 1, 0); - test("", 1, 0, "abcdefghij", 1, 4, 0); - test("", 1, 0, "abcdefghij", 1, 8, 0); - test("", 1, 0, "abcdefghij", 1, 9, 0); - test("", 1, 0, "abcdefghij", 1, 10, 0); - test("", 1, 0, "abcdefghij", 5, 0, 0); - test("", 1, 0, "abcdefghij", 5, 1, 0); - test("", 1, 0, "abcdefghij", 5, 2, 0); - test("", 1, 0, "abcdefghij", 5, 4, 0); - test("", 1, 0, "abcdefghij", 5, 5, 0); - test("", 1, 0, "abcdefghij", 5, 6, 0); - test("", 1, 0, "abcdefghij", 9, 0, 0); - test("", 1, 0, "abcdefghij", 9, 1, 0); - test("", 1, 0, "abcdefghij", 9, 2, 0); - test("", 1, 0, "abcdefghij", 10, 0, 0); - test("", 1, 0, "abcdefghij", 10, 1, 0); - test("", 1, 0, "abcdefghij", 11, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 1, 0); -} - -void test2() -{ - test("", 1, 0, "abcdefghijklmnopqrst", 0, 10, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 19, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 20, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 0, 21, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 1, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 9, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 18, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 19, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 1, 20, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 1, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 5, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 9, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 10, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 10, 11, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 19, 1, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 19, 2, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 0, "", 0, 0, 0); - test("abcde", 0, 0, "", 0, 1, 0); - test("abcde", 0, 0, "", 1, 0, 0); - test("abcde", 0, 0, "abcde", 0, 0, 0); - test("abcde", 0, 0, "abcde", 0, 1, -1); - test("abcde", 0, 0, "abcde", 0, 2, -2); - test("abcde", 0, 0, "abcde", 0, 4, -4); - test("abcde", 0, 0, "abcde", 0, 5, -5); - test("abcde", 0, 0, "abcde", 0, 6, -5); - test("abcde", 0, 0, "abcde", 1, 0, 0); - test("abcde", 0, 0, "abcde", 1, 1, -1); - test("abcde", 0, 0, "abcde", 1, 2, -2); - test("abcde", 0, 0, "abcde", 1, 3, -3); - test("abcde", 0, 0, "abcde", 1, 4, -4); - test("abcde", 0, 0, "abcde", 1, 5, -4); - test("abcde", 0, 0, "abcde", 2, 0, 0); - test("abcde", 0, 0, "abcde", 2, 1, -1); - test("abcde", 0, 0, "abcde", 2, 2, -2); - test("abcde", 0, 0, "abcde", 2, 3, -3); - test("abcde", 0, 0, "abcde", 2, 4, -3); - test("abcde", 0, 0, "abcde", 4, 0, 0); - test("abcde", 0, 0, "abcde", 4, 1, -1); - test("abcde", 0, 0, "abcde", 4, 2, -1); - test("abcde", 0, 0, "abcde", 5, 0, 0); - test("abcde", 0, 0, "abcde", 5, 1, 0); - test("abcde", 0, 0, "abcde", 6, 0, 0); - test("abcde", 0, 0, "abcdefghij", 0, 0, 0); - test("abcde", 0, 0, "abcdefghij", 0, 1, -1); - test("abcde", 0, 0, "abcdefghij", 0, 5, -5); - test("abcde", 0, 0, "abcdefghij", 0, 9, -9); - test("abcde", 0, 0, "abcdefghij", 0, 10, -10); - test("abcde", 0, 0, "abcdefghij", 0, 11, -10); - test("abcde", 0, 0, "abcdefghij", 1, 0, 0); - test("abcde", 0, 0, "abcdefghij", 1, 1, -1); - test("abcde", 0, 0, "abcdefghij", 1, 4, -4); - test("abcde", 0, 0, "abcdefghij", 1, 8, -8); - test("abcde", 0, 0, "abcdefghij", 1, 9, -9); - test("abcde", 0, 0, "abcdefghij", 1, 10, -9); - test("abcde", 0, 0, "abcdefghij", 5, 0, 0); - test("abcde", 0, 0, "abcdefghij", 5, 1, -1); - test("abcde", 0, 0, "abcdefghij", 5, 2, -2); - test("abcde", 0, 0, "abcdefghij", 5, 4, -4); - test("abcde", 0, 0, "abcdefghij", 5, 5, -5); - test("abcde", 0, 0, "abcdefghij", 5, 6, -5); - test("abcde", 0, 0, "abcdefghij", 9, 0, 0); - test("abcde", 0, 0, "abcdefghij", 9, 1, -1); - test("abcde", 0, 0, "abcdefghij", 9, 2, -1); - test("abcde", 0, 0, "abcdefghij", 10, 0, 0); - test("abcde", 0, 0, "abcdefghij", 10, 1, 0); - test("abcde", 0, 0, "abcdefghij", 11, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 1, "", 0, 0, 1); - test("abcde", 0, 1, "", 0, 1, 1); - test("abcde", 0, 1, "", 1, 0, 0); - test("abcde", 0, 1, "abcde", 0, 0, 1); -} - -void test3() -{ - test("abcde", 0, 1, "abcde", 0, 1, 0); - test("abcde", 0, 1, "abcde", 0, 2, -1); - test("abcde", 0, 1, "abcde", 0, 4, -3); - test("abcde", 0, 1, "abcde", 0, 5, -4); - test("abcde", 0, 1, "abcde", 0, 6, -4); - test("abcde", 0, 1, "abcde", 1, 0, 1); - test("abcde", 0, 1, "abcde", 1, 1, -1); - test("abcde", 0, 1, "abcde", 1, 2, -1); - test("abcde", 0, 1, "abcde", 1, 3, -1); - test("abcde", 0, 1, "abcde", 1, 4, -1); - test("abcde", 0, 1, "abcde", 1, 5, -1); - test("abcde", 0, 1, "abcde", 2, 0, 1); - test("abcde", 0, 1, "abcde", 2, 1, -2); - test("abcde", 0, 1, "abcde", 2, 2, -2); - test("abcde", 0, 1, "abcde", 2, 3, -2); - test("abcde", 0, 1, "abcde", 2, 4, -2); - test("abcde", 0, 1, "abcde", 4, 0, 1); - test("abcde", 0, 1, "abcde", 4, 1, -4); - test("abcde", 0, 1, "abcde", 4, 2, -4); - test("abcde", 0, 1, "abcde", 5, 0, 1); - test("abcde", 0, 1, "abcde", 5, 1, 1); - test("abcde", 0, 1, "abcde", 6, 0, 0); - test("abcde", 0, 1, "abcdefghij", 0, 0, 1); - test("abcde", 0, 1, "abcdefghij", 0, 1, 0); - test("abcde", 0, 1, "abcdefghij", 0, 5, -4); - test("abcde", 0, 1, "abcdefghij", 0, 9, -8); - test("abcde", 0, 1, "abcdefghij", 0, 10, -9); - test("abcde", 0, 1, "abcdefghij", 0, 11, -9); - test("abcde", 0, 1, "abcdefghij", 1, 0, 1); - test("abcde", 0, 1, "abcdefghij", 1, 1, -1); - test("abcde", 0, 1, "abcdefghij", 1, 4, -1); - test("abcde", 0, 1, "abcdefghij", 1, 8, -1); - test("abcde", 0, 1, "abcdefghij", 1, 9, -1); - test("abcde", 0, 1, "abcdefghij", 1, 10, -1); - test("abcde", 0, 1, "abcdefghij", 5, 0, 1); - test("abcde", 0, 1, "abcdefghij", 5, 1, -5); - test("abcde", 0, 1, "abcdefghij", 5, 2, -5); - test("abcde", 0, 1, "abcdefghij", 5, 4, -5); - test("abcde", 0, 1, "abcdefghij", 5, 5, -5); - test("abcde", 0, 1, "abcdefghij", 5, 6, -5); - test("abcde", 0, 1, "abcdefghij", 9, 0, 1); - test("abcde", 0, 1, "abcdefghij", 9, 1, -9); - test("abcde", 0, 1, "abcdefghij", 9, 2, -9); - test("abcde", 0, 1, "abcdefghij", 10, 0, 1); - test("abcde", 0, 1, "abcdefghij", 10, 1, 1); - test("abcde", 0, 1, "abcdefghij", 11, 0, 0); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcde", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 2, "", 0, 0, 2); - test("abcde", 0, 2, "", 0, 1, 2); - test("abcde", 0, 2, "", 1, 0, 0); - test("abcde", 0, 2, "abcde", 0, 0, 2); - test("abcde", 0, 2, "abcde", 0, 1, 1); - test("abcde", 0, 2, "abcde", 0, 2, 0); - test("abcde", 0, 2, "abcde", 0, 4, -2); - test("abcde", 0, 2, "abcde", 0, 5, -3); - test("abcde", 0, 2, "abcde", 0, 6, -3); - test("abcde", 0, 2, "abcde", 1, 0, 2); - test("abcde", 0, 2, "abcde", 1, 1, -1); - test("abcde", 0, 2, "abcde", 1, 2, -1); - test("abcde", 0, 2, "abcde", 1, 3, -1); - test("abcde", 0, 2, "abcde", 1, 4, -1); - test("abcde", 0, 2, "abcde", 1, 5, -1); - test("abcde", 0, 2, "abcde", 2, 0, 2); - test("abcde", 0, 2, "abcde", 2, 1, -2); - test("abcde", 0, 2, "abcde", 2, 2, -2); - test("abcde", 0, 2, "abcde", 2, 3, -2); - test("abcde", 0, 2, "abcde", 2, 4, -2); - test("abcde", 0, 2, "abcde", 4, 0, 2); - test("abcde", 0, 2, "abcde", 4, 1, -4); - test("abcde", 0, 2, "abcde", 4, 2, -4); - test("abcde", 0, 2, "abcde", 5, 0, 2); - test("abcde", 0, 2, "abcde", 5, 1, 2); - test("abcde", 0, 2, "abcde", 6, 0, 0); - test("abcde", 0, 2, "abcdefghij", 0, 0, 2); - test("abcde", 0, 2, "abcdefghij", 0, 1, 1); - test("abcde", 0, 2, "abcdefghij", 0, 5, -3); - test("abcde", 0, 2, "abcdefghij", 0, 9, -7); -} - -void test4() -{ - test("abcde", 0, 2, "abcdefghij", 0, 10, -8); - test("abcde", 0, 2, "abcdefghij", 0, 11, -8); - test("abcde", 0, 2, "abcdefghij", 1, 0, 2); - test("abcde", 0, 2, "abcdefghij", 1, 1, -1); - test("abcde", 0, 2, "abcdefghij", 1, 4, -1); - test("abcde", 0, 2, "abcdefghij", 1, 8, -1); - test("abcde", 0, 2, "abcdefghij", 1, 9, -1); - test("abcde", 0, 2, "abcdefghij", 1, 10, -1); - test("abcde", 0, 2, "abcdefghij", 5, 0, 2); - test("abcde", 0, 2, "abcdefghij", 5, 1, -5); - test("abcde", 0, 2, "abcdefghij", 5, 2, -5); - test("abcde", 0, 2, "abcdefghij", 5, 4, -5); - test("abcde", 0, 2, "abcdefghij", 5, 5, -5); - test("abcde", 0, 2, "abcdefghij", 5, 6, -5); - test("abcde", 0, 2, "abcdefghij", 9, 0, 2); - test("abcde", 0, 2, "abcdefghij", 9, 1, -9); - test("abcde", 0, 2, "abcdefghij", 9, 2, -9); - test("abcde", 0, 2, "abcdefghij", 10, 0, 2); - test("abcde", 0, 2, "abcdefghij", 10, 1, 2); - test("abcde", 0, 2, "abcdefghij", 11, 0, 0); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 10, -8); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 19, -17); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 20, -18); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 0, 21, -18); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 0, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 20, 1, 2); - test("abcde", 0, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 4, "", 0, 0, 4); - test("abcde", 0, 4, "", 0, 1, 4); - test("abcde", 0, 4, "", 1, 0, 0); - test("abcde", 0, 4, "abcde", 0, 0, 4); - test("abcde", 0, 4, "abcde", 0, 1, 3); - test("abcde", 0, 4, "abcde", 0, 2, 2); - test("abcde", 0, 4, "abcde", 0, 4, 0); - test("abcde", 0, 4, "abcde", 0, 5, -1); - test("abcde", 0, 4, "abcde", 0, 6, -1); - test("abcde", 0, 4, "abcde", 1, 0, 4); - test("abcde", 0, 4, "abcde", 1, 1, -1); - test("abcde", 0, 4, "abcde", 1, 2, -1); - test("abcde", 0, 4, "abcde", 1, 3, -1); - test("abcde", 0, 4, "abcde", 1, 4, -1); - test("abcde", 0, 4, "abcde", 1, 5, -1); - test("abcde", 0, 4, "abcde", 2, 0, 4); - test("abcde", 0, 4, "abcde", 2, 1, -2); - test("abcde", 0, 4, "abcde", 2, 2, -2); - test("abcde", 0, 4, "abcde", 2, 3, -2); - test("abcde", 0, 4, "abcde", 2, 4, -2); - test("abcde", 0, 4, "abcde", 4, 0, 4); - test("abcde", 0, 4, "abcde", 4, 1, -4); - test("abcde", 0, 4, "abcde", 4, 2, -4); - test("abcde", 0, 4, "abcde", 5, 0, 4); - test("abcde", 0, 4, "abcde", 5, 1, 4); - test("abcde", 0, 4, "abcde", 6, 0, 0); - test("abcde", 0, 4, "abcdefghij", 0, 0, 4); - test("abcde", 0, 4, "abcdefghij", 0, 1, 3); - test("abcde", 0, 4, "abcdefghij", 0, 5, -1); - test("abcde", 0, 4, "abcdefghij", 0, 9, -5); - test("abcde", 0, 4, "abcdefghij", 0, 10, -6); - test("abcde", 0, 4, "abcdefghij", 0, 11, -6); - test("abcde", 0, 4, "abcdefghij", 1, 0, 4); - test("abcde", 0, 4, "abcdefghij", 1, 1, -1); - test("abcde", 0, 4, "abcdefghij", 1, 4, -1); - test("abcde", 0, 4, "abcdefghij", 1, 8, -1); - test("abcde", 0, 4, "abcdefghij", 1, 9, -1); - test("abcde", 0, 4, "abcdefghij", 1, 10, -1); - test("abcde", 0, 4, "abcdefghij", 5, 0, 4); - test("abcde", 0, 4, "abcdefghij", 5, 1, -5); - test("abcde", 0, 4, "abcdefghij", 5, 2, -5); - test("abcde", 0, 4, "abcdefghij", 5, 4, -5); - test("abcde", 0, 4, "abcdefghij", 5, 5, -5); - test("abcde", 0, 4, "abcdefghij", 5, 6, -5); - test("abcde", 0, 4, "abcdefghij", 9, 0, 4); - test("abcde", 0, 4, "abcdefghij", 9, 1, -9); - test("abcde", 0, 4, "abcdefghij", 9, 2, -9); - test("abcde", 0, 4, "abcdefghij", 10, 0, 4); - test("abcde", 0, 4, "abcdefghij", 10, 1, 4); - test("abcde", 0, 4, "abcdefghij", 11, 0, 0); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 1, 3); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 10, -6); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 19, -15); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 20, -16); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 0, 21, -16); -} - -void test5() -{ - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 0, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 20, 1, 4); - test("abcde", 0, 4, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 5, "", 0, 0, 5); - test("abcde", 0, 5, "", 0, 1, 5); - test("abcde", 0, 5, "", 1, 0, 0); - test("abcde", 0, 5, "abcde", 0, 0, 5); - test("abcde", 0, 5, "abcde", 0, 1, 4); - test("abcde", 0, 5, "abcde", 0, 2, 3); - test("abcde", 0, 5, "abcde", 0, 4, 1); - test("abcde", 0, 5, "abcde", 0, 5, 0); - test("abcde", 0, 5, "abcde", 0, 6, 0); - test("abcde", 0, 5, "abcde", 1, 0, 5); - test("abcde", 0, 5, "abcde", 1, 1, -1); - test("abcde", 0, 5, "abcde", 1, 2, -1); - test("abcde", 0, 5, "abcde", 1, 3, -1); - test("abcde", 0, 5, "abcde", 1, 4, -1); - test("abcde", 0, 5, "abcde", 1, 5, -1); - test("abcde", 0, 5, "abcde", 2, 0, 5); - test("abcde", 0, 5, "abcde", 2, 1, -2); - test("abcde", 0, 5, "abcde", 2, 2, -2); - test("abcde", 0, 5, "abcde", 2, 3, -2); - test("abcde", 0, 5, "abcde", 2, 4, -2); - test("abcde", 0, 5, "abcde", 4, 0, 5); - test("abcde", 0, 5, "abcde", 4, 1, -4); - test("abcde", 0, 5, "abcde", 4, 2, -4); - test("abcde", 0, 5, "abcde", 5, 0, 5); - test("abcde", 0, 5, "abcde", 5, 1, 5); - test("abcde", 0, 5, "abcde", 6, 0, 0); - test("abcde", 0, 5, "abcdefghij", 0, 0, 5); - test("abcde", 0, 5, "abcdefghij", 0, 1, 4); - test("abcde", 0, 5, "abcdefghij", 0, 5, 0); - test("abcde", 0, 5, "abcdefghij", 0, 9, -4); - test("abcde", 0, 5, "abcdefghij", 0, 10, -5); - test("abcde", 0, 5, "abcdefghij", 0, 11, -5); - test("abcde", 0, 5, "abcdefghij", 1, 0, 5); - test("abcde", 0, 5, "abcdefghij", 1, 1, -1); - test("abcde", 0, 5, "abcdefghij", 1, 4, -1); - test("abcde", 0, 5, "abcdefghij", 1, 8, -1); - test("abcde", 0, 5, "abcdefghij", 1, 9, -1); - test("abcde", 0, 5, "abcdefghij", 1, 10, -1); - test("abcde", 0, 5, "abcdefghij", 5, 0, 5); - test("abcde", 0, 5, "abcdefghij", 5, 1, -5); - test("abcde", 0, 5, "abcdefghij", 5, 2, -5); - test("abcde", 0, 5, "abcdefghij", 5, 4, -5); - test("abcde", 0, 5, "abcdefghij", 5, 5, -5); - test("abcde", 0, 5, "abcdefghij", 5, 6, -5); - test("abcde", 0, 5, "abcdefghij", 9, 0, 5); - test("abcde", 0, 5, "abcdefghij", 9, 1, -9); - test("abcde", 0, 5, "abcdefghij", 9, 2, -9); - test("abcde", 0, 5, "abcdefghij", 10, 0, 5); - test("abcde", 0, 5, "abcdefghij", 10, 1, 5); - test("abcde", 0, 5, "abcdefghij", 11, 0, 0); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcde", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 0, 6, "", 0, 0, 5); - test("abcde", 0, 6, "", 0, 1, 5); - test("abcde", 0, 6, "", 1, 0, 0); - test("abcde", 0, 6, "abcde", 0, 0, 5); - test("abcde", 0, 6, "abcde", 0, 1, 4); - test("abcde", 0, 6, "abcde", 0, 2, 3); - test("abcde", 0, 6, "abcde", 0, 4, 1); - test("abcde", 0, 6, "abcde", 0, 5, 0); -} - -void test6() -{ - test("abcde", 0, 6, "abcde", 0, 6, 0); - test("abcde", 0, 6, "abcde", 1, 0, 5); - test("abcde", 0, 6, "abcde", 1, 1, -1); - test("abcde", 0, 6, "abcde", 1, 2, -1); - test("abcde", 0, 6, "abcde", 1, 3, -1); - test("abcde", 0, 6, "abcde", 1, 4, -1); - test("abcde", 0, 6, "abcde", 1, 5, -1); - test("abcde", 0, 6, "abcde", 2, 0, 5); - test("abcde", 0, 6, "abcde", 2, 1, -2); - test("abcde", 0, 6, "abcde", 2, 2, -2); - test("abcde", 0, 6, "abcde", 2, 3, -2); - test("abcde", 0, 6, "abcde", 2, 4, -2); - test("abcde", 0, 6, "abcde", 4, 0, 5); - test("abcde", 0, 6, "abcde", 4, 1, -4); - test("abcde", 0, 6, "abcde", 4, 2, -4); - test("abcde", 0, 6, "abcde", 5, 0, 5); - test("abcde", 0, 6, "abcde", 5, 1, 5); - test("abcde", 0, 6, "abcde", 6, 0, 0); - test("abcde", 0, 6, "abcdefghij", 0, 0, 5); - test("abcde", 0, 6, "abcdefghij", 0, 1, 4); - test("abcde", 0, 6, "abcdefghij", 0, 5, 0); - test("abcde", 0, 6, "abcdefghij", 0, 9, -4); - test("abcde", 0, 6, "abcdefghij", 0, 10, -5); - test("abcde", 0, 6, "abcdefghij", 0, 11, -5); - test("abcde", 0, 6, "abcdefghij", 1, 0, 5); - test("abcde", 0, 6, "abcdefghij", 1, 1, -1); - test("abcde", 0, 6, "abcdefghij", 1, 4, -1); - test("abcde", 0, 6, "abcdefghij", 1, 8, -1); - test("abcde", 0, 6, "abcdefghij", 1, 9, -1); - test("abcde", 0, 6, "abcdefghij", 1, 10, -1); - test("abcde", 0, 6, "abcdefghij", 5, 0, 5); - test("abcde", 0, 6, "abcdefghij", 5, 1, -5); - test("abcde", 0, 6, "abcdefghij", 5, 2, -5); - test("abcde", 0, 6, "abcdefghij", 5, 4, -5); - test("abcde", 0, 6, "abcdefghij", 5, 5, -5); - test("abcde", 0, 6, "abcdefghij", 5, 6, -5); - test("abcde", 0, 6, "abcdefghij", 9, 0, 5); - test("abcde", 0, 6, "abcdefghij", 9, 1, -9); - test("abcde", 0, 6, "abcdefghij", 9, 2, -9); - test("abcde", 0, 6, "abcdefghij", 10, 0, 5); - test("abcde", 0, 6, "abcdefghij", 10, 1, 5); - test("abcde", 0, 6, "abcdefghij", 11, 0, 0); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 1, 4); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 10, -5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 19, -14); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 20, -15); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 0, 21, -15); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcde", 0, 6, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 0, "", 0, 0, 0); - test("abcde", 1, 0, "", 0, 1, 0); - test("abcde", 1, 0, "", 1, 0, 0); - test("abcde", 1, 0, "abcde", 0, 0, 0); - test("abcde", 1, 0, "abcde", 0, 1, -1); - test("abcde", 1, 0, "abcde", 0, 2, -2); - test("abcde", 1, 0, "abcde", 0, 4, -4); - test("abcde", 1, 0, "abcde", 0, 5, -5); - test("abcde", 1, 0, "abcde", 0, 6, -5); - test("abcde", 1, 0, "abcde", 1, 0, 0); - test("abcde", 1, 0, "abcde", 1, 1, -1); - test("abcde", 1, 0, "abcde", 1, 2, -2); - test("abcde", 1, 0, "abcde", 1, 3, -3); - test("abcde", 1, 0, "abcde", 1, 4, -4); - test("abcde", 1, 0, "abcde", 1, 5, -4); - test("abcde", 1, 0, "abcde", 2, 0, 0); - test("abcde", 1, 0, "abcde", 2, 1, -1); - test("abcde", 1, 0, "abcde", 2, 2, -2); - test("abcde", 1, 0, "abcde", 2, 3, -3); - test("abcde", 1, 0, "abcde", 2, 4, -3); - test("abcde", 1, 0, "abcde", 4, 0, 0); - test("abcde", 1, 0, "abcde", 4, 1, -1); - test("abcde", 1, 0, "abcde", 4, 2, -1); - test("abcde", 1, 0, "abcde", 5, 0, 0); - test("abcde", 1, 0, "abcde", 5, 1, 0); - test("abcde", 1, 0, "abcde", 6, 0, 0); - test("abcde", 1, 0, "abcdefghij", 0, 0, 0); - test("abcde", 1, 0, "abcdefghij", 0, 1, -1); - test("abcde", 1, 0, "abcdefghij", 0, 5, -5); - test("abcde", 1, 0, "abcdefghij", 0, 9, -9); - test("abcde", 1, 0, "abcdefghij", 0, 10, -10); - test("abcde", 1, 0, "abcdefghij", 0, 11, -10); - test("abcde", 1, 0, "abcdefghij", 1, 0, 0); - test("abcde", 1, 0, "abcdefghij", 1, 1, -1); -} - -void test7() -{ - test("abcde", 1, 0, "abcdefghij", 1, 4, -4); - test("abcde", 1, 0, "abcdefghij", 1, 8, -8); - test("abcde", 1, 0, "abcdefghij", 1, 9, -9); - test("abcde", 1, 0, "abcdefghij", 1, 10, -9); - test("abcde", 1, 0, "abcdefghij", 5, 0, 0); - test("abcde", 1, 0, "abcdefghij", 5, 1, -1); - test("abcde", 1, 0, "abcdefghij", 5, 2, -2); - test("abcde", 1, 0, "abcdefghij", 5, 4, -4); - test("abcde", 1, 0, "abcdefghij", 5, 5, -5); - test("abcde", 1, 0, "abcdefghij", 5, 6, -5); - test("abcde", 1, 0, "abcdefghij", 9, 0, 0); - test("abcde", 1, 0, "abcdefghij", 9, 1, -1); - test("abcde", 1, 0, "abcdefghij", 9, 2, -1); - test("abcde", 1, 0, "abcdefghij", 10, 0, 0); - test("abcde", 1, 0, "abcdefghij", 10, 1, 0); - test("abcde", 1, 0, "abcdefghij", 11, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 1, "", 0, 0, 1); - test("abcde", 1, 1, "", 0, 1, 1); - test("abcde", 1, 1, "", 1, 0, 0); - test("abcde", 1, 1, "abcde", 0, 0, 1); - test("abcde", 1, 1, "abcde", 0, 1, 1); - test("abcde", 1, 1, "abcde", 0, 2, 1); - test("abcde", 1, 1, "abcde", 0, 4, 1); - test("abcde", 1, 1, "abcde", 0, 5, 1); - test("abcde", 1, 1, "abcde", 0, 6, 1); - test("abcde", 1, 1, "abcde", 1, 0, 1); - test("abcde", 1, 1, "abcde", 1, 1, 0); - test("abcde", 1, 1, "abcde", 1, 2, -1); - test("abcde", 1, 1, "abcde", 1, 3, -2); - test("abcde", 1, 1, "abcde", 1, 4, -3); - test("abcde", 1, 1, "abcde", 1, 5, -3); - test("abcde", 1, 1, "abcde", 2, 0, 1); - test("abcde", 1, 1, "abcde", 2, 1, -1); - test("abcde", 1, 1, "abcde", 2, 2, -1); - test("abcde", 1, 1, "abcde", 2, 3, -1); - test("abcde", 1, 1, "abcde", 2, 4, -1); - test("abcde", 1, 1, "abcde", 4, 0, 1); - test("abcde", 1, 1, "abcde", 4, 1, -3); - test("abcde", 1, 1, "abcde", 4, 2, -3); - test("abcde", 1, 1, "abcde", 5, 0, 1); - test("abcde", 1, 1, "abcde", 5, 1, 1); - test("abcde", 1, 1, "abcde", 6, 0, 0); - test("abcde", 1, 1, "abcdefghij", 0, 0, 1); - test("abcde", 1, 1, "abcdefghij", 0, 1, 1); - test("abcde", 1, 1, "abcdefghij", 0, 5, 1); - test("abcde", 1, 1, "abcdefghij", 0, 9, 1); - test("abcde", 1, 1, "abcdefghij", 0, 10, 1); - test("abcde", 1, 1, "abcdefghij", 0, 11, 1); - test("abcde", 1, 1, "abcdefghij", 1, 0, 1); - test("abcde", 1, 1, "abcdefghij", 1, 1, 0); - test("abcde", 1, 1, "abcdefghij", 1, 4, -3); - test("abcde", 1, 1, "abcdefghij", 1, 8, -7); - test("abcde", 1, 1, "abcdefghij", 1, 9, -8); - test("abcde", 1, 1, "abcdefghij", 1, 10, -8); - test("abcde", 1, 1, "abcdefghij", 5, 0, 1); - test("abcde", 1, 1, "abcdefghij", 5, 1, -4); - test("abcde", 1, 1, "abcdefghij", 5, 2, -4); - test("abcde", 1, 1, "abcdefghij", 5, 4, -4); - test("abcde", 1, 1, "abcdefghij", 5, 5, -4); - test("abcde", 1, 1, "abcdefghij", 5, 6, -4); - test("abcde", 1, 1, "abcdefghij", 9, 0, 1); - test("abcde", 1, 1, "abcdefghij", 9, 1, -8); - test("abcde", 1, 1, "abcdefghij", 9, 2, -8); - test("abcde", 1, 1, "abcdefghij", 10, 0, 1); - test("abcde", 1, 1, "abcdefghij", 10, 1, 1); - test("abcde", 1, 1, "abcdefghij", 11, 0, 0); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17); -} - -void test8() -{ - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcde", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 2, "", 0, 0, 2); - test("abcde", 1, 2, "", 0, 1, 2); - test("abcde", 1, 2, "", 1, 0, 0); - test("abcde", 1, 2, "abcde", 0, 0, 2); - test("abcde", 1, 2, "abcde", 0, 1, 1); - test("abcde", 1, 2, "abcde", 0, 2, 1); - test("abcde", 1, 2, "abcde", 0, 4, 1); - test("abcde", 1, 2, "abcde", 0, 5, 1); - test("abcde", 1, 2, "abcde", 0, 6, 1); - test("abcde", 1, 2, "abcde", 1, 0, 2); - test("abcde", 1, 2, "abcde", 1, 1, 1); - test("abcde", 1, 2, "abcde", 1, 2, 0); - test("abcde", 1, 2, "abcde", 1, 3, -1); - test("abcde", 1, 2, "abcde", 1, 4, -2); - test("abcde", 1, 2, "abcde", 1, 5, -2); - test("abcde", 1, 2, "abcde", 2, 0, 2); - test("abcde", 1, 2, "abcde", 2, 1, -1); - test("abcde", 1, 2, "abcde", 2, 2, -1); - test("abcde", 1, 2, "abcde", 2, 3, -1); - test("abcde", 1, 2, "abcde", 2, 4, -1); - test("abcde", 1, 2, "abcde", 4, 0, 2); - test("abcde", 1, 2, "abcde", 4, 1, -3); - test("abcde", 1, 2, "abcde", 4, 2, -3); - test("abcde", 1, 2, "abcde", 5, 0, 2); - test("abcde", 1, 2, "abcde", 5, 1, 2); - test("abcde", 1, 2, "abcde", 6, 0, 0); - test("abcde", 1, 2, "abcdefghij", 0, 0, 2); - test("abcde", 1, 2, "abcdefghij", 0, 1, 1); - test("abcde", 1, 2, "abcdefghij", 0, 5, 1); - test("abcde", 1, 2, "abcdefghij", 0, 9, 1); - test("abcde", 1, 2, "abcdefghij", 0, 10, 1); - test("abcde", 1, 2, "abcdefghij", 0, 11, 1); - test("abcde", 1, 2, "abcdefghij", 1, 0, 2); - test("abcde", 1, 2, "abcdefghij", 1, 1, 1); - test("abcde", 1, 2, "abcdefghij", 1, 4, -2); - test("abcde", 1, 2, "abcdefghij", 1, 8, -6); - test("abcde", 1, 2, "abcdefghij", 1, 9, -7); - test("abcde", 1, 2, "abcdefghij", 1, 10, -7); - test("abcde", 1, 2, "abcdefghij", 5, 0, 2); - test("abcde", 1, 2, "abcdefghij", 5, 1, -4); - test("abcde", 1, 2, "abcdefghij", 5, 2, -4); - test("abcde", 1, 2, "abcdefghij", 5, 4, -4); - test("abcde", 1, 2, "abcdefghij", 5, 5, -4); - test("abcde", 1, 2, "abcdefghij", 5, 6, -4); - test("abcde", 1, 2, "abcdefghij", 9, 0, 2); - test("abcde", 1, 2, "abcdefghij", 9, 1, -8); - test("abcde", 1, 2, "abcdefghij", 9, 2, -8); - test("abcde", 1, 2, "abcdefghij", 10, 0, 2); - test("abcde", 1, 2, "abcdefghij", 10, 1, 2); - test("abcde", 1, 2, "abcdefghij", 11, 0, 0); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 1, 1); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 9, -7); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 18, -16); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 19, -17); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 1, 20, -17); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 0, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 20, 1, 2); - test("abcde", 1, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 3, "", 0, 0, 3); - test("abcde", 1, 3, "", 0, 1, 3); - test("abcde", 1, 3, "", 1, 0, 0); - test("abcde", 1, 3, "abcde", 0, 0, 3); - test("abcde", 1, 3, "abcde", 0, 1, 1); - test("abcde", 1, 3, "abcde", 0, 2, 1); - test("abcde", 1, 3, "abcde", 0, 4, 1); - test("abcde", 1, 3, "abcde", 0, 5, 1); - test("abcde", 1, 3, "abcde", 0, 6, 1); - test("abcde", 1, 3, "abcde", 1, 0, 3); - test("abcde", 1, 3, "abcde", 1, 1, 2); - test("abcde", 1, 3, "abcde", 1, 2, 1); -} - -void test9() -{ - test("abcde", 1, 3, "abcde", 1, 3, 0); - test("abcde", 1, 3, "abcde", 1, 4, -1); - test("abcde", 1, 3, "abcde", 1, 5, -1); - test("abcde", 1, 3, "abcde", 2, 0, 3); - test("abcde", 1, 3, "abcde", 2, 1, -1); - test("abcde", 1, 3, "abcde", 2, 2, -1); - test("abcde", 1, 3, "abcde", 2, 3, -1); - test("abcde", 1, 3, "abcde", 2, 4, -1); - test("abcde", 1, 3, "abcde", 4, 0, 3); - test("abcde", 1, 3, "abcde", 4, 1, -3); - test("abcde", 1, 3, "abcde", 4, 2, -3); - test("abcde", 1, 3, "abcde", 5, 0, 3); - test("abcde", 1, 3, "abcde", 5, 1, 3); - test("abcde", 1, 3, "abcde", 6, 0, 0); - test("abcde", 1, 3, "abcdefghij", 0, 0, 3); - test("abcde", 1, 3, "abcdefghij", 0, 1, 1); - test("abcde", 1, 3, "abcdefghij", 0, 5, 1); - test("abcde", 1, 3, "abcdefghij", 0, 9, 1); - test("abcde", 1, 3, "abcdefghij", 0, 10, 1); - test("abcde", 1, 3, "abcdefghij", 0, 11, 1); - test("abcde", 1, 3, "abcdefghij", 1, 0, 3); - test("abcde", 1, 3, "abcdefghij", 1, 1, 2); - test("abcde", 1, 3, "abcdefghij", 1, 4, -1); - test("abcde", 1, 3, "abcdefghij", 1, 8, -5); - test("abcde", 1, 3, "abcdefghij", 1, 9, -6); - test("abcde", 1, 3, "abcdefghij", 1, 10, -6); - test("abcde", 1, 3, "abcdefghij", 5, 0, 3); - test("abcde", 1, 3, "abcdefghij", 5, 1, -4); - test("abcde", 1, 3, "abcdefghij", 5, 2, -4); - test("abcde", 1, 3, "abcdefghij", 5, 4, -4); - test("abcde", 1, 3, "abcdefghij", 5, 5, -4); - test("abcde", 1, 3, "abcdefghij", 5, 6, -4); - test("abcde", 1, 3, "abcdefghij", 9, 0, 3); - test("abcde", 1, 3, "abcdefghij", 9, 1, -8); - test("abcde", 1, 3, "abcdefghij", 9, 2, -8); - test("abcde", 1, 3, "abcdefghij", 10, 0, 3); - test("abcde", 1, 3, "abcdefghij", 10, 1, 3); - test("abcde", 1, 3, "abcdefghij", 11, 0, 0); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 1, 2); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 9, -6); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 18, -15); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 19, -16); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 1, 20, -16); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 0, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 20, 1, 3); - test("abcde", 1, 3, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 4, "", 0, 0, 4); - test("abcde", 1, 4, "", 0, 1, 4); - test("abcde", 1, 4, "", 1, 0, 0); - test("abcde", 1, 4, "abcde", 0, 0, 4); - test("abcde", 1, 4, "abcde", 0, 1, 1); - test("abcde", 1, 4, "abcde", 0, 2, 1); - test("abcde", 1, 4, "abcde", 0, 4, 1); - test("abcde", 1, 4, "abcde", 0, 5, 1); - test("abcde", 1, 4, "abcde", 0, 6, 1); - test("abcde", 1, 4, "abcde", 1, 0, 4); - test("abcde", 1, 4, "abcde", 1, 1, 3); - test("abcde", 1, 4, "abcde", 1, 2, 2); - test("abcde", 1, 4, "abcde", 1, 3, 1); - test("abcde", 1, 4, "abcde", 1, 4, 0); - test("abcde", 1, 4, "abcde", 1, 5, 0); - test("abcde", 1, 4, "abcde", 2, 0, 4); - test("abcde", 1, 4, "abcde", 2, 1, -1); - test("abcde", 1, 4, "abcde", 2, 2, -1); - test("abcde", 1, 4, "abcde", 2, 3, -1); - test("abcde", 1, 4, "abcde", 2, 4, -1); - test("abcde", 1, 4, "abcde", 4, 0, 4); - test("abcde", 1, 4, "abcde", 4, 1, -3); - test("abcde", 1, 4, "abcde", 4, 2, -3); - test("abcde", 1, 4, "abcde", 5, 0, 4); - test("abcde", 1, 4, "abcde", 5, 1, 4); - test("abcde", 1, 4, "abcde", 6, 0, 0); - test("abcde", 1, 4, "abcdefghij", 0, 0, 4); - test("abcde", 1, 4, "abcdefghij", 0, 1, 1); - test("abcde", 1, 4, "abcdefghij", 0, 5, 1); - test("abcde", 1, 4, "abcdefghij", 0, 9, 1); - test("abcde", 1, 4, "abcdefghij", 0, 10, 1); - test("abcde", 1, 4, "abcdefghij", 0, 11, 1); - test("abcde", 1, 4, "abcdefghij", 1, 0, 4); - test("abcde", 1, 4, "abcdefghij", 1, 1, 3); - test("abcde", 1, 4, "abcdefghij", 1, 4, 0); - test("abcde", 1, 4, "abcdefghij", 1, 8, -4); - test("abcde", 1, 4, "abcdefghij", 1, 9, -5); - test("abcde", 1, 4, "abcdefghij", 1, 10, -5); -} - -void test10() -{ - test("abcde", 1, 4, "abcdefghij", 5, 0, 4); - test("abcde", 1, 4, "abcdefghij", 5, 1, -4); - test("abcde", 1, 4, "abcdefghij", 5, 2, -4); - test("abcde", 1, 4, "abcdefghij", 5, 4, -4); - test("abcde", 1, 4, "abcdefghij", 5, 5, -4); - test("abcde", 1, 4, "abcdefghij", 5, 6, -4); - test("abcde", 1, 4, "abcdefghij", 9, 0, 4); - test("abcde", 1, 4, "abcdefghij", 9, 1, -8); - test("abcde", 1, 4, "abcdefghij", 9, 2, -8); - test("abcde", 1, 4, "abcdefghij", 10, 0, 4); - test("abcde", 1, 4, "abcdefghij", 10, 1, 4); - test("abcde", 1, 4, "abcdefghij", 11, 0, 0); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4); - test("abcde", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 1, 5, "", 0, 0, 4); - test("abcde", 1, 5, "", 0, 1, 4); - test("abcde", 1, 5, "", 1, 0, 0); - test("abcde", 1, 5, "abcde", 0, 0, 4); - test("abcde", 1, 5, "abcde", 0, 1, 1); - test("abcde", 1, 5, "abcde", 0, 2, 1); - test("abcde", 1, 5, "abcde", 0, 4, 1); - test("abcde", 1, 5, "abcde", 0, 5, 1); - test("abcde", 1, 5, "abcde", 0, 6, 1); - test("abcde", 1, 5, "abcde", 1, 0, 4); - test("abcde", 1, 5, "abcde", 1, 1, 3); - test("abcde", 1, 5, "abcde", 1, 2, 2); - test("abcde", 1, 5, "abcde", 1, 3, 1); - test("abcde", 1, 5, "abcde", 1, 4, 0); - test("abcde", 1, 5, "abcde", 1, 5, 0); - test("abcde", 1, 5, "abcde", 2, 0, 4); - test("abcde", 1, 5, "abcde", 2, 1, -1); - test("abcde", 1, 5, "abcde", 2, 2, -1); - test("abcde", 1, 5, "abcde", 2, 3, -1); - test("abcde", 1, 5, "abcde", 2, 4, -1); - test("abcde", 1, 5, "abcde", 4, 0, 4); - test("abcde", 1, 5, "abcde", 4, 1, -3); - test("abcde", 1, 5, "abcde", 4, 2, -3); - test("abcde", 1, 5, "abcde", 5, 0, 4); - test("abcde", 1, 5, "abcde", 5, 1, 4); - test("abcde", 1, 5, "abcde", 6, 0, 0); - test("abcde", 1, 5, "abcdefghij", 0, 0, 4); - test("abcde", 1, 5, "abcdefghij", 0, 1, 1); - test("abcde", 1, 5, "abcdefghij", 0, 5, 1); - test("abcde", 1, 5, "abcdefghij", 0, 9, 1); - test("abcde", 1, 5, "abcdefghij", 0, 10, 1); - test("abcde", 1, 5, "abcdefghij", 0, 11, 1); - test("abcde", 1, 5, "abcdefghij", 1, 0, 4); - test("abcde", 1, 5, "abcdefghij", 1, 1, 3); - test("abcde", 1, 5, "abcdefghij", 1, 4, 0); - test("abcde", 1, 5, "abcdefghij", 1, 8, -4); - test("abcde", 1, 5, "abcdefghij", 1, 9, -5); - test("abcde", 1, 5, "abcdefghij", 1, 10, -5); - test("abcde", 1, 5, "abcdefghij", 5, 0, 4); - test("abcde", 1, 5, "abcdefghij", 5, 1, -4); - test("abcde", 1, 5, "abcdefghij", 5, 2, -4); - test("abcde", 1, 5, "abcdefghij", 5, 4, -4); - test("abcde", 1, 5, "abcdefghij", 5, 5, -4); - test("abcde", 1, 5, "abcdefghij", 5, 6, -4); - test("abcde", 1, 5, "abcdefghij", 9, 0, 4); - test("abcde", 1, 5, "abcdefghij", 9, 1, -8); - test("abcde", 1, 5, "abcdefghij", 9, 2, -8); - test("abcde", 1, 5, "abcdefghij", 10, 0, 4); - test("abcde", 1, 5, "abcdefghij", 10, 1, 4); - test("abcde", 1, 5, "abcdefghij", 11, 0, 0); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 1, 3); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 9, -5); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 18, -14); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 19, -15); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 1, 20, -15); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 1, -9); -} - -void test11() -{ - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 0, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 20, 1, 4); - test("abcde", 1, 5, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 2, 0, "", 0, 0, 0); - test("abcde", 2, 0, "", 0, 1, 0); - test("abcde", 2, 0, "", 1, 0, 0); - test("abcde", 2, 0, "abcde", 0, 0, 0); - test("abcde", 2, 0, "abcde", 0, 1, -1); - test("abcde", 2, 0, "abcde", 0, 2, -2); - test("abcde", 2, 0, "abcde", 0, 4, -4); - test("abcde", 2, 0, "abcde", 0, 5, -5); - test("abcde", 2, 0, "abcde", 0, 6, -5); - test("abcde", 2, 0, "abcde", 1, 0, 0); - test("abcde", 2, 0, "abcde", 1, 1, -1); - test("abcde", 2, 0, "abcde", 1, 2, -2); - test("abcde", 2, 0, "abcde", 1, 3, -3); - test("abcde", 2, 0, "abcde", 1, 4, -4); - test("abcde", 2, 0, "abcde", 1, 5, -4); - test("abcde", 2, 0, "abcde", 2, 0, 0); - test("abcde", 2, 0, "abcde", 2, 1, -1); - test("abcde", 2, 0, "abcde", 2, 2, -2); - test("abcde", 2, 0, "abcde", 2, 3, -3); - test("abcde", 2, 0, "abcde", 2, 4, -3); - test("abcde", 2, 0, "abcde", 4, 0, 0); - test("abcde", 2, 0, "abcde", 4, 1, -1); - test("abcde", 2, 0, "abcde", 4, 2, -1); - test("abcde", 2, 0, "abcde", 5, 0, 0); - test("abcde", 2, 0, "abcde", 5, 1, 0); - test("abcde", 2, 0, "abcde", 6, 0, 0); - test("abcde", 2, 0, "abcdefghij", 0, 0, 0); - test("abcde", 2, 0, "abcdefghij", 0, 1, -1); - test("abcde", 2, 0, "abcdefghij", 0, 5, -5); - test("abcde", 2, 0, "abcdefghij", 0, 9, -9); - test("abcde", 2, 0, "abcdefghij", 0, 10, -10); - test("abcde", 2, 0, "abcdefghij", 0, 11, -10); - test("abcde", 2, 0, "abcdefghij", 1, 0, 0); - test("abcde", 2, 0, "abcdefghij", 1, 1, -1); - test("abcde", 2, 0, "abcdefghij", 1, 4, -4); - test("abcde", 2, 0, "abcdefghij", 1, 8, -8); - test("abcde", 2, 0, "abcdefghij", 1, 9, -9); - test("abcde", 2, 0, "abcdefghij", 1, 10, -9); - test("abcde", 2, 0, "abcdefghij", 5, 0, 0); - test("abcde", 2, 0, "abcdefghij", 5, 1, -1); - test("abcde", 2, 0, "abcdefghij", 5, 2, -2); - test("abcde", 2, 0, "abcdefghij", 5, 4, -4); - test("abcde", 2, 0, "abcdefghij", 5, 5, -5); - test("abcde", 2, 0, "abcdefghij", 5, 6, -5); - test("abcde", 2, 0, "abcdefghij", 9, 0, 0); - test("abcde", 2, 0, "abcdefghij", 9, 1, -1); - test("abcde", 2, 0, "abcdefghij", 9, 2, -1); - test("abcde", 2, 0, "abcdefghij", 10, 0, 0); - test("abcde", 2, 0, "abcdefghij", 10, 1, 0); - test("abcde", 2, 0, "abcdefghij", 11, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 2, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 2, 1, "", 0, 0, 1); - test("abcde", 2, 1, "", 0, 1, 1); - test("abcde", 2, 1, "", 1, 0, 0); - test("abcde", 2, 1, "abcde", 0, 0, 1); - test("abcde", 2, 1, "abcde", 0, 1, 2); - test("abcde", 2, 1, "abcde", 0, 2, 2); - test("abcde", 2, 1, "abcde", 0, 4, 2); - test("abcde", 2, 1, "abcde", 0, 5, 2); - test("abcde", 2, 1, "abcde", 0, 6, 2); - test("abcde", 2, 1, "abcde", 1, 0, 1); - test("abcde", 2, 1, "abcde", 1, 1, 1); - test("abcde", 2, 1, "abcde", 1, 2, 1); - test("abcde", 2, 1, "abcde", 1, 3, 1); - test("abcde", 2, 1, "abcde", 1, 4, 1); - test("abcde", 2, 1, "abcde", 1, 5, 1); - test("abcde", 2, 1, "abcde", 2, 0, 1); -} - -void test12() -{ - test("abcde", 2, 1, "abcde", 2, 1, 0); - test("abcde", 2, 1, "abcde", 2, 2, -1); - test("abcde", 2, 1, "abcde", 2, 3, -2); - test("abcde", 2, 1, "abcde", 2, 4, -2); - test("abcde", 2, 1, "abcde", 4, 0, 1); - test("abcde", 2, 1, "abcde", 4, 1, -2); - test("abcde", 2, 1, "abcde", 4, 2, -2); - test("abcde", 2, 1, "abcde", 5, 0, 1); - test("abcde", 2, 1, "abcde", 5, 1, 1); - test("abcde", 2, 1, "abcde", 6, 0, 0); - test("abcde", 2, 1, "abcdefghij", 0, 0, 1); - test("abcde", 2, 1, "abcdefghij", 0, 1, 2); - test("abcde", 2, 1, "abcdefghij", 0, 5, 2); - test("abcde", 2, 1, "abcdefghij", 0, 9, 2); - test("abcde", 2, 1, "abcdefghij", 0, 10, 2); - test("abcde", 2, 1, "abcdefghij", 0, 11, 2); - test("abcde", 2, 1, "abcdefghij", 1, 0, 1); - test("abcde", 2, 1, "abcdefghij", 1, 1, 1); - test("abcde", 2, 1, "abcdefghij", 1, 4, 1); - test("abcde", 2, 1, "abcdefghij", 1, 8, 1); - test("abcde", 2, 1, "abcdefghij", 1, 9, 1); - test("abcde", 2, 1, "abcdefghij", 1, 10, 1); - test("abcde", 2, 1, "abcdefghij", 5, 0, 1); - test("abcde", 2, 1, "abcdefghij", 5, 1, -3); - test("abcde", 2, 1, "abcdefghij", 5, 2, -3); - test("abcde", 2, 1, "abcdefghij", 5, 4, -3); - test("abcde", 2, 1, "abcdefghij", 5, 5, -3); - test("abcde", 2, 1, "abcdefghij", 5, 6, -3); - test("abcde", 2, 1, "abcdefghij", 9, 0, 1); - test("abcde", 2, 1, "abcdefghij", 9, 1, -7); - test("abcde", 2, 1, "abcdefghij", 9, 2, -7); - test("abcde", 2, 1, "abcdefghij", 10, 0, 1); - test("abcde", 2, 1, "abcdefghij", 10, 1, 1); - test("abcde", 2, 1, "abcdefghij", 11, 0, 0); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 1, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 10, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 19, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 20, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 0, 21, 2); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 1, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 9, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 18, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 19, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 1, 20, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 1, -8); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 5, -8); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 9, -8); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 10, -8); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 10, 11, -8); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 1, -17); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 19, 2, -17); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcde", 2, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 2, 2, "", 0, 0, 2); - test("abcde", 2, 2, "", 0, 1, 2); - test("abcde", 2, 2, "", 1, 0, 0); - test("abcde", 2, 2, "abcde", 0, 0, 2); - test("abcde", 2, 2, "abcde", 0, 1, 2); - test("abcde", 2, 2, "abcde", 0, 2, 2); - test("abcde", 2, 2, "abcde", 0, 4, 2); - test("abcde", 2, 2, "abcde", 0, 5, 2); - test("abcde", 2, 2, "abcde", 0, 6, 2); - test("abcde", 2, 2, "abcde", 1, 0, 2); - test("abcde", 2, 2, "abcde", 1, 1, 1); - test("abcde", 2, 2, "abcde", 1, 2, 1); - test("abcde", 2, 2, "abcde", 1, 3, 1); - test("abcde", 2, 2, "abcde", 1, 4, 1); - test("abcde", 2, 2, "abcde", 1, 5, 1); - test("abcde", 2, 2, "abcde", 2, 0, 2); - test("abcde", 2, 2, "abcde", 2, 1, 1); - test("abcde", 2, 2, "abcde", 2, 2, 0); - test("abcde", 2, 2, "abcde", 2, 3, -1); - test("abcde", 2, 2, "abcde", 2, 4, -1); - test("abcde", 2, 2, "abcde", 4, 0, 2); - test("abcde", 2, 2, "abcde", 4, 1, -2); - test("abcde", 2, 2, "abcde", 4, 2, -2); - test("abcde", 2, 2, "abcde", 5, 0, 2); - test("abcde", 2, 2, "abcde", 5, 1, 2); - test("abcde", 2, 2, "abcde", 6, 0, 0); - test("abcde", 2, 2, "abcdefghij", 0, 0, 2); - test("abcde", 2, 2, "abcdefghij", 0, 1, 2); - test("abcde", 2, 2, "abcdefghij", 0, 5, 2); - test("abcde", 2, 2, "abcdefghij", 0, 9, 2); - test("abcde", 2, 2, "abcdefghij", 0, 10, 2); - test("abcde", 2, 2, "abcdefghij", 0, 11, 2); - test("abcde", 2, 2, "abcdefghij", 1, 0, 2); - test("abcde", 2, 2, "abcdefghij", 1, 1, 1); - test("abcde", 2, 2, "abcdefghij", 1, 4, 1); - test("abcde", 2, 2, "abcdefghij", 1, 8, 1); - test("abcde", 2, 2, "abcdefghij", 1, 9, 1); - test("abcde", 2, 2, "abcdefghij", 1, 10, 1); - test("abcde", 2, 2, "abcdefghij", 5, 0, 2); - test("abcde", 2, 2, "abcdefghij", 5, 1, -3); - test("abcde", 2, 2, "abcdefghij", 5, 2, -3); - test("abcde", 2, 2, "abcdefghij", 5, 4, -3); -} - -void test13() -{ - test("abcde", 2, 2, "abcdefghij", 5, 5, -3); - test("abcde", 2, 2, "abcdefghij", 5, 6, -3); - test("abcde", 2, 2, "abcdefghij", 9, 0, 2); - test("abcde", 2, 2, "abcdefghij", 9, 1, -7); - test("abcde", 2, 2, "abcdefghij", 9, 2, -7); - test("abcde", 2, 2, "abcdefghij", 10, 0, 2); - test("abcde", 2, 2, "abcdefghij", 10, 1, 2); - test("abcde", 2, 2, "abcdefghij", 11, 0, 0); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 1, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 10, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 19, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 20, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 0, 21, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 1, 1); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 9, 1); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 18, 1); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 19, 1); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 1, 20, 1); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 1, -8); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 5, -8); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 9, -8); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 10, -8); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 10, 11, -8); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 1, -17); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 19, 2, -17); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 0, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 20, 1, 2); - test("abcde", 2, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 2, 3, "", 0, 0, 3); - test("abcde", 2, 3, "", 0, 1, 3); - test("abcde", 2, 3, "", 1, 0, 0); - test("abcde", 2, 3, "abcde", 0, 0, 3); - test("abcde", 2, 3, "abcde", 0, 1, 2); - test("abcde", 2, 3, "abcde", 0, 2, 2); - test("abcde", 2, 3, "abcde", 0, 4, 2); - test("abcde", 2, 3, "abcde", 0, 5, 2); - test("abcde", 2, 3, "abcde", 0, 6, 2); - test("abcde", 2, 3, "abcde", 1, 0, 3); - test("abcde", 2, 3, "abcde", 1, 1, 1); - test("abcde", 2, 3, "abcde", 1, 2, 1); - test("abcde", 2, 3, "abcde", 1, 3, 1); - test("abcde", 2, 3, "abcde", 1, 4, 1); - test("abcde", 2, 3, "abcde", 1, 5, 1); - test("abcde", 2, 3, "abcde", 2, 0, 3); - test("abcde", 2, 3, "abcde", 2, 1, 2); - test("abcde", 2, 3, "abcde", 2, 2, 1); - test("abcde", 2, 3, "abcde", 2, 3, 0); - test("abcde", 2, 3, "abcde", 2, 4, 0); - test("abcde", 2, 3, "abcde", 4, 0, 3); - test("abcde", 2, 3, "abcde", 4, 1, -2); - test("abcde", 2, 3, "abcde", 4, 2, -2); - test("abcde", 2, 3, "abcde", 5, 0, 3); - test("abcde", 2, 3, "abcde", 5, 1, 3); - test("abcde", 2, 3, "abcde", 6, 0, 0); - test("abcde", 2, 3, "abcdefghij", 0, 0, 3); - test("abcde", 2, 3, "abcdefghij", 0, 1, 2); - test("abcde", 2, 3, "abcdefghij", 0, 5, 2); - test("abcde", 2, 3, "abcdefghij", 0, 9, 2); - test("abcde", 2, 3, "abcdefghij", 0, 10, 2); - test("abcde", 2, 3, "abcdefghij", 0, 11, 2); - test("abcde", 2, 3, "abcdefghij", 1, 0, 3); - test("abcde", 2, 3, "abcdefghij", 1, 1, 1); - test("abcde", 2, 3, "abcdefghij", 1, 4, 1); - test("abcde", 2, 3, "abcdefghij", 1, 8, 1); - test("abcde", 2, 3, "abcdefghij", 1, 9, 1); - test("abcde", 2, 3, "abcdefghij", 1, 10, 1); - test("abcde", 2, 3, "abcdefghij", 5, 0, 3); - test("abcde", 2, 3, "abcdefghij", 5, 1, -3); - test("abcde", 2, 3, "abcdefghij", 5, 2, -3); - test("abcde", 2, 3, "abcdefghij", 5, 4, -3); - test("abcde", 2, 3, "abcdefghij", 5, 5, -3); - test("abcde", 2, 3, "abcdefghij", 5, 6, -3); - test("abcde", 2, 3, "abcdefghij", 9, 0, 3); - test("abcde", 2, 3, "abcdefghij", 9, 1, -7); - test("abcde", 2, 3, "abcdefghij", 9, 2, -7); - test("abcde", 2, 3, "abcdefghij", 10, 0, 3); - test("abcde", 2, 3, "abcdefghij", 10, 1, 3); - test("abcde", 2, 3, "abcdefghij", 11, 0, 0); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 0, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 1, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 10, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 19, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 20, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 0, 21, 2); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 0, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 1, 1); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 9, 1); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 18, 1); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 19, 1); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 1, 20, 1); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 0, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 1, -8); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 5, -8); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 9, -8); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 10, -8); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 10, 11, -8); -} - -void test14() -{ - test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 0, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 1, -17); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 19, 2, -17); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 0, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 20, 1, 3); - test("abcde", 2, 3, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 2, 4, "", 0, 0, 3); - test("abcde", 2, 4, "", 0, 1, 3); - test("abcde", 2, 4, "", 1, 0, 0); - test("abcde", 2, 4, "abcde", 0, 0, 3); - test("abcde", 2, 4, "abcde", 0, 1, 2); - test("abcde", 2, 4, "abcde", 0, 2, 2); - test("abcde", 2, 4, "abcde", 0, 4, 2); - test("abcde", 2, 4, "abcde", 0, 5, 2); - test("abcde", 2, 4, "abcde", 0, 6, 2); - test("abcde", 2, 4, "abcde", 1, 0, 3); - test("abcde", 2, 4, "abcde", 1, 1, 1); - test("abcde", 2, 4, "abcde", 1, 2, 1); - test("abcde", 2, 4, "abcde", 1, 3, 1); - test("abcde", 2, 4, "abcde", 1, 4, 1); - test("abcde", 2, 4, "abcde", 1, 5, 1); - test("abcde", 2, 4, "abcde", 2, 0, 3); - test("abcde", 2, 4, "abcde", 2, 1, 2); - test("abcde", 2, 4, "abcde", 2, 2, 1); - test("abcde", 2, 4, "abcde", 2, 3, 0); - test("abcde", 2, 4, "abcde", 2, 4, 0); - test("abcde", 2, 4, "abcde", 4, 0, 3); - test("abcde", 2, 4, "abcde", 4, 1, -2); - test("abcde", 2, 4, "abcde", 4, 2, -2); - test("abcde", 2, 4, "abcde", 5, 0, 3); - test("abcde", 2, 4, "abcde", 5, 1, 3); - test("abcde", 2, 4, "abcde", 6, 0, 0); - test("abcde", 2, 4, "abcdefghij", 0, 0, 3); - test("abcde", 2, 4, "abcdefghij", 0, 1, 2); - test("abcde", 2, 4, "abcdefghij", 0, 5, 2); - test("abcde", 2, 4, "abcdefghij", 0, 9, 2); - test("abcde", 2, 4, "abcdefghij", 0, 10, 2); - test("abcde", 2, 4, "abcdefghij", 0, 11, 2); - test("abcde", 2, 4, "abcdefghij", 1, 0, 3); - test("abcde", 2, 4, "abcdefghij", 1, 1, 1); - test("abcde", 2, 4, "abcdefghij", 1, 4, 1); - test("abcde", 2, 4, "abcdefghij", 1, 8, 1); - test("abcde", 2, 4, "abcdefghij", 1, 9, 1); - test("abcde", 2, 4, "abcdefghij", 1, 10, 1); - test("abcde", 2, 4, "abcdefghij", 5, 0, 3); - test("abcde", 2, 4, "abcdefghij", 5, 1, -3); - test("abcde", 2, 4, "abcdefghij", 5, 2, -3); - test("abcde", 2, 4, "abcdefghij", 5, 4, -3); - test("abcde", 2, 4, "abcdefghij", 5, 5, -3); - test("abcde", 2, 4, "abcdefghij", 5, 6, -3); - test("abcde", 2, 4, "abcdefghij", 9, 0, 3); - test("abcde", 2, 4, "abcdefghij", 9, 1, -7); - test("abcde", 2, 4, "abcdefghij", 9, 2, -7); - test("abcde", 2, 4, "abcdefghij", 10, 0, 3); - test("abcde", 2, 4, "abcdefghij", 10, 1, 3); - test("abcde", 2, 4, "abcdefghij", 11, 0, 0); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 1, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 10, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 19, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 20, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 0, 21, 2); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 1, 1); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 9, 1); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 18, 1); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 19, 1); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 1, 20, 1); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 1, -8); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 5, -8); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 9, -8); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 10, -8); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 10, 11, -8); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 1, -17); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 19, 2, -17); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 0, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 20, 1, 3); - test("abcde", 2, 4, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 4, 0, "", 0, 0, 0); - test("abcde", 4, 0, "", 0, 1, 0); - test("abcde", 4, 0, "", 1, 0, 0); - test("abcde", 4, 0, "abcde", 0, 0, 0); - test("abcde", 4, 0, "abcde", 0, 1, -1); - test("abcde", 4, 0, "abcde", 0, 2, -2); - test("abcde", 4, 0, "abcde", 0, 4, -4); - test("abcde", 4, 0, "abcde", 0, 5, -5); - test("abcde", 4, 0, "abcde", 0, 6, -5); - test("abcde", 4, 0, "abcde", 1, 0, 0); - test("abcde", 4, 0, "abcde", 1, 1, -1); - test("abcde", 4, 0, "abcde", 1, 2, -2); - test("abcde", 4, 0, "abcde", 1, 3, -3); - test("abcde", 4, 0, "abcde", 1, 4, -4); - test("abcde", 4, 0, "abcde", 1, 5, -4); - test("abcde", 4, 0, "abcde", 2, 0, 0); - test("abcde", 4, 0, "abcde", 2, 1, -1); - test("abcde", 4, 0, "abcde", 2, 2, -2); - test("abcde", 4, 0, "abcde", 2, 3, -3); - test("abcde", 4, 0, "abcde", 2, 4, -3); -} - -void test15() -{ - test("abcde", 4, 0, "abcde", 4, 0, 0); - test("abcde", 4, 0, "abcde", 4, 1, -1); - test("abcde", 4, 0, "abcde", 4, 2, -1); - test("abcde", 4, 0, "abcde", 5, 0, 0); - test("abcde", 4, 0, "abcde", 5, 1, 0); - test("abcde", 4, 0, "abcde", 6, 0, 0); - test("abcde", 4, 0, "abcdefghij", 0, 0, 0); - test("abcde", 4, 0, "abcdefghij", 0, 1, -1); - test("abcde", 4, 0, "abcdefghij", 0, 5, -5); - test("abcde", 4, 0, "abcdefghij", 0, 9, -9); - test("abcde", 4, 0, "abcdefghij", 0, 10, -10); - test("abcde", 4, 0, "abcdefghij", 0, 11, -10); - test("abcde", 4, 0, "abcdefghij", 1, 0, 0); - test("abcde", 4, 0, "abcdefghij", 1, 1, -1); - test("abcde", 4, 0, "abcdefghij", 1, 4, -4); - test("abcde", 4, 0, "abcdefghij", 1, 8, -8); - test("abcde", 4, 0, "abcdefghij", 1, 9, -9); - test("abcde", 4, 0, "abcdefghij", 1, 10, -9); - test("abcde", 4, 0, "abcdefghij", 5, 0, 0); - test("abcde", 4, 0, "abcdefghij", 5, 1, -1); - test("abcde", 4, 0, "abcdefghij", 5, 2, -2); - test("abcde", 4, 0, "abcdefghij", 5, 4, -4); - test("abcde", 4, 0, "abcdefghij", 5, 5, -5); - test("abcde", 4, 0, "abcdefghij", 5, 6, -5); - test("abcde", 4, 0, "abcdefghij", 9, 0, 0); - test("abcde", 4, 0, "abcdefghij", 9, 1, -1); - test("abcde", 4, 0, "abcdefghij", 9, 2, -1); - test("abcde", 4, 0, "abcdefghij", 10, 0, 0); - test("abcde", 4, 0, "abcdefghij", 10, 1, 0); - test("abcde", 4, 0, "abcdefghij", 11, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 4, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 4, 1, "", 0, 0, 1); - test("abcde", 4, 1, "", 0, 1, 1); - test("abcde", 4, 1, "", 1, 0, 0); - test("abcde", 4, 1, "abcde", 0, 0, 1); - test("abcde", 4, 1, "abcde", 0, 1, 4); - test("abcde", 4, 1, "abcde", 0, 2, 4); - test("abcde", 4, 1, "abcde", 0, 4, 4); - test("abcde", 4, 1, "abcde", 0, 5, 4); - test("abcde", 4, 1, "abcde", 0, 6, 4); - test("abcde", 4, 1, "abcde", 1, 0, 1); - test("abcde", 4, 1, "abcde", 1, 1, 3); - test("abcde", 4, 1, "abcde", 1, 2, 3); - test("abcde", 4, 1, "abcde", 1, 3, 3); - test("abcde", 4, 1, "abcde", 1, 4, 3); - test("abcde", 4, 1, "abcde", 1, 5, 3); - test("abcde", 4, 1, "abcde", 2, 0, 1); - test("abcde", 4, 1, "abcde", 2, 1, 2); - test("abcde", 4, 1, "abcde", 2, 2, 2); - test("abcde", 4, 1, "abcde", 2, 3, 2); - test("abcde", 4, 1, "abcde", 2, 4, 2); - test("abcde", 4, 1, "abcde", 4, 0, 1); - test("abcde", 4, 1, "abcde", 4, 1, 0); - test("abcde", 4, 1, "abcde", 4, 2, 0); - test("abcde", 4, 1, "abcde", 5, 0, 1); - test("abcde", 4, 1, "abcde", 5, 1, 1); - test("abcde", 4, 1, "abcde", 6, 0, 0); - test("abcde", 4, 1, "abcdefghij", 0, 0, 1); - test("abcde", 4, 1, "abcdefghij", 0, 1, 4); - test("abcde", 4, 1, "abcdefghij", 0, 5, 4); - test("abcde", 4, 1, "abcdefghij", 0, 9, 4); - test("abcde", 4, 1, "abcdefghij", 0, 10, 4); - test("abcde", 4, 1, "abcdefghij", 0, 11, 4); - test("abcde", 4, 1, "abcdefghij", 1, 0, 1); - test("abcde", 4, 1, "abcdefghij", 1, 1, 3); - test("abcde", 4, 1, "abcdefghij", 1, 4, 3); - test("abcde", 4, 1, "abcdefghij", 1, 8, 3); - test("abcde", 4, 1, "abcdefghij", 1, 9, 3); - test("abcde", 4, 1, "abcdefghij", 1, 10, 3); - test("abcde", 4, 1, "abcdefghij", 5, 0, 1); - test("abcde", 4, 1, "abcdefghij", 5, 1, -1); - test("abcde", 4, 1, "abcdefghij", 5, 2, -1); - test("abcde", 4, 1, "abcdefghij", 5, 4, -1); - test("abcde", 4, 1, "abcdefghij", 5, 5, -1); - test("abcde", 4, 1, "abcdefghij", 5, 6, -1); - test("abcde", 4, 1, "abcdefghij", 9, 0, 1); - test("abcde", 4, 1, "abcdefghij", 9, 1, -5); -} - -void test16() -{ - test("abcde", 4, 1, "abcdefghij", 9, 2, -5); - test("abcde", 4, 1, "abcdefghij", 10, 0, 1); - test("abcde", 4, 1, "abcdefghij", 10, 1, 1); - test("abcde", 4, 1, "abcdefghij", 11, 0, 0); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 1, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 10, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 19, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 20, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 0, 21, 4); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 1, 3); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 9, 3); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 18, 3); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 19, 3); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 1, 20, 3); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 1, -6); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 5, -6); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 9, -6); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 10, -6); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 10, 11, -6); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 1, -15); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 19, 2, -15); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcde", 4, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 4, 2, "", 0, 0, 1); - test("abcde", 4, 2, "", 0, 1, 1); - test("abcde", 4, 2, "", 1, 0, 0); - test("abcde", 4, 2, "abcde", 0, 0, 1); - test("abcde", 4, 2, "abcde", 0, 1, 4); - test("abcde", 4, 2, "abcde", 0, 2, 4); - test("abcde", 4, 2, "abcde", 0, 4, 4); - test("abcde", 4, 2, "abcde", 0, 5, 4); - test("abcde", 4, 2, "abcde", 0, 6, 4); - test("abcde", 4, 2, "abcde", 1, 0, 1); - test("abcde", 4, 2, "abcde", 1, 1, 3); - test("abcde", 4, 2, "abcde", 1, 2, 3); - test("abcde", 4, 2, "abcde", 1, 3, 3); - test("abcde", 4, 2, "abcde", 1, 4, 3); - test("abcde", 4, 2, "abcde", 1, 5, 3); - test("abcde", 4, 2, "abcde", 2, 0, 1); - test("abcde", 4, 2, "abcde", 2, 1, 2); - test("abcde", 4, 2, "abcde", 2, 2, 2); - test("abcde", 4, 2, "abcde", 2, 3, 2); - test("abcde", 4, 2, "abcde", 2, 4, 2); - test("abcde", 4, 2, "abcde", 4, 0, 1); - test("abcde", 4, 2, "abcde", 4, 1, 0); - test("abcde", 4, 2, "abcde", 4, 2, 0); - test("abcde", 4, 2, "abcde", 5, 0, 1); - test("abcde", 4, 2, "abcde", 5, 1, 1); - test("abcde", 4, 2, "abcde", 6, 0, 0); - test("abcde", 4, 2, "abcdefghij", 0, 0, 1); - test("abcde", 4, 2, "abcdefghij", 0, 1, 4); - test("abcde", 4, 2, "abcdefghij", 0, 5, 4); - test("abcde", 4, 2, "abcdefghij", 0, 9, 4); - test("abcde", 4, 2, "abcdefghij", 0, 10, 4); - test("abcde", 4, 2, "abcdefghij", 0, 11, 4); - test("abcde", 4, 2, "abcdefghij", 1, 0, 1); - test("abcde", 4, 2, "abcdefghij", 1, 1, 3); - test("abcde", 4, 2, "abcdefghij", 1, 4, 3); - test("abcde", 4, 2, "abcdefghij", 1, 8, 3); - test("abcde", 4, 2, "abcdefghij", 1, 9, 3); - test("abcde", 4, 2, "abcdefghij", 1, 10, 3); - test("abcde", 4, 2, "abcdefghij", 5, 0, 1); - test("abcde", 4, 2, "abcdefghij", 5, 1, -1); - test("abcde", 4, 2, "abcdefghij", 5, 2, -1); - test("abcde", 4, 2, "abcdefghij", 5, 4, -1); - test("abcde", 4, 2, "abcdefghij", 5, 5, -1); - test("abcde", 4, 2, "abcdefghij", 5, 6, -1); - test("abcde", 4, 2, "abcdefghij", 9, 0, 1); - test("abcde", 4, 2, "abcdefghij", 9, 1, -5); - test("abcde", 4, 2, "abcdefghij", 9, 2, -5); - test("abcde", 4, 2, "abcdefghij", 10, 0, 1); - test("abcde", 4, 2, "abcdefghij", 10, 1, 1); - test("abcde", 4, 2, "abcdefghij", 11, 0, 0); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 1, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 10, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 19, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 20, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 0, 21, 4); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 1, 3); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 9, 3); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 18, 3); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 19, 3); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 1, 20, 3); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 1, -6); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 5, -6); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 9, -6); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 10, -6); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 10, 11, -6); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 1, -15); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 19, 2, -15); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 0, 1); -} - -void test17() -{ - test("abcde", 4, 2, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcde", 4, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 5, 0, "", 0, 0, 0); - test("abcde", 5, 0, "", 0, 1, 0); - test("abcde", 5, 0, "", 1, 0, 0); - test("abcde", 5, 0, "abcde", 0, 0, 0); - test("abcde", 5, 0, "abcde", 0, 1, -1); - test("abcde", 5, 0, "abcde", 0, 2, -2); - test("abcde", 5, 0, "abcde", 0, 4, -4); - test("abcde", 5, 0, "abcde", 0, 5, -5); - test("abcde", 5, 0, "abcde", 0, 6, -5); - test("abcde", 5, 0, "abcde", 1, 0, 0); - test("abcde", 5, 0, "abcde", 1, 1, -1); - test("abcde", 5, 0, "abcde", 1, 2, -2); - test("abcde", 5, 0, "abcde", 1, 3, -3); - test("abcde", 5, 0, "abcde", 1, 4, -4); - test("abcde", 5, 0, "abcde", 1, 5, -4); - test("abcde", 5, 0, "abcde", 2, 0, 0); - test("abcde", 5, 0, "abcde", 2, 1, -1); - test("abcde", 5, 0, "abcde", 2, 2, -2); - test("abcde", 5, 0, "abcde", 2, 3, -3); - test("abcde", 5, 0, "abcde", 2, 4, -3); - test("abcde", 5, 0, "abcde", 4, 0, 0); - test("abcde", 5, 0, "abcde", 4, 1, -1); - test("abcde", 5, 0, "abcde", 4, 2, -1); - test("abcde", 5, 0, "abcde", 5, 0, 0); - test("abcde", 5, 0, "abcde", 5, 1, 0); - test("abcde", 5, 0, "abcde", 6, 0, 0); - test("abcde", 5, 0, "abcdefghij", 0, 0, 0); - test("abcde", 5, 0, "abcdefghij", 0, 1, -1); - test("abcde", 5, 0, "abcdefghij", 0, 5, -5); - test("abcde", 5, 0, "abcdefghij", 0, 9, -9); - test("abcde", 5, 0, "abcdefghij", 0, 10, -10); - test("abcde", 5, 0, "abcdefghij", 0, 11, -10); - test("abcde", 5, 0, "abcdefghij", 1, 0, 0); - test("abcde", 5, 0, "abcdefghij", 1, 1, -1); - test("abcde", 5, 0, "abcdefghij", 1, 4, -4); - test("abcde", 5, 0, "abcdefghij", 1, 8, -8); - test("abcde", 5, 0, "abcdefghij", 1, 9, -9); - test("abcde", 5, 0, "abcdefghij", 1, 10, -9); - test("abcde", 5, 0, "abcdefghij", 5, 0, 0); - test("abcde", 5, 0, "abcdefghij", 5, 1, -1); - test("abcde", 5, 0, "abcdefghij", 5, 2, -2); - test("abcde", 5, 0, "abcdefghij", 5, 4, -4); - test("abcde", 5, 0, "abcdefghij", 5, 5, -5); - test("abcde", 5, 0, "abcdefghij", 5, 6, -5); - test("abcde", 5, 0, "abcdefghij", 9, 0, 0); - test("abcde", 5, 0, "abcdefghij", 9, 1, -1); - test("abcde", 5, 0, "abcdefghij", 9, 2, -1); - test("abcde", 5, 0, "abcdefghij", 10, 0, 0); - test("abcde", 5, 0, "abcdefghij", 10, 1, 0); - test("abcde", 5, 0, "abcdefghij", 11, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 5, 1, "", 0, 0, 0); - test("abcde", 5, 1, "", 0, 1, 0); - test("abcde", 5, 1, "", 1, 0, 0); - test("abcde", 5, 1, "abcde", 0, 0, 0); - test("abcde", 5, 1, "abcde", 0, 1, -1); - test("abcde", 5, 1, "abcde", 0, 2, -2); - test("abcde", 5, 1, "abcde", 0, 4, -4); - test("abcde", 5, 1, "abcde", 0, 5, -5); - test("abcde", 5, 1, "abcde", 0, 6, -5); - test("abcde", 5, 1, "abcde", 1, 0, 0); - test("abcde", 5, 1, "abcde", 1, 1, -1); - test("abcde", 5, 1, "abcde", 1, 2, -2); - test("abcde", 5, 1, "abcde", 1, 3, -3); - test("abcde", 5, 1, "abcde", 1, 4, -4); - test("abcde", 5, 1, "abcde", 1, 5, -4); - test("abcde", 5, 1, "abcde", 2, 0, 0); - test("abcde", 5, 1, "abcde", 2, 1, -1); - test("abcde", 5, 1, "abcde", 2, 2, -2); - test("abcde", 5, 1, "abcde", 2, 3, -3); - test("abcde", 5, 1, "abcde", 2, 4, -3); - test("abcde", 5, 1, "abcde", 4, 0, 0); - test("abcde", 5, 1, "abcde", 4, 1, -1); - test("abcde", 5, 1, "abcde", 4, 2, -1); - test("abcde", 5, 1, "abcde", 5, 0, 0); -} - -void test18() -{ - test("abcde", 5, 1, "abcde", 5, 1, 0); - test("abcde", 5, 1, "abcde", 6, 0, 0); - test("abcde", 5, 1, "abcdefghij", 0, 0, 0); - test("abcde", 5, 1, "abcdefghij", 0, 1, -1); - test("abcde", 5, 1, "abcdefghij", 0, 5, -5); - test("abcde", 5, 1, "abcdefghij", 0, 9, -9); - test("abcde", 5, 1, "abcdefghij", 0, 10, -10); - test("abcde", 5, 1, "abcdefghij", 0, 11, -10); - test("abcde", 5, 1, "abcdefghij", 1, 0, 0); - test("abcde", 5, 1, "abcdefghij", 1, 1, -1); - test("abcde", 5, 1, "abcdefghij", 1, 4, -4); - test("abcde", 5, 1, "abcdefghij", 1, 8, -8); - test("abcde", 5, 1, "abcdefghij", 1, 9, -9); - test("abcde", 5, 1, "abcdefghij", 1, 10, -9); - test("abcde", 5, 1, "abcdefghij", 5, 0, 0); - test("abcde", 5, 1, "abcdefghij", 5, 1, -1); - test("abcde", 5, 1, "abcdefghij", 5, 2, -2); - test("abcde", 5, 1, "abcdefghij", 5, 4, -4); - test("abcde", 5, 1, "abcdefghij", 5, 5, -5); - test("abcde", 5, 1, "abcdefghij", 5, 6, -5); - test("abcde", 5, 1, "abcdefghij", 9, 0, 0); - test("abcde", 5, 1, "abcdefghij", 9, 1, -1); - test("abcde", 5, 1, "abcdefghij", 9, 2, -1); - test("abcde", 5, 1, "abcdefghij", 10, 0, 0); - test("abcde", 5, 1, "abcdefghij", 10, 1, 0); - test("abcde", 5, 1, "abcdefghij", 11, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcde", 6, 0, "", 0, 0, 0); - test("abcde", 6, 0, "", 0, 1, 0); - test("abcde", 6, 0, "", 1, 0, 0); - test("abcde", 6, 0, "abcde", 0, 0, 0); - test("abcde", 6, 0, "abcde", 0, 1, 0); - test("abcde", 6, 0, "abcde", 0, 2, 0); - test("abcde", 6, 0, "abcde", 0, 4, 0); - test("abcde", 6, 0, "abcde", 0, 5, 0); - test("abcde", 6, 0, "abcde", 0, 6, 0); - test("abcde", 6, 0, "abcde", 1, 0, 0); - test("abcde", 6, 0, "abcde", 1, 1, 0); - test("abcde", 6, 0, "abcde", 1, 2, 0); - test("abcde", 6, 0, "abcde", 1, 3, 0); - test("abcde", 6, 0, "abcde", 1, 4, 0); - test("abcde", 6, 0, "abcde", 1, 5, 0); - test("abcde", 6, 0, "abcde", 2, 0, 0); - test("abcde", 6, 0, "abcde", 2, 1, 0); - test("abcde", 6, 0, "abcde", 2, 2, 0); - test("abcde", 6, 0, "abcde", 2, 3, 0); - test("abcde", 6, 0, "abcde", 2, 4, 0); - test("abcde", 6, 0, "abcde", 4, 0, 0); - test("abcde", 6, 0, "abcde", 4, 1, 0); - test("abcde", 6, 0, "abcde", 4, 2, 0); - test("abcde", 6, 0, "abcde", 5, 0, 0); - test("abcde", 6, 0, "abcde", 5, 1, 0); - test("abcde", 6, 0, "abcde", 6, 0, 0); - test("abcde", 6, 0, "abcdefghij", 0, 0, 0); - test("abcde", 6, 0, "abcdefghij", 0, 1, 0); - test("abcde", 6, 0, "abcdefghij", 0, 5, 0); - test("abcde", 6, 0, "abcdefghij", 0, 9, 0); - test("abcde", 6, 0, "abcdefghij", 0, 10, 0); - test("abcde", 6, 0, "abcdefghij", 0, 11, 0); - test("abcde", 6, 0, "abcdefghij", 1, 0, 0); - test("abcde", 6, 0, "abcdefghij", 1, 1, 0); - test("abcde", 6, 0, "abcdefghij", 1, 4, 0); - test("abcde", 6, 0, "abcdefghij", 1, 8, 0); - test("abcde", 6, 0, "abcdefghij", 1, 9, 0); - test("abcde", 6, 0, "abcdefghij", 1, 10, 0); - test("abcde", 6, 0, "abcdefghij", 5, 0, 0); - test("abcde", 6, 0, "abcdefghij", 5, 1, 0); - test("abcde", 6, 0, "abcdefghij", 5, 2, 0); - test("abcde", 6, 0, "abcdefghij", 5, 4, 0); - test("abcde", 6, 0, "abcdefghij", 5, 5, 0); - test("abcde", 6, 0, "abcdefghij", 5, 6, 0); - test("abcde", 6, 0, "abcdefghij", 9, 0, 0); - test("abcde", 6, 0, "abcdefghij", 9, 1, 0); - test("abcde", 6, 0, "abcdefghij", 9, 2, 0); - test("abcde", 6, 0, "abcdefghij", 10, 0, 0); - test("abcde", 6, 0, "abcdefghij", 10, 1, 0); - test("abcde", 6, 0, "abcdefghij", 11, 0, 0); -} - -void test19() -{ - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 19, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 20, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 0, 21, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 18, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 19, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 1, 20, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 5, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 9, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 10, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 10, 11, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 19, 2, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcde", 6, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 0, "", 0, 0, 0); - test("abcdefghij", 0, 0, "", 0, 1, 0); - test("abcdefghij", 0, 0, "", 1, 0, 0); - test("abcdefghij", 0, 0, "abcde", 0, 0, 0); - test("abcdefghij", 0, 0, "abcde", 0, 1, -1); - test("abcdefghij", 0, 0, "abcde", 0, 2, -2); - test("abcdefghij", 0, 0, "abcde", 0, 4, -4); - test("abcdefghij", 0, 0, "abcde", 0, 5, -5); - test("abcdefghij", 0, 0, "abcde", 0, 6, -5); - test("abcdefghij", 0, 0, "abcde", 1, 0, 0); - test("abcdefghij", 0, 0, "abcde", 1, 1, -1); - test("abcdefghij", 0, 0, "abcde", 1, 2, -2); - test("abcdefghij", 0, 0, "abcde", 1, 3, -3); - test("abcdefghij", 0, 0, "abcde", 1, 4, -4); - test("abcdefghij", 0, 0, "abcde", 1, 5, -4); - test("abcdefghij", 0, 0, "abcde", 2, 0, 0); - test("abcdefghij", 0, 0, "abcde", 2, 1, -1); - test("abcdefghij", 0, 0, "abcde", 2, 2, -2); - test("abcdefghij", 0, 0, "abcde", 2, 3, -3); - test("abcdefghij", 0, 0, "abcde", 2, 4, -3); - test("abcdefghij", 0, 0, "abcde", 4, 0, 0); - test("abcdefghij", 0, 0, "abcde", 4, 1, -1); - test("abcdefghij", 0, 0, "abcde", 4, 2, -1); - test("abcdefghij", 0, 0, "abcde", 5, 0, 0); - test("abcdefghij", 0, 0, "abcde", 5, 1, 0); - test("abcdefghij", 0, 0, "abcde", 6, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 0, 1, -1); - test("abcdefghij", 0, 0, "abcdefghij", 0, 5, -5); - test("abcdefghij", 0, 0, "abcdefghij", 0, 9, -9); - test("abcdefghij", 0, 0, "abcdefghij", 0, 10, -10); - test("abcdefghij", 0, 0, "abcdefghij", 0, 11, -10); - test("abcdefghij", 0, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 0, "abcdefghij", 1, 4, -4); - test("abcdefghij", 0, 0, "abcdefghij", 1, 8, -8); - test("abcdefghij", 0, 0, "abcdefghij", 1, 9, -9); - test("abcdefghij", 0, 0, "abcdefghij", 1, 10, -9); - test("abcdefghij", 0, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 5, 1, -1); - test("abcdefghij", 0, 0, "abcdefghij", 5, 2, -2); - test("abcdefghij", 0, 0, "abcdefghij", 5, 4, -4); - test("abcdefghij", 0, 0, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 0, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 9, 1, -1); - test("abcdefghij", 0, 0, "abcdefghij", 9, 2, -1); - test("abcdefghij", 0, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 0, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 0, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 1, "", 0, 0, 1); - test("abcdefghij", 0, 1, "", 0, 1, 1); -} - -void test20() -{ - test("abcdefghij", 0, 1, "", 1, 0, 0); - test("abcdefghij", 0, 1, "abcde", 0, 0, 1); - test("abcdefghij", 0, 1, "abcde", 0, 1, 0); - test("abcdefghij", 0, 1, "abcde", 0, 2, -1); - test("abcdefghij", 0, 1, "abcde", 0, 4, -3); - test("abcdefghij", 0, 1, "abcde", 0, 5, -4); - test("abcdefghij", 0, 1, "abcde", 0, 6, -4); - test("abcdefghij", 0, 1, "abcde", 1, 0, 1); - test("abcdefghij", 0, 1, "abcde", 1, 1, -1); - test("abcdefghij", 0, 1, "abcde", 1, 2, -1); - test("abcdefghij", 0, 1, "abcde", 1, 3, -1); - test("abcdefghij", 0, 1, "abcde", 1, 4, -1); - test("abcdefghij", 0, 1, "abcde", 1, 5, -1); - test("abcdefghij", 0, 1, "abcde", 2, 0, 1); - test("abcdefghij", 0, 1, "abcde", 2, 1, -2); - test("abcdefghij", 0, 1, "abcde", 2, 2, -2); - test("abcdefghij", 0, 1, "abcde", 2, 3, -2); - test("abcdefghij", 0, 1, "abcde", 2, 4, -2); - test("abcdefghij", 0, 1, "abcde", 4, 0, 1); - test("abcdefghij", 0, 1, "abcde", 4, 1, -4); - test("abcdefghij", 0, 1, "abcde", 4, 2, -4); - test("abcdefghij", 0, 1, "abcde", 5, 0, 1); - test("abcdefghij", 0, 1, "abcde", 5, 1, 1); - test("abcdefghij", 0, 1, "abcde", 6, 0, 0); - test("abcdefghij", 0, 1, "abcdefghij", 0, 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 0, 1, 0); - test("abcdefghij", 0, 1, "abcdefghij", 0, 5, -4); - test("abcdefghij", 0, 1, "abcdefghij", 0, 9, -8); - test("abcdefghij", 0, 1, "abcdefghij", 0, 10, -9); - test("abcdefghij", 0, 1, "abcdefghij", 0, 11, -9); - test("abcdefghij", 0, 1, "abcdefghij", 1, 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 4, -1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 8, -1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 9, -1); - test("abcdefghij", 0, 1, "abcdefghij", 1, 10, -1); - test("abcdefghij", 0, 1, "abcdefghij", 5, 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 5, 1, -5); - test("abcdefghij", 0, 1, "abcdefghij", 5, 2, -5); - test("abcdefghij", 0, 1, "abcdefghij", 5, 4, -5); - test("abcdefghij", 0, 1, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 1, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 1, "abcdefghij", 9, 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 9, 1, -9); - test("abcdefghij", 0, 1, "abcdefghij", 9, 2, -9); - test("abcdefghij", 0, 1, "abcdefghij", 10, 0, 1); - test("abcdefghij", 0, 1, "abcdefghij", 10, 1, 1); - test("abcdefghij", 0, 1, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghij", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 5, "", 0, 0, 5); - test("abcdefghij", 0, 5, "", 0, 1, 5); - test("abcdefghij", 0, 5, "", 1, 0, 0); - test("abcdefghij", 0, 5, "abcde", 0, 0, 5); - test("abcdefghij", 0, 5, "abcde", 0, 1, 4); - test("abcdefghij", 0, 5, "abcde", 0, 2, 3); - test("abcdefghij", 0, 5, "abcde", 0, 4, 1); - test("abcdefghij", 0, 5, "abcde", 0, 5, 0); - test("abcdefghij", 0, 5, "abcde", 0, 6, 0); - test("abcdefghij", 0, 5, "abcde", 1, 0, 5); - test("abcdefghij", 0, 5, "abcde", 1, 1, -1); - test("abcdefghij", 0, 5, "abcde", 1, 2, -1); - test("abcdefghij", 0, 5, "abcde", 1, 3, -1); - test("abcdefghij", 0, 5, "abcde", 1, 4, -1); - test("abcdefghij", 0, 5, "abcde", 1, 5, -1); - test("abcdefghij", 0, 5, "abcde", 2, 0, 5); - test("abcdefghij", 0, 5, "abcde", 2, 1, -2); - test("abcdefghij", 0, 5, "abcde", 2, 2, -2); - test("abcdefghij", 0, 5, "abcde", 2, 3, -2); - test("abcdefghij", 0, 5, "abcde", 2, 4, -2); - test("abcdefghij", 0, 5, "abcde", 4, 0, 5); - test("abcdefghij", 0, 5, "abcde", 4, 1, -4); - test("abcdefghij", 0, 5, "abcde", 4, 2, -4); - test("abcdefghij", 0, 5, "abcde", 5, 0, 5); - test("abcdefghij", 0, 5, "abcde", 5, 1, 5); - test("abcdefghij", 0, 5, "abcde", 6, 0, 0); - test("abcdefghij", 0, 5, "abcdefghij", 0, 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 0, 1, 4); -} - -void test21() -{ - test("abcdefghij", 0, 5, "abcdefghij", 0, 5, 0); - test("abcdefghij", 0, 5, "abcdefghij", 0, 9, -4); - test("abcdefghij", 0, 5, "abcdefghij", 0, 10, -5); - test("abcdefghij", 0, 5, "abcdefghij", 0, 11, -5); - test("abcdefghij", 0, 5, "abcdefghij", 1, 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 5, "abcdefghij", 1, 4, -1); - test("abcdefghij", 0, 5, "abcdefghij", 1, 8, -1); - test("abcdefghij", 0, 5, "abcdefghij", 1, 9, -1); - test("abcdefghij", 0, 5, "abcdefghij", 1, 10, -1); - test("abcdefghij", 0, 5, "abcdefghij", 5, 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 5, 1, -5); - test("abcdefghij", 0, 5, "abcdefghij", 5, 2, -5); - test("abcdefghij", 0, 5, "abcdefghij", 5, 4, -5); - test("abcdefghij", 0, 5, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 5, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 5, "abcdefghij", 9, 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 9, 1, -9); - test("abcdefghij", 0, 5, "abcdefghij", 9, 2, -9); - test("abcdefghij", 0, 5, "abcdefghij", 10, 0, 5); - test("abcdefghij", 0, 5, "abcdefghij", 10, 1, 5); - test("abcdefghij", 0, 5, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 1, 4); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 10, -5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 19, -14); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 20, -15); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 0, 21, -15); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcdefghij", 0, 5, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 9, "", 0, 0, 9); - test("abcdefghij", 0, 9, "", 0, 1, 9); - test("abcdefghij", 0, 9, "", 1, 0, 0); - test("abcdefghij", 0, 9, "abcde", 0, 0, 9); - test("abcdefghij", 0, 9, "abcde", 0, 1, 8); - test("abcdefghij", 0, 9, "abcde", 0, 2, 7); - test("abcdefghij", 0, 9, "abcde", 0, 4, 5); - test("abcdefghij", 0, 9, "abcde", 0, 5, 4); - test("abcdefghij", 0, 9, "abcde", 0, 6, 4); - test("abcdefghij", 0, 9, "abcde", 1, 0, 9); - test("abcdefghij", 0, 9, "abcde", 1, 1, -1); - test("abcdefghij", 0, 9, "abcde", 1, 2, -1); - test("abcdefghij", 0, 9, "abcde", 1, 3, -1); - test("abcdefghij", 0, 9, "abcde", 1, 4, -1); - test("abcdefghij", 0, 9, "abcde", 1, 5, -1); - test("abcdefghij", 0, 9, "abcde", 2, 0, 9); - test("abcdefghij", 0, 9, "abcde", 2, 1, -2); - test("abcdefghij", 0, 9, "abcde", 2, 2, -2); - test("abcdefghij", 0, 9, "abcde", 2, 3, -2); - test("abcdefghij", 0, 9, "abcde", 2, 4, -2); - test("abcdefghij", 0, 9, "abcde", 4, 0, 9); - test("abcdefghij", 0, 9, "abcde", 4, 1, -4); - test("abcdefghij", 0, 9, "abcde", 4, 2, -4); - test("abcdefghij", 0, 9, "abcde", 5, 0, 9); - test("abcdefghij", 0, 9, "abcde", 5, 1, 9); - test("abcdefghij", 0, 9, "abcde", 6, 0, 0); - test("abcdefghij", 0, 9, "abcdefghij", 0, 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 0, 1, 8); - test("abcdefghij", 0, 9, "abcdefghij", 0, 5, 4); - test("abcdefghij", 0, 9, "abcdefghij", 0, 9, 0); - test("abcdefghij", 0, 9, "abcdefghij", 0, 10, -1); - test("abcdefghij", 0, 9, "abcdefghij", 0, 11, -1); - test("abcdefghij", 0, 9, "abcdefghij", 1, 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 9, "abcdefghij", 1, 4, -1); - test("abcdefghij", 0, 9, "abcdefghij", 1, 8, -1); - test("abcdefghij", 0, 9, "abcdefghij", 1, 9, -1); - test("abcdefghij", 0, 9, "abcdefghij", 1, 10, -1); - test("abcdefghij", 0, 9, "abcdefghij", 5, 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 5, 1, -5); - test("abcdefghij", 0, 9, "abcdefghij", 5, 2, -5); - test("abcdefghij", 0, 9, "abcdefghij", 5, 4, -5); - test("abcdefghij", 0, 9, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 9, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 9, "abcdefghij", 9, 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 9, 1, -9); - test("abcdefghij", 0, 9, "abcdefghij", 9, 2, -9); - test("abcdefghij", 0, 9, "abcdefghij", 10, 0, 9); - test("abcdefghij", 0, 9, "abcdefghij", 10, 1, 9); - test("abcdefghij", 0, 9, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 1, 8); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 10, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 19, -10); -} - -void test22() -{ - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 20, -11); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 0, 21, -11); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 0, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 20, 1, 9); - test("abcdefghij", 0, 9, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 10, "", 0, 0, 10); - test("abcdefghij", 0, 10, "", 0, 1, 10); - test("abcdefghij", 0, 10, "", 1, 0, 0); - test("abcdefghij", 0, 10, "abcde", 0, 0, 10); - test("abcdefghij", 0, 10, "abcde", 0, 1, 9); - test("abcdefghij", 0, 10, "abcde", 0, 2, 8); - test("abcdefghij", 0, 10, "abcde", 0, 4, 6); - test("abcdefghij", 0, 10, "abcde", 0, 5, 5); - test("abcdefghij", 0, 10, "abcde", 0, 6, 5); - test("abcdefghij", 0, 10, "abcde", 1, 0, 10); - test("abcdefghij", 0, 10, "abcde", 1, 1, -1); - test("abcdefghij", 0, 10, "abcde", 1, 2, -1); - test("abcdefghij", 0, 10, "abcde", 1, 3, -1); - test("abcdefghij", 0, 10, "abcde", 1, 4, -1); - test("abcdefghij", 0, 10, "abcde", 1, 5, -1); - test("abcdefghij", 0, 10, "abcde", 2, 0, 10); - test("abcdefghij", 0, 10, "abcde", 2, 1, -2); - test("abcdefghij", 0, 10, "abcde", 2, 2, -2); - test("abcdefghij", 0, 10, "abcde", 2, 3, -2); - test("abcdefghij", 0, 10, "abcde", 2, 4, -2); - test("abcdefghij", 0, 10, "abcde", 4, 0, 10); - test("abcdefghij", 0, 10, "abcde", 4, 1, -4); - test("abcdefghij", 0, 10, "abcde", 4, 2, -4); - test("abcdefghij", 0, 10, "abcde", 5, 0, 10); - test("abcdefghij", 0, 10, "abcde", 5, 1, 10); - test("abcdefghij", 0, 10, "abcde", 6, 0, 0); - test("abcdefghij", 0, 10, "abcdefghij", 0, 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 0, 1, 9); - test("abcdefghij", 0, 10, "abcdefghij", 0, 5, 5); - test("abcdefghij", 0, 10, "abcdefghij", 0, 9, 1); - test("abcdefghij", 0, 10, "abcdefghij", 0, 10, 0); - test("abcdefghij", 0, 10, "abcdefghij", 0, 11, 0); - test("abcdefghij", 0, 10, "abcdefghij", 1, 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 10, "abcdefghij", 1, 4, -1); - test("abcdefghij", 0, 10, "abcdefghij", 1, 8, -1); - test("abcdefghij", 0, 10, "abcdefghij", 1, 9, -1); - test("abcdefghij", 0, 10, "abcdefghij", 1, 10, -1); - test("abcdefghij", 0, 10, "abcdefghij", 5, 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 5, 1, -5); - test("abcdefghij", 0, 10, "abcdefghij", 5, 2, -5); - test("abcdefghij", 0, 10, "abcdefghij", 5, 4, -5); - test("abcdefghij", 0, 10, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 10, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 10, "abcdefghij", 9, 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 9, 1, -9); - test("abcdefghij", 0, 10, "abcdefghij", 9, 2, -9); - test("abcdefghij", 0, 10, "abcdefghij", 10, 0, 10); - test("abcdefghij", 0, 10, "abcdefghij", 10, 1, 10); - test("abcdefghij", 0, 10, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10); - test("abcdefghij", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 0, 11, "", 0, 0, 10); - test("abcdefghij", 0, 11, "", 0, 1, 10); - test("abcdefghij", 0, 11, "", 1, 0, 0); - test("abcdefghij", 0, 11, "abcde", 0, 0, 10); - test("abcdefghij", 0, 11, "abcde", 0, 1, 9); - test("abcdefghij", 0, 11, "abcde", 0, 2, 8); -} - -void test23() -{ - test("abcdefghij", 0, 11, "abcde", 0, 4, 6); - test("abcdefghij", 0, 11, "abcde", 0, 5, 5); - test("abcdefghij", 0, 11, "abcde", 0, 6, 5); - test("abcdefghij", 0, 11, "abcde", 1, 0, 10); - test("abcdefghij", 0, 11, "abcde", 1, 1, -1); - test("abcdefghij", 0, 11, "abcde", 1, 2, -1); - test("abcdefghij", 0, 11, "abcde", 1, 3, -1); - test("abcdefghij", 0, 11, "abcde", 1, 4, -1); - test("abcdefghij", 0, 11, "abcde", 1, 5, -1); - test("abcdefghij", 0, 11, "abcde", 2, 0, 10); - test("abcdefghij", 0, 11, "abcde", 2, 1, -2); - test("abcdefghij", 0, 11, "abcde", 2, 2, -2); - test("abcdefghij", 0, 11, "abcde", 2, 3, -2); - test("abcdefghij", 0, 11, "abcde", 2, 4, -2); - test("abcdefghij", 0, 11, "abcde", 4, 0, 10); - test("abcdefghij", 0, 11, "abcde", 4, 1, -4); - test("abcdefghij", 0, 11, "abcde", 4, 2, -4); - test("abcdefghij", 0, 11, "abcde", 5, 0, 10); - test("abcdefghij", 0, 11, "abcde", 5, 1, 10); - test("abcdefghij", 0, 11, "abcde", 6, 0, 0); - test("abcdefghij", 0, 11, "abcdefghij", 0, 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 0, 1, 9); - test("abcdefghij", 0, 11, "abcdefghij", 0, 5, 5); - test("abcdefghij", 0, 11, "abcdefghij", 0, 9, 1); - test("abcdefghij", 0, 11, "abcdefghij", 0, 10, 0); - test("abcdefghij", 0, 11, "abcdefghij", 0, 11, 0); - test("abcdefghij", 0, 11, "abcdefghij", 1, 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 1, 1, -1); - test("abcdefghij", 0, 11, "abcdefghij", 1, 4, -1); - test("abcdefghij", 0, 11, "abcdefghij", 1, 8, -1); - test("abcdefghij", 0, 11, "abcdefghij", 1, 9, -1); - test("abcdefghij", 0, 11, "abcdefghij", 1, 10, -1); - test("abcdefghij", 0, 11, "abcdefghij", 5, 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 5, 1, -5); - test("abcdefghij", 0, 11, "abcdefghij", 5, 2, -5); - test("abcdefghij", 0, 11, "abcdefghij", 5, 4, -5); - test("abcdefghij", 0, 11, "abcdefghij", 5, 5, -5); - test("abcdefghij", 0, 11, "abcdefghij", 5, 6, -5); - test("abcdefghij", 0, 11, "abcdefghij", 9, 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 9, 1, -9); - test("abcdefghij", 0, 11, "abcdefghij", 9, 2, -9); - test("abcdefghij", 0, 11, "abcdefghij", 10, 0, 10); - test("abcdefghij", 0, 11, "abcdefghij", 10, 1, 10); - test("abcdefghij", 0, 11, "abcdefghij", 11, 0, 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 1, 9); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 19, -9); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 20, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 0, 21, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 0, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 20, 1, 10); - test("abcdefghij", 0, 11, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 0, "", 0, 0, 0); - test("abcdefghij", 1, 0, "", 0, 1, 0); - test("abcdefghij", 1, 0, "", 1, 0, 0); - test("abcdefghij", 1, 0, "abcde", 0, 0, 0); - test("abcdefghij", 1, 0, "abcde", 0, 1, -1); - test("abcdefghij", 1, 0, "abcde", 0, 2, -2); - test("abcdefghij", 1, 0, "abcde", 0, 4, -4); - test("abcdefghij", 1, 0, "abcde", 0, 5, -5); - test("abcdefghij", 1, 0, "abcde", 0, 6, -5); - test("abcdefghij", 1, 0, "abcde", 1, 0, 0); - test("abcdefghij", 1, 0, "abcde", 1, 1, -1); - test("abcdefghij", 1, 0, "abcde", 1, 2, -2); - test("abcdefghij", 1, 0, "abcde", 1, 3, -3); - test("abcdefghij", 1, 0, "abcde", 1, 4, -4); - test("abcdefghij", 1, 0, "abcde", 1, 5, -4); - test("abcdefghij", 1, 0, "abcde", 2, 0, 0); - test("abcdefghij", 1, 0, "abcde", 2, 1, -1); - test("abcdefghij", 1, 0, "abcde", 2, 2, -2); - test("abcdefghij", 1, 0, "abcde", 2, 3, -3); - test("abcdefghij", 1, 0, "abcde", 2, 4, -3); - test("abcdefghij", 1, 0, "abcde", 4, 0, 0); - test("abcdefghij", 1, 0, "abcde", 4, 1, -1); - test("abcdefghij", 1, 0, "abcde", 4, 2, -1); - test("abcdefghij", 1, 0, "abcde", 5, 0, 0); - test("abcdefghij", 1, 0, "abcde", 5, 1, 0); - test("abcdefghij", 1, 0, "abcde", 6, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 0, 1, -1); - test("abcdefghij", 1, 0, "abcdefghij", 0, 5, -5); - test("abcdefghij", 1, 0, "abcdefghij", 0, 9, -9); - test("abcdefghij", 1, 0, "abcdefghij", 0, 10, -10); - test("abcdefghij", 1, 0, "abcdefghij", 0, 11, -10); -} - -void test24() -{ - test("abcdefghij", 1, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 1, 1, -1); - test("abcdefghij", 1, 0, "abcdefghij", 1, 4, -4); - test("abcdefghij", 1, 0, "abcdefghij", 1, 8, -8); - test("abcdefghij", 1, 0, "abcdefghij", 1, 9, -9); - test("abcdefghij", 1, 0, "abcdefghij", 1, 10, -9); - test("abcdefghij", 1, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 5, 1, -1); - test("abcdefghij", 1, 0, "abcdefghij", 5, 2, -2); - test("abcdefghij", 1, 0, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 0, "abcdefghij", 5, 5, -5); - test("abcdefghij", 1, 0, "abcdefghij", 5, 6, -5); - test("abcdefghij", 1, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 9, 1, -1); - test("abcdefghij", 1, 0, "abcdefghij", 9, 2, -1); - test("abcdefghij", 1, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 1, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 1, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 1, "", 0, 0, 1); - test("abcdefghij", 1, 1, "", 0, 1, 1); - test("abcdefghij", 1, 1, "", 1, 0, 0); - test("abcdefghij", 1, 1, "abcde", 0, 0, 1); - test("abcdefghij", 1, 1, "abcde", 0, 1, 1); - test("abcdefghij", 1, 1, "abcde", 0, 2, 1); - test("abcdefghij", 1, 1, "abcde", 0, 4, 1); - test("abcdefghij", 1, 1, "abcde", 0, 5, 1); - test("abcdefghij", 1, 1, "abcde", 0, 6, 1); - test("abcdefghij", 1, 1, "abcde", 1, 0, 1); - test("abcdefghij", 1, 1, "abcde", 1, 1, 0); - test("abcdefghij", 1, 1, "abcde", 1, 2, -1); - test("abcdefghij", 1, 1, "abcde", 1, 3, -2); - test("abcdefghij", 1, 1, "abcde", 1, 4, -3); - test("abcdefghij", 1, 1, "abcde", 1, 5, -3); - test("abcdefghij", 1, 1, "abcde", 2, 0, 1); - test("abcdefghij", 1, 1, "abcde", 2, 1, -1); - test("abcdefghij", 1, 1, "abcde", 2, 2, -1); - test("abcdefghij", 1, 1, "abcde", 2, 3, -1); - test("abcdefghij", 1, 1, "abcde", 2, 4, -1); - test("abcdefghij", 1, 1, "abcde", 4, 0, 1); - test("abcdefghij", 1, 1, "abcde", 4, 1, -3); - test("abcdefghij", 1, 1, "abcde", 4, 2, -3); - test("abcdefghij", 1, 1, "abcde", 5, 0, 1); - test("abcdefghij", 1, 1, "abcde", 5, 1, 1); - test("abcdefghij", 1, 1, "abcde", 6, 0, 0); - test("abcdefghij", 1, 1, "abcdefghij", 0, 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 1, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 5, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 9, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 10, 1); - test("abcdefghij", 1, 1, "abcdefghij", 0, 11, 1); - test("abcdefghij", 1, 1, "abcdefghij", 1, 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 1, 1, 0); - test("abcdefghij", 1, 1, "abcdefghij", 1, 4, -3); - test("abcdefghij", 1, 1, "abcdefghij", 1, 8, -7); - test("abcdefghij", 1, 1, "abcdefghij", 1, 9, -8); - test("abcdefghij", 1, 1, "abcdefghij", 1, 10, -8); - test("abcdefghij", 1, 1, "abcdefghij", 5, 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 5, 1, -4); - test("abcdefghij", 1, 1, "abcdefghij", 5, 2, -4); - test("abcdefghij", 1, 1, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 1, "abcdefghij", 5, 5, -4); - test("abcdefghij", 1, 1, "abcdefghij", 5, 6, -4); - test("abcdefghij", 1, 1, "abcdefghij", 9, 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 9, 1, -8); - test("abcdefghij", 1, 1, "abcdefghij", 9, 2, -8); - test("abcdefghij", 1, 1, "abcdefghij", 10, 0, 1); - test("abcdefghij", 1, 1, "abcdefghij", 10, 1, 1); - test("abcdefghij", 1, 1, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0); -} - -void test25() -{ - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghij", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 4, "", 0, 0, 4); - test("abcdefghij", 1, 4, "", 0, 1, 4); - test("abcdefghij", 1, 4, "", 1, 0, 0); - test("abcdefghij", 1, 4, "abcde", 0, 0, 4); - test("abcdefghij", 1, 4, "abcde", 0, 1, 1); - test("abcdefghij", 1, 4, "abcde", 0, 2, 1); - test("abcdefghij", 1, 4, "abcde", 0, 4, 1); - test("abcdefghij", 1, 4, "abcde", 0, 5, 1); - test("abcdefghij", 1, 4, "abcde", 0, 6, 1); - test("abcdefghij", 1, 4, "abcde", 1, 0, 4); - test("abcdefghij", 1, 4, "abcde", 1, 1, 3); - test("abcdefghij", 1, 4, "abcde", 1, 2, 2); - test("abcdefghij", 1, 4, "abcde", 1, 3, 1); - test("abcdefghij", 1, 4, "abcde", 1, 4, 0); - test("abcdefghij", 1, 4, "abcde", 1, 5, 0); - test("abcdefghij", 1, 4, "abcde", 2, 0, 4); - test("abcdefghij", 1, 4, "abcde", 2, 1, -1); - test("abcdefghij", 1, 4, "abcde", 2, 2, -1); - test("abcdefghij", 1, 4, "abcde", 2, 3, -1); - test("abcdefghij", 1, 4, "abcde", 2, 4, -1); - test("abcdefghij", 1, 4, "abcde", 4, 0, 4); - test("abcdefghij", 1, 4, "abcde", 4, 1, -3); - test("abcdefghij", 1, 4, "abcde", 4, 2, -3); - test("abcdefghij", 1, 4, "abcde", 5, 0, 4); - test("abcdefghij", 1, 4, "abcde", 5, 1, 4); - test("abcdefghij", 1, 4, "abcde", 6, 0, 0); - test("abcdefghij", 1, 4, "abcdefghij", 0, 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 0, 1, 1); - test("abcdefghij", 1, 4, "abcdefghij", 0, 5, 1); - test("abcdefghij", 1, 4, "abcdefghij", 0, 9, 1); - test("abcdefghij", 1, 4, "abcdefghij", 0, 10, 1); - test("abcdefghij", 1, 4, "abcdefghij", 0, 11, 1); - test("abcdefghij", 1, 4, "abcdefghij", 1, 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 1, 1, 3); - test("abcdefghij", 1, 4, "abcdefghij", 1, 4, 0); - test("abcdefghij", 1, 4, "abcdefghij", 1, 8, -4); - test("abcdefghij", 1, 4, "abcdefghij", 1, 9, -5); - test("abcdefghij", 1, 4, "abcdefghij", 1, 10, -5); - test("abcdefghij", 1, 4, "abcdefghij", 5, 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 5, 1, -4); - test("abcdefghij", 1, 4, "abcdefghij", 5, 2, -4); - test("abcdefghij", 1, 4, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 4, "abcdefghij", 5, 5, -4); - test("abcdefghij", 1, 4, "abcdefghij", 5, 6, -4); - test("abcdefghij", 1, 4, "abcdefghij", 9, 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 9, 1, -8); - test("abcdefghij", 1, 4, "abcdefghij", 9, 2, -8); - test("abcdefghij", 1, 4, "abcdefghij", 10, 0, 4); - test("abcdefghij", 1, 4, "abcdefghij", 10, 1, 4); - test("abcdefghij", 1, 4, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 1, 3); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 9, -5); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 18, -14); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 19, -15); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 1, 20, -15); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 0, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 20, 1, 4); - test("abcdefghij", 1, 4, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 8, "", 0, 0, 8); - test("abcdefghij", 1, 8, "", 0, 1, 8); - test("abcdefghij", 1, 8, "", 1, 0, 0); - test("abcdefghij", 1, 8, "abcde", 0, 0, 8); - test("abcdefghij", 1, 8, "abcde", 0, 1, 1); - test("abcdefghij", 1, 8, "abcde", 0, 2, 1); - test("abcdefghij", 1, 8, "abcde", 0, 4, 1); - test("abcdefghij", 1, 8, "abcde", 0, 5, 1); - test("abcdefghij", 1, 8, "abcde", 0, 6, 1); - test("abcdefghij", 1, 8, "abcde", 1, 0, 8); -} - -void test26() -{ - test("abcdefghij", 1, 8, "abcde", 1, 1, 7); - test("abcdefghij", 1, 8, "abcde", 1, 2, 6); - test("abcdefghij", 1, 8, "abcde", 1, 3, 5); - test("abcdefghij", 1, 8, "abcde", 1, 4, 4); - test("abcdefghij", 1, 8, "abcde", 1, 5, 4); - test("abcdefghij", 1, 8, "abcde", 2, 0, 8); - test("abcdefghij", 1, 8, "abcde", 2, 1, -1); - test("abcdefghij", 1, 8, "abcde", 2, 2, -1); - test("abcdefghij", 1, 8, "abcde", 2, 3, -1); - test("abcdefghij", 1, 8, "abcde", 2, 4, -1); - test("abcdefghij", 1, 8, "abcde", 4, 0, 8); - test("abcdefghij", 1, 8, "abcde", 4, 1, -3); - test("abcdefghij", 1, 8, "abcde", 4, 2, -3); - test("abcdefghij", 1, 8, "abcde", 5, 0, 8); - test("abcdefghij", 1, 8, "abcde", 5, 1, 8); - test("abcdefghij", 1, 8, "abcde", 6, 0, 0); - test("abcdefghij", 1, 8, "abcdefghij", 0, 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 0, 1, 1); - test("abcdefghij", 1, 8, "abcdefghij", 0, 5, 1); - test("abcdefghij", 1, 8, "abcdefghij", 0, 9, 1); - test("abcdefghij", 1, 8, "abcdefghij", 0, 10, 1); - test("abcdefghij", 1, 8, "abcdefghij", 0, 11, 1); - test("abcdefghij", 1, 8, "abcdefghij", 1, 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 1, 1, 7); - test("abcdefghij", 1, 8, "abcdefghij", 1, 4, 4); - test("abcdefghij", 1, 8, "abcdefghij", 1, 8, 0); - test("abcdefghij", 1, 8, "abcdefghij", 1, 9, -1); - test("abcdefghij", 1, 8, "abcdefghij", 1, 10, -1); - test("abcdefghij", 1, 8, "abcdefghij", 5, 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 5, 1, -4); - test("abcdefghij", 1, 8, "abcdefghij", 5, 2, -4); - test("abcdefghij", 1, 8, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 8, "abcdefghij", 5, 5, -4); - test("abcdefghij", 1, 8, "abcdefghij", 5, 6, -4); - test("abcdefghij", 1, 8, "abcdefghij", 9, 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 9, 1, -8); - test("abcdefghij", 1, 8, "abcdefghij", 9, 2, -8); - test("abcdefghij", 1, 8, "abcdefghij", 10, 0, 8); - test("abcdefghij", 1, 8, "abcdefghij", 10, 1, 8); - test("abcdefghij", 1, 8, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 1, 7); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 18, -10); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 19, -11); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 1, 20, -11); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 0, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 20, 1, 8); - test("abcdefghij", 1, 8, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 9, "", 0, 0, 9); - test("abcdefghij", 1, 9, "", 0, 1, 9); - test("abcdefghij", 1, 9, "", 1, 0, 0); - test("abcdefghij", 1, 9, "abcde", 0, 0, 9); - test("abcdefghij", 1, 9, "abcde", 0, 1, 1); - test("abcdefghij", 1, 9, "abcde", 0, 2, 1); - test("abcdefghij", 1, 9, "abcde", 0, 4, 1); - test("abcdefghij", 1, 9, "abcde", 0, 5, 1); - test("abcdefghij", 1, 9, "abcde", 0, 6, 1); - test("abcdefghij", 1, 9, "abcde", 1, 0, 9); - test("abcdefghij", 1, 9, "abcde", 1, 1, 8); - test("abcdefghij", 1, 9, "abcde", 1, 2, 7); - test("abcdefghij", 1, 9, "abcde", 1, 3, 6); - test("abcdefghij", 1, 9, "abcde", 1, 4, 5); - test("abcdefghij", 1, 9, "abcde", 1, 5, 5); - test("abcdefghij", 1, 9, "abcde", 2, 0, 9); - test("abcdefghij", 1, 9, "abcde", 2, 1, -1); - test("abcdefghij", 1, 9, "abcde", 2, 2, -1); - test("abcdefghij", 1, 9, "abcde", 2, 3, -1); - test("abcdefghij", 1, 9, "abcde", 2, 4, -1); - test("abcdefghij", 1, 9, "abcde", 4, 0, 9); - test("abcdefghij", 1, 9, "abcde", 4, 1, -3); - test("abcdefghij", 1, 9, "abcde", 4, 2, -3); - test("abcdefghij", 1, 9, "abcde", 5, 0, 9); - test("abcdefghij", 1, 9, "abcde", 5, 1, 9); - test("abcdefghij", 1, 9, "abcde", 6, 0, 0); - test("abcdefghij", 1, 9, "abcdefghij", 0, 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 0, 1, 1); - test("abcdefghij", 1, 9, "abcdefghij", 0, 5, 1); - test("abcdefghij", 1, 9, "abcdefghij", 0, 9, 1); - test("abcdefghij", 1, 9, "abcdefghij", 0, 10, 1); - test("abcdefghij", 1, 9, "abcdefghij", 0, 11, 1); - test("abcdefghij", 1, 9, "abcdefghij", 1, 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 1, 1, 8); - test("abcdefghij", 1, 9, "abcdefghij", 1, 4, 5); - test("abcdefghij", 1, 9, "abcdefghij", 1, 8, 1); -} - -void test27() -{ - test("abcdefghij", 1, 9, "abcdefghij", 1, 9, 0); - test("abcdefghij", 1, 9, "abcdefghij", 1, 10, 0); - test("abcdefghij", 1, 9, "abcdefghij", 5, 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 5, 1, -4); - test("abcdefghij", 1, 9, "abcdefghij", 5, 2, -4); - test("abcdefghij", 1, 9, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 9, "abcdefghij", 5, 5, -4); - test("abcdefghij", 1, 9, "abcdefghij", 5, 6, -4); - test("abcdefghij", 1, 9, "abcdefghij", 9, 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 9, 1, -8); - test("abcdefghij", 1, 9, "abcdefghij", 9, 2, -8); - test("abcdefghij", 1, 9, "abcdefghij", 10, 0, 9); - test("abcdefghij", 1, 9, "abcdefghij", 10, 1, 9); - test("abcdefghij", 1, 9, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9); - test("abcdefghij", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 1, 10, "", 0, 0, 9); - test("abcdefghij", 1, 10, "", 0, 1, 9); - test("abcdefghij", 1, 10, "", 1, 0, 0); - test("abcdefghij", 1, 10, "abcde", 0, 0, 9); - test("abcdefghij", 1, 10, "abcde", 0, 1, 1); - test("abcdefghij", 1, 10, "abcde", 0, 2, 1); - test("abcdefghij", 1, 10, "abcde", 0, 4, 1); - test("abcdefghij", 1, 10, "abcde", 0, 5, 1); - test("abcdefghij", 1, 10, "abcde", 0, 6, 1); - test("abcdefghij", 1, 10, "abcde", 1, 0, 9); - test("abcdefghij", 1, 10, "abcde", 1, 1, 8); - test("abcdefghij", 1, 10, "abcde", 1, 2, 7); - test("abcdefghij", 1, 10, "abcde", 1, 3, 6); - test("abcdefghij", 1, 10, "abcde", 1, 4, 5); - test("abcdefghij", 1, 10, "abcde", 1, 5, 5); - test("abcdefghij", 1, 10, "abcde", 2, 0, 9); - test("abcdefghij", 1, 10, "abcde", 2, 1, -1); - test("abcdefghij", 1, 10, "abcde", 2, 2, -1); - test("abcdefghij", 1, 10, "abcde", 2, 3, -1); - test("abcdefghij", 1, 10, "abcde", 2, 4, -1); - test("abcdefghij", 1, 10, "abcde", 4, 0, 9); - test("abcdefghij", 1, 10, "abcde", 4, 1, -3); - test("abcdefghij", 1, 10, "abcde", 4, 2, -3); - test("abcdefghij", 1, 10, "abcde", 5, 0, 9); - test("abcdefghij", 1, 10, "abcde", 5, 1, 9); - test("abcdefghij", 1, 10, "abcde", 6, 0, 0); - test("abcdefghij", 1, 10, "abcdefghij", 0, 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 0, 1, 1); - test("abcdefghij", 1, 10, "abcdefghij", 0, 5, 1); - test("abcdefghij", 1, 10, "abcdefghij", 0, 9, 1); - test("abcdefghij", 1, 10, "abcdefghij", 0, 10, 1); - test("abcdefghij", 1, 10, "abcdefghij", 0, 11, 1); - test("abcdefghij", 1, 10, "abcdefghij", 1, 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 1, 1, 8); - test("abcdefghij", 1, 10, "abcdefghij", 1, 4, 5); - test("abcdefghij", 1, 10, "abcdefghij", 1, 8, 1); - test("abcdefghij", 1, 10, "abcdefghij", 1, 9, 0); - test("abcdefghij", 1, 10, "abcdefghij", 1, 10, 0); - test("abcdefghij", 1, 10, "abcdefghij", 5, 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 5, 1, -4); - test("abcdefghij", 1, 10, "abcdefghij", 5, 2, -4); - test("abcdefghij", 1, 10, "abcdefghij", 5, 4, -4); - test("abcdefghij", 1, 10, "abcdefghij", 5, 5, -4); - test("abcdefghij", 1, 10, "abcdefghij", 5, 6, -4); - test("abcdefghij", 1, 10, "abcdefghij", 9, 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 9, 1, -8); - test("abcdefghij", 1, 10, "abcdefghij", 9, 2, -8); - test("abcdefghij", 1, 10, "abcdefghij", 10, 0, 9); - test("abcdefghij", 1, 10, "abcdefghij", 10, 1, 9); - test("abcdefghij", 1, 10, "abcdefghij", 11, 0, 0); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 1, 8); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 18, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 19, -10); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 1, 20, -10); -} - -void test28() -{ - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 0, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 20, 1, 9); - test("abcdefghij", 1, 10, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 0, "", 0, 0, 0); - test("abcdefghij", 5, 0, "", 0, 1, 0); - test("abcdefghij", 5, 0, "", 1, 0, 0); - test("abcdefghij", 5, 0, "abcde", 0, 0, 0); - test("abcdefghij", 5, 0, "abcde", 0, 1, -1); - test("abcdefghij", 5, 0, "abcde", 0, 2, -2); - test("abcdefghij", 5, 0, "abcde", 0, 4, -4); - test("abcdefghij", 5, 0, "abcde", 0, 5, -5); - test("abcdefghij", 5, 0, "abcde", 0, 6, -5); - test("abcdefghij", 5, 0, "abcde", 1, 0, 0); - test("abcdefghij", 5, 0, "abcde", 1, 1, -1); - test("abcdefghij", 5, 0, "abcde", 1, 2, -2); - test("abcdefghij", 5, 0, "abcde", 1, 3, -3); - test("abcdefghij", 5, 0, "abcde", 1, 4, -4); - test("abcdefghij", 5, 0, "abcde", 1, 5, -4); - test("abcdefghij", 5, 0, "abcde", 2, 0, 0); - test("abcdefghij", 5, 0, "abcde", 2, 1, -1); - test("abcdefghij", 5, 0, "abcde", 2, 2, -2); - test("abcdefghij", 5, 0, "abcde", 2, 3, -3); - test("abcdefghij", 5, 0, "abcde", 2, 4, -3); - test("abcdefghij", 5, 0, "abcde", 4, 0, 0); - test("abcdefghij", 5, 0, "abcde", 4, 1, -1); - test("abcdefghij", 5, 0, "abcde", 4, 2, -1); - test("abcdefghij", 5, 0, "abcde", 5, 0, 0); - test("abcdefghij", 5, 0, "abcde", 5, 1, 0); - test("abcdefghij", 5, 0, "abcde", 6, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 0, 1, -1); - test("abcdefghij", 5, 0, "abcdefghij", 0, 5, -5); - test("abcdefghij", 5, 0, "abcdefghij", 0, 9, -9); - test("abcdefghij", 5, 0, "abcdefghij", 0, 10, -10); - test("abcdefghij", 5, 0, "abcdefghij", 0, 11, -10); - test("abcdefghij", 5, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 1, 1, -1); - test("abcdefghij", 5, 0, "abcdefghij", 1, 4, -4); - test("abcdefghij", 5, 0, "abcdefghij", 1, 8, -8); - test("abcdefghij", 5, 0, "abcdefghij", 1, 9, -9); - test("abcdefghij", 5, 0, "abcdefghij", 1, 10, -9); - test("abcdefghij", 5, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 5, 1, -1); - test("abcdefghij", 5, 0, "abcdefghij", 5, 2, -2); - test("abcdefghij", 5, 0, "abcdefghij", 5, 4, -4); - test("abcdefghij", 5, 0, "abcdefghij", 5, 5, -5); - test("abcdefghij", 5, 0, "abcdefghij", 5, 6, -5); - test("abcdefghij", 5, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 9, 1, -1); - test("abcdefghij", 5, 0, "abcdefghij", 9, 2, -1); - test("abcdefghij", 5, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 5, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 5, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 5, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 1, "", 0, 0, 1); - test("abcdefghij", 5, 1, "", 0, 1, 1); - test("abcdefghij", 5, 1, "", 1, 0, 0); - test("abcdefghij", 5, 1, "abcde", 0, 0, 1); - test("abcdefghij", 5, 1, "abcde", 0, 1, 5); - test("abcdefghij", 5, 1, "abcde", 0, 2, 5); - test("abcdefghij", 5, 1, "abcde", 0, 4, 5); - test("abcdefghij", 5, 1, "abcde", 0, 5, 5); - test("abcdefghij", 5, 1, "abcde", 0, 6, 5); - test("abcdefghij", 5, 1, "abcde", 1, 0, 1); - test("abcdefghij", 5, 1, "abcde", 1, 1, 4); - test("abcdefghij", 5, 1, "abcde", 1, 2, 4); - test("abcdefghij", 5, 1, "abcde", 1, 3, 4); - test("abcdefghij", 5, 1, "abcde", 1, 4, 4); -} - -void test29() -{ - test("abcdefghij", 5, 1, "abcde", 1, 5, 4); - test("abcdefghij", 5, 1, "abcde", 2, 0, 1); - test("abcdefghij", 5, 1, "abcde", 2, 1, 3); - test("abcdefghij", 5, 1, "abcde", 2, 2, 3); - test("abcdefghij", 5, 1, "abcde", 2, 3, 3); - test("abcdefghij", 5, 1, "abcde", 2, 4, 3); - test("abcdefghij", 5, 1, "abcde", 4, 0, 1); - test("abcdefghij", 5, 1, "abcde", 4, 1, 1); - test("abcdefghij", 5, 1, "abcde", 4, 2, 1); - test("abcdefghij", 5, 1, "abcde", 5, 0, 1); - test("abcdefghij", 5, 1, "abcde", 5, 1, 1); - test("abcdefghij", 5, 1, "abcde", 6, 0, 0); - test("abcdefghij", 5, 1, "abcdefghij", 0, 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 0, 1, 5); - test("abcdefghij", 5, 1, "abcdefghij", 0, 5, 5); - test("abcdefghij", 5, 1, "abcdefghij", 0, 9, 5); - test("abcdefghij", 5, 1, "abcdefghij", 0, 10, 5); - test("abcdefghij", 5, 1, "abcdefghij", 0, 11, 5); - test("abcdefghij", 5, 1, "abcdefghij", 1, 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 1, 1, 4); - test("abcdefghij", 5, 1, "abcdefghij", 1, 4, 4); - test("abcdefghij", 5, 1, "abcdefghij", 1, 8, 4); - test("abcdefghij", 5, 1, "abcdefghij", 1, 9, 4); - test("abcdefghij", 5, 1, "abcdefghij", 1, 10, 4); - test("abcdefghij", 5, 1, "abcdefghij", 5, 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 5, 1, 0); - test("abcdefghij", 5, 1, "abcdefghij", 5, 2, -1); - test("abcdefghij", 5, 1, "abcdefghij", 5, 4, -3); - test("abcdefghij", 5, 1, "abcdefghij", 5, 5, -4); - test("abcdefghij", 5, 1, "abcdefghij", 5, 6, -4); - test("abcdefghij", 5, 1, "abcdefghij", 9, 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 9, 1, -4); - test("abcdefghij", 5, 1, "abcdefghij", 9, 2, -4); - test("abcdefghij", 5, 1, "abcdefghij", 10, 0, 1); - test("abcdefghij", 5, 1, "abcdefghij", 10, 1, 1); - test("abcdefghij", 5, 1, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 1, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 10, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 19, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 20, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 0, 21, 5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 1, 4); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 9, 4); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 18, 4); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 19, 4); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 1, 20, 4); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 1, -5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 9, -5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 1, -14); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 19, 2, -14); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghij", 5, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 2, "", 0, 0, 2); - test("abcdefghij", 5, 2, "", 0, 1, 2); - test("abcdefghij", 5, 2, "", 1, 0, 0); - test("abcdefghij", 5, 2, "abcde", 0, 0, 2); - test("abcdefghij", 5, 2, "abcde", 0, 1, 5); - test("abcdefghij", 5, 2, "abcde", 0, 2, 5); - test("abcdefghij", 5, 2, "abcde", 0, 4, 5); - test("abcdefghij", 5, 2, "abcde", 0, 5, 5); - test("abcdefghij", 5, 2, "abcde", 0, 6, 5); - test("abcdefghij", 5, 2, "abcde", 1, 0, 2); - test("abcdefghij", 5, 2, "abcde", 1, 1, 4); - test("abcdefghij", 5, 2, "abcde", 1, 2, 4); - test("abcdefghij", 5, 2, "abcde", 1, 3, 4); - test("abcdefghij", 5, 2, "abcde", 1, 4, 4); - test("abcdefghij", 5, 2, "abcde", 1, 5, 4); - test("abcdefghij", 5, 2, "abcde", 2, 0, 2); - test("abcdefghij", 5, 2, "abcde", 2, 1, 3); - test("abcdefghij", 5, 2, "abcde", 2, 2, 3); - test("abcdefghij", 5, 2, "abcde", 2, 3, 3); - test("abcdefghij", 5, 2, "abcde", 2, 4, 3); - test("abcdefghij", 5, 2, "abcde", 4, 0, 2); - test("abcdefghij", 5, 2, "abcde", 4, 1, 1); - test("abcdefghij", 5, 2, "abcde", 4, 2, 1); - test("abcdefghij", 5, 2, "abcde", 5, 0, 2); - test("abcdefghij", 5, 2, "abcde", 5, 1, 2); - test("abcdefghij", 5, 2, "abcde", 6, 0, 0); - test("abcdefghij", 5, 2, "abcdefghij", 0, 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 0, 1, 5); - test("abcdefghij", 5, 2, "abcdefghij", 0, 5, 5); - test("abcdefghij", 5, 2, "abcdefghij", 0, 9, 5); - test("abcdefghij", 5, 2, "abcdefghij", 0, 10, 5); - test("abcdefghij", 5, 2, "abcdefghij", 0, 11, 5); - test("abcdefghij", 5, 2, "abcdefghij", 1, 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 1, 1, 4); - test("abcdefghij", 5, 2, "abcdefghij", 1, 4, 4); - test("abcdefghij", 5, 2, "abcdefghij", 1, 8, 4); - test("abcdefghij", 5, 2, "abcdefghij", 1, 9, 4); - test("abcdefghij", 5, 2, "abcdefghij", 1, 10, 4); - test("abcdefghij", 5, 2, "abcdefghij", 5, 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 5, 1, 1); -} - -void test30() -{ - test("abcdefghij", 5, 2, "abcdefghij", 5, 2, 0); - test("abcdefghij", 5, 2, "abcdefghij", 5, 4, -2); - test("abcdefghij", 5, 2, "abcdefghij", 5, 5, -3); - test("abcdefghij", 5, 2, "abcdefghij", 5, 6, -3); - test("abcdefghij", 5, 2, "abcdefghij", 9, 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 9, 1, -4); - test("abcdefghij", 5, 2, "abcdefghij", 9, 2, -4); - test("abcdefghij", 5, 2, "abcdefghij", 10, 0, 2); - test("abcdefghij", 5, 2, "abcdefghij", 10, 1, 2); - test("abcdefghij", 5, 2, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 1, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 10, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 19, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 20, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 0, 21, 5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 1, 4); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 9, 4); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 18, 4); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 19, 4); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 1, 20, 4); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 1, -5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 9, -5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 1, -14); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 19, 2, -14); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 0, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 20, 1, 2); - test("abcdefghij", 5, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 4, "", 0, 0, 4); - test("abcdefghij", 5, 4, "", 0, 1, 4); - test("abcdefghij", 5, 4, "", 1, 0, 0); - test("abcdefghij", 5, 4, "abcde", 0, 0, 4); - test("abcdefghij", 5, 4, "abcde", 0, 1, 5); - test("abcdefghij", 5, 4, "abcde", 0, 2, 5); - test("abcdefghij", 5, 4, "abcde", 0, 4, 5); - test("abcdefghij", 5, 4, "abcde", 0, 5, 5); - test("abcdefghij", 5, 4, "abcde", 0, 6, 5); - test("abcdefghij", 5, 4, "abcde", 1, 0, 4); - test("abcdefghij", 5, 4, "abcde", 1, 1, 4); - test("abcdefghij", 5, 4, "abcde", 1, 2, 4); - test("abcdefghij", 5, 4, "abcde", 1, 3, 4); - test("abcdefghij", 5, 4, "abcde", 1, 4, 4); - test("abcdefghij", 5, 4, "abcde", 1, 5, 4); - test("abcdefghij", 5, 4, "abcde", 2, 0, 4); - test("abcdefghij", 5, 4, "abcde", 2, 1, 3); - test("abcdefghij", 5, 4, "abcde", 2, 2, 3); - test("abcdefghij", 5, 4, "abcde", 2, 3, 3); - test("abcdefghij", 5, 4, "abcde", 2, 4, 3); - test("abcdefghij", 5, 4, "abcde", 4, 0, 4); - test("abcdefghij", 5, 4, "abcde", 4, 1, 1); - test("abcdefghij", 5, 4, "abcde", 4, 2, 1); - test("abcdefghij", 5, 4, "abcde", 5, 0, 4); - test("abcdefghij", 5, 4, "abcde", 5, 1, 4); - test("abcdefghij", 5, 4, "abcde", 6, 0, 0); - test("abcdefghij", 5, 4, "abcdefghij", 0, 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 0, 1, 5); - test("abcdefghij", 5, 4, "abcdefghij", 0, 5, 5); - test("abcdefghij", 5, 4, "abcdefghij", 0, 9, 5); - test("abcdefghij", 5, 4, "abcdefghij", 0, 10, 5); - test("abcdefghij", 5, 4, "abcdefghij", 0, 11, 5); - test("abcdefghij", 5, 4, "abcdefghij", 1, 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 1, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 4, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 8, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 9, 4); - test("abcdefghij", 5, 4, "abcdefghij", 1, 10, 4); - test("abcdefghij", 5, 4, "abcdefghij", 5, 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 5, 1, 3); - test("abcdefghij", 5, 4, "abcdefghij", 5, 2, 2); - test("abcdefghij", 5, 4, "abcdefghij", 5, 4, 0); - test("abcdefghij", 5, 4, "abcdefghij", 5, 5, -1); - test("abcdefghij", 5, 4, "abcdefghij", 5, 6, -1); - test("abcdefghij", 5, 4, "abcdefghij", 9, 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 9, 1, -4); - test("abcdefghij", 5, 4, "abcdefghij", 9, 2, -4); - test("abcdefghij", 5, 4, "abcdefghij", 10, 0, 4); - test("abcdefghij", 5, 4, "abcdefghij", 10, 1, 4); - test("abcdefghij", 5, 4, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 1, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 10, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 19, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 20, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 0, 21, 5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 1, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 9, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 18, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 19, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 1, 20, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 1, -5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 9, -5); -} - -void test31() -{ - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 1, -14); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 19, 2, -14); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 0, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 20, 1, 4); - test("abcdefghij", 5, 4, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 5, "", 0, 0, 5); - test("abcdefghij", 5, 5, "", 0, 1, 5); - test("abcdefghij", 5, 5, "", 1, 0, 0); - test("abcdefghij", 5, 5, "abcde", 0, 0, 5); - test("abcdefghij", 5, 5, "abcde", 0, 1, 5); - test("abcdefghij", 5, 5, "abcde", 0, 2, 5); - test("abcdefghij", 5, 5, "abcde", 0, 4, 5); - test("abcdefghij", 5, 5, "abcde", 0, 5, 5); - test("abcdefghij", 5, 5, "abcde", 0, 6, 5); - test("abcdefghij", 5, 5, "abcde", 1, 0, 5); - test("abcdefghij", 5, 5, "abcde", 1, 1, 4); - test("abcdefghij", 5, 5, "abcde", 1, 2, 4); - test("abcdefghij", 5, 5, "abcde", 1, 3, 4); - test("abcdefghij", 5, 5, "abcde", 1, 4, 4); - test("abcdefghij", 5, 5, "abcde", 1, 5, 4); - test("abcdefghij", 5, 5, "abcde", 2, 0, 5); - test("abcdefghij", 5, 5, "abcde", 2, 1, 3); - test("abcdefghij", 5, 5, "abcde", 2, 2, 3); - test("abcdefghij", 5, 5, "abcde", 2, 3, 3); - test("abcdefghij", 5, 5, "abcde", 2, 4, 3); - test("abcdefghij", 5, 5, "abcde", 4, 0, 5); - test("abcdefghij", 5, 5, "abcde", 4, 1, 1); - test("abcdefghij", 5, 5, "abcde", 4, 2, 1); - test("abcdefghij", 5, 5, "abcde", 5, 0, 5); - test("abcdefghij", 5, 5, "abcde", 5, 1, 5); - test("abcdefghij", 5, 5, "abcde", 6, 0, 0); - test("abcdefghij", 5, 5, "abcdefghij", 0, 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 1, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 5, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 9, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 10, 5); - test("abcdefghij", 5, 5, "abcdefghij", 0, 11, 5); - test("abcdefghij", 5, 5, "abcdefghij", 1, 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 1, 1, 4); - test("abcdefghij", 5, 5, "abcdefghij", 1, 4, 4); - test("abcdefghij", 5, 5, "abcdefghij", 1, 8, 4); - test("abcdefghij", 5, 5, "abcdefghij", 1, 9, 4); - test("abcdefghij", 5, 5, "abcdefghij", 1, 10, 4); - test("abcdefghij", 5, 5, "abcdefghij", 5, 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 5, 1, 4); - test("abcdefghij", 5, 5, "abcdefghij", 5, 2, 3); - test("abcdefghij", 5, 5, "abcdefghij", 5, 4, 1); - test("abcdefghij", 5, 5, "abcdefghij", 5, 5, 0); - test("abcdefghij", 5, 5, "abcdefghij", 5, 6, 0); - test("abcdefghij", 5, 5, "abcdefghij", 9, 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 9, 1, -4); - test("abcdefghij", 5, 5, "abcdefghij", 9, 2, -4); - test("abcdefghij", 5, 5, "abcdefghij", 10, 0, 5); - test("abcdefghij", 5, 5, "abcdefghij", 10, 1, 5); - test("abcdefghij", 5, 5, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 1, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 10, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 19, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 20, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 0, 21, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 1, 4); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 9, 4); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 18, 4); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 19, 4); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 1, 20, 4); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 1, -5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 9, -5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 1, -14); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 19, 2, -14); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcdefghij", 5, 5, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 5, 6, "", 0, 0, 5); - test("abcdefghij", 5, 6, "", 0, 1, 5); - test("abcdefghij", 5, 6, "", 1, 0, 0); - test("abcdefghij", 5, 6, "abcde", 0, 0, 5); - test("abcdefghij", 5, 6, "abcde", 0, 1, 5); - test("abcdefghij", 5, 6, "abcde", 0, 2, 5); - test("abcdefghij", 5, 6, "abcde", 0, 4, 5); - test("abcdefghij", 5, 6, "abcde", 0, 5, 5); - test("abcdefghij", 5, 6, "abcde", 0, 6, 5); - test("abcdefghij", 5, 6, "abcde", 1, 0, 5); - test("abcdefghij", 5, 6, "abcde", 1, 1, 4); - test("abcdefghij", 5, 6, "abcde", 1, 2, 4); - test("abcdefghij", 5, 6, "abcde", 1, 3, 4); - test("abcdefghij", 5, 6, "abcde", 1, 4, 4); - test("abcdefghij", 5, 6, "abcde", 1, 5, 4); - test("abcdefghij", 5, 6, "abcde", 2, 0, 5); - test("abcdefghij", 5, 6, "abcde", 2, 1, 3); - test("abcdefghij", 5, 6, "abcde", 2, 2, 3); -} - -void test32() -{ - test("abcdefghij", 5, 6, "abcde", 2, 3, 3); - test("abcdefghij", 5, 6, "abcde", 2, 4, 3); - test("abcdefghij", 5, 6, "abcde", 4, 0, 5); - test("abcdefghij", 5, 6, "abcde", 4, 1, 1); - test("abcdefghij", 5, 6, "abcde", 4, 2, 1); - test("abcdefghij", 5, 6, "abcde", 5, 0, 5); - test("abcdefghij", 5, 6, "abcde", 5, 1, 5); - test("abcdefghij", 5, 6, "abcde", 6, 0, 0); - test("abcdefghij", 5, 6, "abcdefghij", 0, 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 1, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 5, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 9, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 10, 5); - test("abcdefghij", 5, 6, "abcdefghij", 0, 11, 5); - test("abcdefghij", 5, 6, "abcdefghij", 1, 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 1, 1, 4); - test("abcdefghij", 5, 6, "abcdefghij", 1, 4, 4); - test("abcdefghij", 5, 6, "abcdefghij", 1, 8, 4); - test("abcdefghij", 5, 6, "abcdefghij", 1, 9, 4); - test("abcdefghij", 5, 6, "abcdefghij", 1, 10, 4); - test("abcdefghij", 5, 6, "abcdefghij", 5, 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 5, 1, 4); - test("abcdefghij", 5, 6, "abcdefghij", 5, 2, 3); - test("abcdefghij", 5, 6, "abcdefghij", 5, 4, 1); - test("abcdefghij", 5, 6, "abcdefghij", 5, 5, 0); - test("abcdefghij", 5, 6, "abcdefghij", 5, 6, 0); - test("abcdefghij", 5, 6, "abcdefghij", 9, 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 9, 1, -4); - test("abcdefghij", 5, 6, "abcdefghij", 9, 2, -4); - test("abcdefghij", 5, 6, "abcdefghij", 10, 0, 5); - test("abcdefghij", 5, 6, "abcdefghij", 10, 1, 5); - test("abcdefghij", 5, 6, "abcdefghij", 11, 0, 0); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 1, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 10, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 19, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 20, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 0, 21, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 1, 4); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 9, 4); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 18, 4); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 19, 4); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 1, 20, 4); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 1, -5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 9, -5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 1, -14); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 19, 2, -14); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcdefghij", 5, 6, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 9, 0, "", 0, 0, 0); - test("abcdefghij", 9, 0, "", 0, 1, 0); - test("abcdefghij", 9, 0, "", 1, 0, 0); - test("abcdefghij", 9, 0, "abcde", 0, 0, 0); - test("abcdefghij", 9, 0, "abcde", 0, 1, -1); - test("abcdefghij", 9, 0, "abcde", 0, 2, -2); - test("abcdefghij", 9, 0, "abcde", 0, 4, -4); - test("abcdefghij", 9, 0, "abcde", 0, 5, -5); - test("abcdefghij", 9, 0, "abcde", 0, 6, -5); - test("abcdefghij", 9, 0, "abcde", 1, 0, 0); - test("abcdefghij", 9, 0, "abcde", 1, 1, -1); - test("abcdefghij", 9, 0, "abcde", 1, 2, -2); - test("abcdefghij", 9, 0, "abcde", 1, 3, -3); - test("abcdefghij", 9, 0, "abcde", 1, 4, -4); - test("abcdefghij", 9, 0, "abcde", 1, 5, -4); - test("abcdefghij", 9, 0, "abcde", 2, 0, 0); - test("abcdefghij", 9, 0, "abcde", 2, 1, -1); - test("abcdefghij", 9, 0, "abcde", 2, 2, -2); - test("abcdefghij", 9, 0, "abcde", 2, 3, -3); - test("abcdefghij", 9, 0, "abcde", 2, 4, -3); - test("abcdefghij", 9, 0, "abcde", 4, 0, 0); - test("abcdefghij", 9, 0, "abcde", 4, 1, -1); - test("abcdefghij", 9, 0, "abcde", 4, 2, -1); - test("abcdefghij", 9, 0, "abcde", 5, 0, 0); - test("abcdefghij", 9, 0, "abcde", 5, 1, 0); - test("abcdefghij", 9, 0, "abcde", 6, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 0, 1, -1); - test("abcdefghij", 9, 0, "abcdefghij", 0, 5, -5); - test("abcdefghij", 9, 0, "abcdefghij", 0, 9, -9); - test("abcdefghij", 9, 0, "abcdefghij", 0, 10, -10); - test("abcdefghij", 9, 0, "abcdefghij", 0, 11, -10); - test("abcdefghij", 9, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 1, 1, -1); - test("abcdefghij", 9, 0, "abcdefghij", 1, 4, -4); - test("abcdefghij", 9, 0, "abcdefghij", 1, 8, -8); - test("abcdefghij", 9, 0, "abcdefghij", 1, 9, -9); - test("abcdefghij", 9, 0, "abcdefghij", 1, 10, -9); - test("abcdefghij", 9, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 5, 1, -1); - test("abcdefghij", 9, 0, "abcdefghij", 5, 2, -2); - test("abcdefghij", 9, 0, "abcdefghij", 5, 4, -4); - test("abcdefghij", 9, 0, "abcdefghij", 5, 5, -5); - test("abcdefghij", 9, 0, "abcdefghij", 5, 6, -5); -} - -void test33() -{ - test("abcdefghij", 9, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 9, 1, -1); - test("abcdefghij", 9, 0, "abcdefghij", 9, 2, -1); - test("abcdefghij", 9, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 9, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 9, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 9, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 9, 1, "", 0, 0, 1); - test("abcdefghij", 9, 1, "", 0, 1, 1); - test("abcdefghij", 9, 1, "", 1, 0, 0); - test("abcdefghij", 9, 1, "abcde", 0, 0, 1); - test("abcdefghij", 9, 1, "abcde", 0, 1, 9); - test("abcdefghij", 9, 1, "abcde", 0, 2, 9); - test("abcdefghij", 9, 1, "abcde", 0, 4, 9); - test("abcdefghij", 9, 1, "abcde", 0, 5, 9); - test("abcdefghij", 9, 1, "abcde", 0, 6, 9); - test("abcdefghij", 9, 1, "abcde", 1, 0, 1); - test("abcdefghij", 9, 1, "abcde", 1, 1, 8); - test("abcdefghij", 9, 1, "abcde", 1, 2, 8); - test("abcdefghij", 9, 1, "abcde", 1, 3, 8); - test("abcdefghij", 9, 1, "abcde", 1, 4, 8); - test("abcdefghij", 9, 1, "abcde", 1, 5, 8); - test("abcdefghij", 9, 1, "abcde", 2, 0, 1); - test("abcdefghij", 9, 1, "abcde", 2, 1, 7); - test("abcdefghij", 9, 1, "abcde", 2, 2, 7); - test("abcdefghij", 9, 1, "abcde", 2, 3, 7); - test("abcdefghij", 9, 1, "abcde", 2, 4, 7); - test("abcdefghij", 9, 1, "abcde", 4, 0, 1); - test("abcdefghij", 9, 1, "abcde", 4, 1, 5); - test("abcdefghij", 9, 1, "abcde", 4, 2, 5); - test("abcdefghij", 9, 1, "abcde", 5, 0, 1); - test("abcdefghij", 9, 1, "abcde", 5, 1, 1); - test("abcdefghij", 9, 1, "abcde", 6, 0, 0); - test("abcdefghij", 9, 1, "abcdefghij", 0, 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 0, 1, 9); - test("abcdefghij", 9, 1, "abcdefghij", 0, 5, 9); - test("abcdefghij", 9, 1, "abcdefghij", 0, 9, 9); - test("abcdefghij", 9, 1, "abcdefghij", 0, 10, 9); - test("abcdefghij", 9, 1, "abcdefghij", 0, 11, 9); - test("abcdefghij", 9, 1, "abcdefghij", 1, 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 1, 1, 8); - test("abcdefghij", 9, 1, "abcdefghij", 1, 4, 8); - test("abcdefghij", 9, 1, "abcdefghij", 1, 8, 8); - test("abcdefghij", 9, 1, "abcdefghij", 1, 9, 8); - test("abcdefghij", 9, 1, "abcdefghij", 1, 10, 8); - test("abcdefghij", 9, 1, "abcdefghij", 5, 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 5, 1, 4); - test("abcdefghij", 9, 1, "abcdefghij", 5, 2, 4); - test("abcdefghij", 9, 1, "abcdefghij", 5, 4, 4); - test("abcdefghij", 9, 1, "abcdefghij", 5, 5, 4); - test("abcdefghij", 9, 1, "abcdefghij", 5, 6, 4); - test("abcdefghij", 9, 1, "abcdefghij", 9, 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 9, 1, 0); - test("abcdefghij", 9, 1, "abcdefghij", 9, 2, 0); - test("abcdefghij", 9, 1, "abcdefghij", 10, 0, 1); - test("abcdefghij", 9, 1, "abcdefghij", 10, 1, 1); - test("abcdefghij", 9, 1, "abcdefghij", 11, 0, 0); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 1, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 10, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 19, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 20, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 0, 21, 9); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 1, 8); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 9, 8); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 18, 8); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 19, 8); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 1, 20, 8); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 5, -1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 9, -1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 10, -1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 10, 11, -1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 1, -10); -} - -void test34() -{ - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 19, 2, -10); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghij", 9, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 9, 2, "", 0, 0, 1); - test("abcdefghij", 9, 2, "", 0, 1, 1); - test("abcdefghij", 9, 2, "", 1, 0, 0); - test("abcdefghij", 9, 2, "abcde", 0, 0, 1); - test("abcdefghij", 9, 2, "abcde", 0, 1, 9); - test("abcdefghij", 9, 2, "abcde", 0, 2, 9); - test("abcdefghij", 9, 2, "abcde", 0, 4, 9); - test("abcdefghij", 9, 2, "abcde", 0, 5, 9); - test("abcdefghij", 9, 2, "abcde", 0, 6, 9); - test("abcdefghij", 9, 2, "abcde", 1, 0, 1); - test("abcdefghij", 9, 2, "abcde", 1, 1, 8); - test("abcdefghij", 9, 2, "abcde", 1, 2, 8); - test("abcdefghij", 9, 2, "abcde", 1, 3, 8); - test("abcdefghij", 9, 2, "abcde", 1, 4, 8); - test("abcdefghij", 9, 2, "abcde", 1, 5, 8); - test("abcdefghij", 9, 2, "abcde", 2, 0, 1); - test("abcdefghij", 9, 2, "abcde", 2, 1, 7); - test("abcdefghij", 9, 2, "abcde", 2, 2, 7); - test("abcdefghij", 9, 2, "abcde", 2, 3, 7); - test("abcdefghij", 9, 2, "abcde", 2, 4, 7); - test("abcdefghij", 9, 2, "abcde", 4, 0, 1); - test("abcdefghij", 9, 2, "abcde", 4, 1, 5); - test("abcdefghij", 9, 2, "abcde", 4, 2, 5); - test("abcdefghij", 9, 2, "abcde", 5, 0, 1); - test("abcdefghij", 9, 2, "abcde", 5, 1, 1); - test("abcdefghij", 9, 2, "abcde", 6, 0, 0); - test("abcdefghij", 9, 2, "abcdefghij", 0, 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 0, 1, 9); - test("abcdefghij", 9, 2, "abcdefghij", 0, 5, 9); - test("abcdefghij", 9, 2, "abcdefghij", 0, 9, 9); - test("abcdefghij", 9, 2, "abcdefghij", 0, 10, 9); - test("abcdefghij", 9, 2, "abcdefghij", 0, 11, 9); - test("abcdefghij", 9, 2, "abcdefghij", 1, 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 1, 1, 8); - test("abcdefghij", 9, 2, "abcdefghij", 1, 4, 8); - test("abcdefghij", 9, 2, "abcdefghij", 1, 8, 8); - test("abcdefghij", 9, 2, "abcdefghij", 1, 9, 8); - test("abcdefghij", 9, 2, "abcdefghij", 1, 10, 8); - test("abcdefghij", 9, 2, "abcdefghij", 5, 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 5, 1, 4); - test("abcdefghij", 9, 2, "abcdefghij", 5, 2, 4); - test("abcdefghij", 9, 2, "abcdefghij", 5, 4, 4); - test("abcdefghij", 9, 2, "abcdefghij", 5, 5, 4); - test("abcdefghij", 9, 2, "abcdefghij", 5, 6, 4); - test("abcdefghij", 9, 2, "abcdefghij", 9, 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 9, 1, 0); - test("abcdefghij", 9, 2, "abcdefghij", 9, 2, 0); - test("abcdefghij", 9, 2, "abcdefghij", 10, 0, 1); - test("abcdefghij", 9, 2, "abcdefghij", 10, 1, 1); - test("abcdefghij", 9, 2, "abcdefghij", 11, 0, 0); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 1, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 10, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 19, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 20, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 0, 21, 9); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 1, 8); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 9, 8); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 18, 8); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 19, 8); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 1, 20, 8); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 5, -1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 9, -1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 10, -1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 10, 11, -1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 1, -10); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 19, 2, -10); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghij", 9, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 10, 0, "", 0, 0, 0); - test("abcdefghij", 10, 0, "", 0, 1, 0); - test("abcdefghij", 10, 0, "", 1, 0, 0); - test("abcdefghij", 10, 0, "abcde", 0, 0, 0); - test("abcdefghij", 10, 0, "abcde", 0, 1, -1); - test("abcdefghij", 10, 0, "abcde", 0, 2, -2); - test("abcdefghij", 10, 0, "abcde", 0, 4, -4); - test("abcdefghij", 10, 0, "abcde", 0, 5, -5); - test("abcdefghij", 10, 0, "abcde", 0, 6, -5); - test("abcdefghij", 10, 0, "abcde", 1, 0, 0); - test("abcdefghij", 10, 0, "abcde", 1, 1, -1); - test("abcdefghij", 10, 0, "abcde", 1, 2, -2); - test("abcdefghij", 10, 0, "abcde", 1, 3, -3); - test("abcdefghij", 10, 0, "abcde", 1, 4, -4); - test("abcdefghij", 10, 0, "abcde", 1, 5, -4); - test("abcdefghij", 10, 0, "abcde", 2, 0, 0); - test("abcdefghij", 10, 0, "abcde", 2, 1, -1); - test("abcdefghij", 10, 0, "abcde", 2, 2, -2); - test("abcdefghij", 10, 0, "abcde", 2, 3, -3); - test("abcdefghij", 10, 0, "abcde", 2, 4, -3); - test("abcdefghij", 10, 0, "abcde", 4, 0, 0); - test("abcdefghij", 10, 0, "abcde", 4, 1, -1); -} - -void test35() -{ - test("abcdefghij", 10, 0, "abcde", 4, 2, -1); - test("abcdefghij", 10, 0, "abcde", 5, 0, 0); - test("abcdefghij", 10, 0, "abcde", 5, 1, 0); - test("abcdefghij", 10, 0, "abcde", 6, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 0, 1, -1); - test("abcdefghij", 10, 0, "abcdefghij", 0, 5, -5); - test("abcdefghij", 10, 0, "abcdefghij", 0, 9, -9); - test("abcdefghij", 10, 0, "abcdefghij", 0, 10, -10); - test("abcdefghij", 10, 0, "abcdefghij", 0, 11, -10); - test("abcdefghij", 10, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 1, 1, -1); - test("abcdefghij", 10, 0, "abcdefghij", 1, 4, -4); - test("abcdefghij", 10, 0, "abcdefghij", 1, 8, -8); - test("abcdefghij", 10, 0, "abcdefghij", 1, 9, -9); - test("abcdefghij", 10, 0, "abcdefghij", 1, 10, -9); - test("abcdefghij", 10, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 5, 1, -1); - test("abcdefghij", 10, 0, "abcdefghij", 5, 2, -2); - test("abcdefghij", 10, 0, "abcdefghij", 5, 4, -4); - test("abcdefghij", 10, 0, "abcdefghij", 5, 5, -5); - test("abcdefghij", 10, 0, "abcdefghij", 5, 6, -5); - test("abcdefghij", 10, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 9, 1, -1); - test("abcdefghij", 10, 0, "abcdefghij", 9, 2, -1); - test("abcdefghij", 10, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 10, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 10, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 10, 1, "", 0, 0, 0); - test("abcdefghij", 10, 1, "", 0, 1, 0); - test("abcdefghij", 10, 1, "", 1, 0, 0); - test("abcdefghij", 10, 1, "abcde", 0, 0, 0); - test("abcdefghij", 10, 1, "abcde", 0, 1, -1); - test("abcdefghij", 10, 1, "abcde", 0, 2, -2); - test("abcdefghij", 10, 1, "abcde", 0, 4, -4); - test("abcdefghij", 10, 1, "abcde", 0, 5, -5); - test("abcdefghij", 10, 1, "abcde", 0, 6, -5); - test("abcdefghij", 10, 1, "abcde", 1, 0, 0); - test("abcdefghij", 10, 1, "abcde", 1, 1, -1); - test("abcdefghij", 10, 1, "abcde", 1, 2, -2); - test("abcdefghij", 10, 1, "abcde", 1, 3, -3); - test("abcdefghij", 10, 1, "abcde", 1, 4, -4); - test("abcdefghij", 10, 1, "abcde", 1, 5, -4); - test("abcdefghij", 10, 1, "abcde", 2, 0, 0); - test("abcdefghij", 10, 1, "abcde", 2, 1, -1); - test("abcdefghij", 10, 1, "abcde", 2, 2, -2); - test("abcdefghij", 10, 1, "abcde", 2, 3, -3); - test("abcdefghij", 10, 1, "abcde", 2, 4, -3); - test("abcdefghij", 10, 1, "abcde", 4, 0, 0); - test("abcdefghij", 10, 1, "abcde", 4, 1, -1); - test("abcdefghij", 10, 1, "abcde", 4, 2, -1); - test("abcdefghij", 10, 1, "abcde", 5, 0, 0); - test("abcdefghij", 10, 1, "abcde", 5, 1, 0); - test("abcdefghij", 10, 1, "abcde", 6, 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 0, 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 0, 1, -1); - test("abcdefghij", 10, 1, "abcdefghij", 0, 5, -5); - test("abcdefghij", 10, 1, "abcdefghij", 0, 9, -9); - test("abcdefghij", 10, 1, "abcdefghij", 0, 10, -10); - test("abcdefghij", 10, 1, "abcdefghij", 0, 11, -10); - test("abcdefghij", 10, 1, "abcdefghij", 1, 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 1, 1, -1); - test("abcdefghij", 10, 1, "abcdefghij", 1, 4, -4); - test("abcdefghij", 10, 1, "abcdefghij", 1, 8, -8); - test("abcdefghij", 10, 1, "abcdefghij", 1, 9, -9); - test("abcdefghij", 10, 1, "abcdefghij", 1, 10, -9); - test("abcdefghij", 10, 1, "abcdefghij", 5, 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 5, 1, -1); - test("abcdefghij", 10, 1, "abcdefghij", 5, 2, -2); - test("abcdefghij", 10, 1, "abcdefghij", 5, 4, -4); - test("abcdefghij", 10, 1, "abcdefghij", 5, 5, -5); - test("abcdefghij", 10, 1, "abcdefghij", 5, 6, -5); - test("abcdefghij", 10, 1, "abcdefghij", 9, 0, 0); - test("abcdefghij", 10, 1, "abcdefghij", 9, 1, -1); - test("abcdefghij", 10, 1, "abcdefghij", 9, 2, -1); - test("abcdefghij", 10, 1, "abcdefghij", 10, 0, 0); -} - -void test36() -{ - test("abcdefghij", 10, 1, "abcdefghij", 10, 1, 0); - test("abcdefghij", 10, 1, "abcdefghij", 11, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghij", 11, 0, "", 0, 0, 0); - test("abcdefghij", 11, 0, "", 0, 1, 0); - test("abcdefghij", 11, 0, "", 1, 0, 0); - test("abcdefghij", 11, 0, "abcde", 0, 0, 0); - test("abcdefghij", 11, 0, "abcde", 0, 1, 0); - test("abcdefghij", 11, 0, "abcde", 0, 2, 0); - test("abcdefghij", 11, 0, "abcde", 0, 4, 0); - test("abcdefghij", 11, 0, "abcde", 0, 5, 0); - test("abcdefghij", 11, 0, "abcde", 0, 6, 0); - test("abcdefghij", 11, 0, "abcde", 1, 0, 0); - test("abcdefghij", 11, 0, "abcde", 1, 1, 0); - test("abcdefghij", 11, 0, "abcde", 1, 2, 0); - test("abcdefghij", 11, 0, "abcde", 1, 3, 0); - test("abcdefghij", 11, 0, "abcde", 1, 4, 0); - test("abcdefghij", 11, 0, "abcde", 1, 5, 0); - test("abcdefghij", 11, 0, "abcde", 2, 0, 0); - test("abcdefghij", 11, 0, "abcde", 2, 1, 0); - test("abcdefghij", 11, 0, "abcde", 2, 2, 0); - test("abcdefghij", 11, 0, "abcde", 2, 3, 0); - test("abcdefghij", 11, 0, "abcde", 2, 4, 0); - test("abcdefghij", 11, 0, "abcde", 4, 0, 0); - test("abcdefghij", 11, 0, "abcde", 4, 1, 0); - test("abcdefghij", 11, 0, "abcde", 4, 2, 0); - test("abcdefghij", 11, 0, "abcde", 5, 0, 0); - test("abcdefghij", 11, 0, "abcde", 5, 1, 0); - test("abcdefghij", 11, 0, "abcde", 6, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 5, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 9, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 10, 0); - test("abcdefghij", 11, 0, "abcdefghij", 0, 11, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 4, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 8, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 9, 0); - test("abcdefghij", 11, 0, "abcdefghij", 1, 10, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 2, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 4, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 5, 0); - test("abcdefghij", 11, 0, "abcdefghij", 5, 6, 0); - test("abcdefghij", 11, 0, "abcdefghij", 9, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 9, 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 9, 2, 0); - test("abcdefghij", 11, 0, "abcdefghij", 10, 0, 0); - test("abcdefghij", 11, 0, "abcdefghij", 10, 1, 0); - test("abcdefghij", 11, 0, "abcdefghij", 11, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 19, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 20, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 0, 21, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 18, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 19, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 1, 20, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 5, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 9, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 10, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 10, 11, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 19, 2, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghij", 11, 0, "abcdefghijklmnopqrst", 21, 0, 0); -} - -void test37() -{ - test("abcdefghijklmnopqrst", 0, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 0, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 2, -2); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 0, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 0, 1, "", 0, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "", 0, 1, 1); - test("abcdefghijklmnopqrst", 0, 1, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 2, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 4, -3); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 5, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 0, 6, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 3, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 1, 5, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 1, -2); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 3, -2); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 2, 4, -2); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 1, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 4, 2, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 5, 1, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcde", 6, 0, 0); -} - -void test38() -{ - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 5, -4); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 9, -8); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 10, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 0, 11, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 8, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 1, 10, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 1, -5); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 2, -5); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 4, -5); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 1, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 9, 2, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 10, 1, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 10, -9); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 19, -18); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 20, -19); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 0, 21, -19); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghijklmnopqrst", 0, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 0, 10, "", 0, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "", 0, 1, 10); - test("abcdefghijklmnopqrst", 0, 10, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 1, 9); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 2, 8); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 4, 6); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 5, 5); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 0, 6, 5); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 3, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 1, 5, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 1, -2); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 3, -2); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 2, 4, -2); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 1, -4); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 4, 2, -4); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 5, 1, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 1, 9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 5, 5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 10, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 0, 11, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 8, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 1, 10, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 1, -5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 2, -5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 4, -5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 1, -9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 9, 2, -9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 10, 1, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 1, 9); -} - -void test39() -{ - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 19, -9); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 20, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 0, 21, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 0, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 20, 1, 10); - test("abcdefghijklmnopqrst", 0, 10, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 0, 19, "", 0, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 19, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 2, 17); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 4, 15); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 5, 14); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 0, 6, 14); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 3, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 1, 5, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 1, -2); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 3, -2); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 2, 4, -2); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 1, -4); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 4, 2, -4); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 5, 1, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 5, 14); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 10, 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 0, 11, 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 8, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 1, 10, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 1, -5); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 2, -5); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 4, -5); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 1, -9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 9, 2, -9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 10, 1, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 1, 18); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 10, 9); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 19, 0); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 20, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 0, 21, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 0, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 20, 1, 19); - test("abcdefghijklmnopqrst", 0, 19, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 0, 20, "", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "", 0, 1, 20); - test("abcdefghijklmnopqrst", 0, 20, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 0, 20); -} - -void test40() -{ - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 2, 18); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 4, 16); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 5, 15); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 0, 6, 15); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 3, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 1, 5, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 1, -2); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 3, -2); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 2, 4, -2); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 1, -4); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 4, 2, -4); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 5, 1, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 5, 15); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 9, 11); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 8, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 1, 10, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 1, -5); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 2, -5); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 4, -5); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 1, -9); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 9, 2, -9); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 10, 1, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 20, 0); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 0, 21, 0); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 0, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 20, 1, 20); - test("abcdefghijklmnopqrst", 0, 20, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 0, 21, "", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "", 0, 1, 20); - test("abcdefghijklmnopqrst", 0, 21, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 2, 18); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 4, 16); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 5, 15); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 0, 6, 15); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 3, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 1, 5, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 1, -2); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 3, -2); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 2, 4, -2); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 1, -4); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 4, 2, -4); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 5, 1, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 5, 15); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 9, 11); -} - -void test41() -{ - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 4, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 8, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 1, 10, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 1, -5); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 2, -5); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 4, -5); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 1, -9); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 9, 2, -9); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 10, 1, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 1, 19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 20, 0); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 0, 21, 0); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 9, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 18, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 1, -10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 5, -10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 9, -10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 1, -19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 19, 2, -19); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 0, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 20, 1, 20); - test("abcdefghijklmnopqrst", 0, 21, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 1, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 2, -2); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 0, 21, -20); -} - -void test42() -{ - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 1, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 1, "", 0, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 2, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 4, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 0, 6, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 1, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 2, -1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 3, -2); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 4, -3); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 1, 5, -3); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 2, -1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 3, -1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 2, 4, -1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 1, -3); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 4, 2, -3); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 5, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 0, 11, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 1, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 4, -3); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 8, -7); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 9, -8); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 1, 10, -8); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 1, -4); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 2, -4); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 5, -4); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 5, 6, -4); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 1, -8); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 9, 2, -8); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 10, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 1, 0); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 9, -8); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 18, -17); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 19, -18); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 1, 20, -18); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghijklmnopqrst", 1, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 9, "", 0, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "", 0, 1, 9); - test("abcdefghijklmnopqrst", 1, 9, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 2, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 4, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 5, 1); -} - -void test43() -{ - test("abcdefghijklmnopqrst", 1, 9, "abcde", 0, 6, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 1, 8); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 2, 7); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 3, 6); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 4, 5); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 1, 5, 5); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 2, -1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 3, -1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 2, 4, -1); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 1, -3); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 4, 2, -3); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 5, 1, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 0, 11, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 1, 8); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 4, 5); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 8, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 9, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 1, 10, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 1, -4); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 2, -4); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 5, -4); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 5, 6, -4); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 1, -8); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 9, 2, -8); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 10, 1, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 1, 8); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 18, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 19, -10); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 1, 20, -10); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 0, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 20, 1, 9); - test("abcdefghijklmnopqrst", 1, 9, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 18, "", 0, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "", 0, 1, 18); - test("abcdefghijklmnopqrst", 1, 18, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 2, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 4, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 0, 6, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 1, 17); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 2, 16); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 3, 15); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 4, 14); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 1, 5, 14); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 2, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 3, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 2, 4, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 1, -3); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 4, 2, -3); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 5, 1, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 0, 11, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 1, 17); -} - -void test44() -{ - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 4, 14); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 8, 10); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 1, 10, 9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 1, -4); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 2, -4); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 5, -4); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 5, 6, -4); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 1, -8); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 9, 2, -8); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 10, 1, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 1, 17); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 18, 0); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 19, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 1, 20, -1); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 0, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 20, 1, 18); - test("abcdefghijklmnopqrst", 1, 18, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 19, "", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "", 0, 1, 19); - test("abcdefghijklmnopqrst", 1, 19, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 2, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 4, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 0, 6, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 2, 17); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 3, 16); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 4, 15); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 1, 5, 15); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 2, -1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 3, -1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 2, 4, -1); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 1, -3); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 4, 2, -3); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 5, 1, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 0, 11, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 4, 15); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 8, 11); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 9, 10); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 1, 10, 10); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 1, -4); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 2, -4); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 5, -4); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 5, 6, -4); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 1, -8); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 9, 2, -8); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 10, 1, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 9, 10); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 18, 1); -} - -void test45() -{ - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 19, 0); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 1, 20, 0); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 0, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 20, 1, 19); - test("abcdefghijklmnopqrst", 1, 19, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 1, 20, "", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "", 0, 1, 19); - test("abcdefghijklmnopqrst", 1, 20, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 2, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 4, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 0, 6, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 2, 17); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 3, 16); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 4, 15); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 1, 5, 15); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 2, -1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 3, -1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 2, 4, -1); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 1, -3); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 4, 2, -3); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 5, 1, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 5, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 9, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 0, 11, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 4, 15); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 8, 11); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 9, 10); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 1, 10, 10); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 1, -4); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 2, -4); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 5, -4); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 5, 6, -4); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 1, -8); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 9, 2, -8); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 10, 1, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 1, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 10, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 19, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 20, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 0, 21, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 1, 18); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 9, 10); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 18, 1); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 19, 0); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 1, 20, 0); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 1, -9); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 5, -9); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 1, -18); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 19, 2, -18); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 0, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 20, 1, 19); - test("abcdefghijklmnopqrst", 1, 20, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 10, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 2, -2); -} - -void test46() -{ - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 10, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 1, "", 0, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "", 0, 1, 1); - test("abcdefghijklmnopqrst", 10, 1, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 2, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 4, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 0, 6, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 2, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 3, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 1, 5, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 1, 8); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 2, 8); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 3, 8); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 2, 4, 8); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 1, 6); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 4, 2, 6); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 5, 1, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 8, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 1, 10, 9); -} - -void test47() -{ - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 2, 5); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 4, 5); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 5, 5); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 5, 6, 5); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 1, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 9, 2, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 10, 1, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 19, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 20, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 0, 21, 10); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 18, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 19, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 1, 20, 9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 1, 0); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 5, -4); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 9, -8); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 10, -9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 10, 11, -9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 1, -9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 19, 2, -9); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghijklmnopqrst", 10, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 5, "", 0, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "", 0, 1, 5); - test("abcdefghijklmnopqrst", 10, 5, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 2, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 4, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 0, 6, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 2, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 3, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 1, 5, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 1, 8); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 2, 8); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 3, 8); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 2, 4, 8); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 1, 6); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 4, 2, 6); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 8, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 1, 10, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 2, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 4, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 5, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 5, 6, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 1, 1); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 9, 2, 1); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 10, 1, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 19, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 20, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 0, 21, 10); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 18, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 19, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 1, 20, 9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 1, 4); -} - -void test48() -{ - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 5, 0); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 9, -4); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 10, -5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 10, 11, -5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 1, -9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 19, 2, -9); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 0, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 20, 1, 5); - test("abcdefghijklmnopqrst", 10, 5, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 9, "", 0, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "", 0, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 2, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 4, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 0, 6, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 2, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 3, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 1, 5, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 1, 8); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 2, 8); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 3, 8); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 2, 4, 8); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 1, 6); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 4, 2, 6); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 5, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 8, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 1, 10, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 2, 5); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 4, 5); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 5, 5); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 5, 6, 5); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 1, 1); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 9, 2, 1); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 10, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 19, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 20, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 0, 21, 10); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 18, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 19, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 1, 20, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 1, 8); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 5, 4); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 9, 0); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 10, -1); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 10, 11, -1); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 1, -9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 19, 2, -9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 0, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 20, 1, 9); - test("abcdefghijklmnopqrst", 10, 9, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 10, "", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 2, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 4, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 0, 6, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 2, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 3, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 1, 5, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 0, 10); -} - -void test49() -{ - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 1, 8); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 2, 8); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 3, 8); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 2, 4, 8); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 1, 6); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 4, 2, 6); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 5, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 8, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 1, 10, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 2, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 4, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 5, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 5, 6, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 1, 1); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 9, 2, 1); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 10, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 19, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 20, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 0, 21, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 18, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 19, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 1, 20, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 1, 9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 5, 5); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 9, 1); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 10, 0); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 10, 11, 0); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 1, -9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 19, 2, -9); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 0, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 20, 1, 10); - test("abcdefghijklmnopqrst", 10, 10, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 10, 11, "", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 2, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 4, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 0, 6, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 2, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 3, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 1, 5, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 1, 8); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 2, 8); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 3, 8); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 2, 4, 8); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 1, 6); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 4, 2, 6); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 5, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 5, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 9, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 0, 11, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 4, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 8, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 1, 10, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 1, 5); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 2, 5); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 4, 5); -} - -void test50() -{ - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 5, 5); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 5, 6, 5); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 1, 1); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 9, 2, 1); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 10, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 10, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 19, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 20, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 0, 21, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 1, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 9, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 18, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 19, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 1, 20, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 1, 9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 5, 5); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 9, 1); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 10, 0); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 10, 11, 0); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 1, -9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 19, 2, -9); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 0, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 20, 1, 10); - test("abcdefghijklmnopqrst", 10, 11, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 19, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 2, -2); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 10, 11, -10); -} - -void test51() -{ - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 19, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 19, 1, "", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "", 0, 1, 1); - test("abcdefghijklmnopqrst", 19, 1, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 2, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 4, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 5, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 0, 6, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 2, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 3, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 4, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 1, 5, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 1, 17); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 2, 17); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 3, 17); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 2, 4, 17); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 1, 15); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 4, 2, 15); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 5, 1, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 5, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 9, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 10, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 0, 11, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 4, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 8, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 9, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 1, 10, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 1, 14); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 2, 14); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 4, 14); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 5, 14); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 5, 6, 14); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 1, 10); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 9, 2, 10); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 10, 1, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 10, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 19, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 20, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 0, 21, 19); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 9, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 18, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 19, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 1, 20, 18); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 1, 9); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 5, 9); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 9, 9); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 10, 9); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 10, 11, 9); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 1, 0); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 19, 2, 0); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghijklmnopqrst", 19, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 19, 2, "", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "", 0, 1, 1); - test("abcdefghijklmnopqrst", 19, 2, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 2, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 4, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 5, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 0, 6, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 2, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 3, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 4, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 1, 5, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 1, 17); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 2, 17); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 3, 17); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 2, 4, 17); -} - -void test52() -{ - test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 1, 15); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 4, 2, 15); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 5, 1, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 5, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 9, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 10, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 0, 11, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 4, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 8, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 9, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 1, 10, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 1, 14); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 2, 14); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 4, 14); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 5, 14); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 5, 6, 14); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 1, 10); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 9, 2, 10); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 10, 1, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 1, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 10, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 19, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 20, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 0, 21, 19); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 1, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 9, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 18, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 19, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 1, 20, 18); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 1, 9); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 5, 9); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 9, 9); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 10, 9); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 10, 11, 9); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 1, 0); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 19, 2, 0); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 0, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 20, 1, 1); - test("abcdefghijklmnopqrst", 19, 2, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 20, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 2, -2); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 1, -1); -} - -void test53() -{ - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 20, 0, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 20, 1, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 2, -2); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 4, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 0, 6, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 2, -2); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 3, -3); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 4, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 1, 5, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 2, -2); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 3, -3); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 2, 4, -3); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 4, 2, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 9, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 10, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 0, 11, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 4, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 8, -8); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 9, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 1, 10, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 2, -2); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 4, -4); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 5, 6, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 9, 2, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 10, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 19, -19); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 20, -20); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 0, 21, -20); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 9, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 18, -18); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 19, -19); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 1, 20, -19); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 5, -5); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 9, -9); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 10, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 10, 11, -10); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 1, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 19, 2, -1); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 0, 0); -} - -void test54() -{ - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 20, 1, "abcdefghijklmnopqrst", 21, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "", 0, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "", 0, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "", 1, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 0, 6, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 3, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 1, 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 3, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 2, 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 4, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 5, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcde", 6, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 9, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 0, 11, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 8, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 9, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 1, 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 4, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 5, 6, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 9, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 10, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghij", 11, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 19, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 20, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 0, 21, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 9, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 18, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 19, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 1, 20, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 5, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 9, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 10, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 10, 11, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 19, 2, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 0, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 20, 1, 0); - test("abcdefghijklmnopqrst", 21, 0, "abcdefghijklmnopqrst", 21, 0, 0); -} - - -int main () { - test0(); - test1(); - test2(); - test3(); - test4(); - test5(); - test6(); - test7(); - test8(); - test9(); - test10(); - test11(); - test12(); - test13(); - test14(); - test15(); - test16(); - test17(); - test18(); - test19(); - test20(); - test21(); - test22(); - test23(); - test24(); - test25(); - test26(); - test27(); - test28(); - test29(); - test30(); - test31(); - test32(); - test33(); - test34(); - test35(); - test36(); - test37(); - test38(); - test39(); - test40(); - test41(); - test42(); - test43(); - test44(); - test45(); - test46(); - test47(); - test48(); - test49(); - test50(); - test51(); - test52(); - test53(); - test54(); - - - { - test("abcde", 5, 1, "", 0, 0, 0); - test("abcde", 2, 4, "", 0, 0, 3); - test("abcde", 2, 4, "abcde", 3, 4, -2); - test("ABCde", 2, 4, "abcde", 2, 4, -1); - } - - { - test(L"abcde", 5, 1, L"", 0, 0, 0); - test(L"abcde", 2, 4, L"", 0, 0, 3); - test(L"abcde", 2, 4, L"abcde", 3, 4, -2); - test(L"ABCde", 2, 4, L"abcde", 2, 4, -1); - } - -#if TEST_STD_VER >= 11 - { - test(u"abcde", 5, 1, u"", 0, 0, 0); - test(u"abcde", 2, 4, u"", 0, 0, 3); - test(u"abcde", 2, 4, u"abcde", 3, 4, -2); - test(u"ABCde", 2, 4, u"abcde", 2, 4, -1); - } - - { - test(U"abcde", 5, 1, U"", 0, 0, 0); - test(U"abcde", 2, 4, U"", 0, 0, 3); - test(U"abcde", 2, 4, U"abcde", 3, 4, -2); - test(U"ABCde", 2, 4, U"abcde", 2, 4, -1); - } -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1 { "abcde", 5 }; - static_assert ( sv1.compare(5, 1, "", 0, 0) == 0, "" ); - static_assert ( sv1.compare(2, 4, "", 0, 0) == 1, "" ); - static_assert ( sv1.compare(2, 4, "abcde", 3, 4) == -1, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp b/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp deleted file mode 100644 index ff01daaf1ce41..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/compare.sv.pass.cpp +++ /dev/null @@ -1,122 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> -// constexpr int compare(basic_string_view str) const noexcept; - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" -#include "constexpr_char_traits.hpp" - -int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); } - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv1, - std::experimental::basic_string_view<CharT> sv2, int expected ) { - assert ( sign( sv1.compare(sv2)) == sign(expected)); -} - - -template<typename CharT> -void test ( const CharT *s1, const CharT *s2, int expected ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - - string_view_t sv1 ( s1 ); - string_view_t sv2 ( s2 ); - test1(sv1, sv2, expected); -} - -int main () { - - test("", "", 0); - test("", "abcde", -5); - test("", "abcdefghij", -10); - test("", "abcdefghijklmnopqrst", -20); - test("abcde", "", 5); - test("abcde", "abcde", 0); - test("abcde", "abcdefghij", -5); - test("abcde", "abcdefghijklmnopqrst", -15); - test("abcdefghij", "", 10); - test("abcdefghij", "abcde", 5); - test("abcdefghij", "abcdefghij", 0); - test("abcdefghij", "abcdefghijklmnopqrst", -10); - test("abcdefghijklmnopqrst", "", 20); - test("abcdefghijklmnopqrst", "abcde", 15); - test("abcdefghijklmnopqrst", "abcdefghij", 10); - test("abcdefghijklmnopqrst", "abcdefghijklmnopqrst", 0); - - test(L"", L"", 0); - test(L"", L"abcde", -5); - test(L"", L"abcdefghij", -10); - test(L"", L"abcdefghijklmnopqrst", -20); - test(L"abcde", L"", 5); - test(L"abcde", L"abcde", 0); - test(L"abcde", L"abcdefghij", -5); - test(L"abcde", L"abcdefghijklmnopqrst", -15); - test(L"abcdefghij", L"", 10); - test(L"abcdefghij", L"abcde", 5); - test(L"abcdefghij", L"abcdefghij", 0); - test(L"abcdefghij", L"abcdefghijklmnopqrst", -10); - test(L"abcdefghijklmnopqrst", L"", 20); - test(L"abcdefghijklmnopqrst", L"abcde", 15); - test(L"abcdefghijklmnopqrst", L"abcdefghij", 10); - test(L"abcdefghijklmnopqrst", L"abcdefghijklmnopqrst", 0); - -#if TEST_STD_VER >= 11 - test(u"", u"", 0); - test(u"", u"abcde", -5); - test(u"", u"abcdefghij", -10); - test(u"", u"abcdefghijklmnopqrst", -20); - test(u"abcde", u"", 5); - test(u"abcde", u"abcde", 0); - test(u"abcde", u"abcdefghij", -5); - test(u"abcde", u"abcdefghijklmnopqrst", -15); - test(u"abcdefghij", u"", 10); - test(u"abcdefghij", u"abcde", 5); - test(u"abcdefghij", u"abcdefghij", 0); - test(u"abcdefghij", u"abcdefghijklmnopqrst", -10); - test(u"abcdefghijklmnopqrst", u"", 20); - test(u"abcdefghijklmnopqrst", u"abcde", 15); - test(u"abcdefghijklmnopqrst", u"abcdefghij", 10); - test(u"abcdefghijklmnopqrst", u"abcdefghijklmnopqrst", 0); - - test(U"", U"", 0); - test(U"", U"abcde", -5); - test(U"", U"abcdefghij", -10); - test(U"", U"abcdefghijklmnopqrst", -20); - test(U"abcde", U"", 5); - test(U"abcde", U"abcde", 0); - test(U"abcde", U"abcdefghij", -5); - test(U"abcde", U"abcdefghijklmnopqrst", -15); - test(U"abcdefghij", U"", 10); - test(U"abcdefghij", U"abcde", 5); - test(U"abcdefghij", U"abcdefghij", 0); - test(U"abcdefghij", U"abcdefghijklmnopqrst", -10); - test(U"abcdefghijklmnopqrst", U"", 20); - test(U"abcdefghijklmnopqrst", U"abcde", 15); - test(U"abcdefghijklmnopqrst", U"abcdefghij", 10); - test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0); -#endif - -#if TEST_STD_VER > 11 - { - typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV; - constexpr SV sv1 { "abcde", 5 }; - constexpr SV sv2 { "abcde", 5 }; - constexpr SV sv3 { "edcba0", 6 }; - static_assert ( sv1.compare(sv2) == 0, "" ); - static_assert ( sv2.compare(sv1) == 0, "" ); - static_assert ( sv3.compare(sv2) > 0, "" ); - static_assert ( sv2.compare(sv3) < 0, "" ); - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp b/test/std/experimental/string.view/string.view.ops/copy.pass.cpp deleted file mode 100644 index 0acd5bda40112..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/copy.pass.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// size_type copy(charT* s, size_type n, size_type pos = 0) const; - -// Throws: out_of_range if pos > size(). -// Remarks: Let rlen be the smaller of n and size() - pos. -// Requires: [s, s+rlen) is a valid range. -// Effects: Equivalent to std::copy_n(begin() + pos, rlen, s). -// Returns: rlen. - - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t pos ) { - const size_t rlen = std::min ( n, sv.size() - pos ); - - CharT *dest1 = new CharT [rlen + 1]; dest1[rlen] = 0; - CharT *dest2 = new CharT [rlen + 1]; dest2[rlen] = 0; - - if (pos > sv.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - sv.copy(dest1, n, pos); - assert(false); - } catch (const std::out_of_range&) { - } catch (...) { - assert(false); - } -#endif - } else { - sv.copy(dest1, n, pos); - std::copy_n(sv.begin() + pos, rlen, dest2); - for ( size_t i = 0; i <= rlen; ++i ) - assert ( dest1[i] == dest2[i] ); - } - delete [] dest1; - delete [] dest2; -} - - -template<typename CharT> -void test ( const CharT *s ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - - string_view_t sv1 ( s ); - - test1(sv1, 0, 0); - test1(sv1, 1, 0); - test1(sv1, 20, 0); - test1(sv1, sv1.size(), 0); - test1(sv1, 20, string_view_t::npos); - - test1(sv1, 0, 3); - test1(sv1, 2, 3); - test1(sv1, 100, 3); - test1(sv1, 100, string_view_t::npos); - - test1(sv1, sv1.size(), string_view_t::npos); - - test1(sv1, sv1.size() + 1, 0); - test1(sv1, sv1.size() + 1, 1); - test1(sv1, sv1.size() + 1, string_view_t::npos); - -} - -int main () { - test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( "ABCDE"); - test ( "a" ); - test ( "" ); - - test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( L"ABCDE" ); - test ( L"a" ); - test ( L"" ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( u"ABCDE" ); - test ( u"a" ); - test ( u"" ); - - test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( U"ABCDE" ); - test ( U"a" ); - test ( U"" ); -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp b/test/std/experimental/string.view/string.view.ops/substr.pass.cpp deleted file mode 100644 index a3a1dbf418b84..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/substr.pass.cpp +++ /dev/null @@ -1,119 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string_view> - -// constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; - -// Throws: out_of_range if pos > size(). -// Effects: Determines the effective length rlen of the string to reference as the smaller of n and size() - pos. -// Returns: basic_string_view(data()+pos, rlen). - -#include <experimental/string_view> -#include <cassert> - -#include "test_macros.h" - -template<typename CharT> -void test1 ( std::experimental::basic_string_view<CharT> sv, size_t n, size_t pos ) { - if (pos > sv.size()) { -#ifndef TEST_HAS_NO_EXCEPTIONS - try { - std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n); - assert(false); - ((void)sv1); - } catch (const std::out_of_range&) { - return; - } catch (...) { - assert(false); - } -#endif - } else { - std::experimental::basic_string_view<CharT> sv1 = sv.substr(pos, n); - const size_t rlen = std::min ( n, sv.size() - pos ); - assert ( sv1.size() == rlen ); - for ( size_t i = 0; i <= rlen; ++i ) - assert ( sv[pos+i] == sv1[i] ); - } -} - - -template<typename CharT> -void test ( const CharT *s ) { - typedef std::experimental::basic_string_view<CharT> string_view_t; - - string_view_t sv1 ( s ); - - test1(sv1, 0, 0); - test1(sv1, 1, 0); - test1(sv1, 20, 0); - test1(sv1, sv1.size(), 0); - - test1(sv1, 0, 3); - test1(sv1, 2, 3); - test1(sv1, 100, 3); - - test1(sv1, 0, string_view_t::npos); - test1(sv1, 2, string_view_t::npos); - test1(sv1, sv1.size(), string_view_t::npos); - - test1(sv1, sv1.size() + 1, 0); - test1(sv1, sv1.size() + 1, 1); - test1(sv1, sv1.size() + 1, string_view_t::npos); -} - -int main () { - test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( "ABCDE"); - test ( "a" ); - test ( "" ); - - test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( L"ABCDE" ); - test ( L"a" ); - test ( L"" ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( u"ABCDE" ); - test ( u"a" ); - test ( u"" ); - - test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( U"ABCDE" ); - test ( U"a" ); - test ( U"" ); -#endif - -#if TEST_STD_VER > 11 - { - constexpr std::experimental::string_view sv1 { "ABCDE", 5 }; - - { - constexpr std::experimental::string_view sv2 = sv1.substr ( 0, 3 ); - static_assert ( sv2.size() == 3, "" ); - static_assert ( sv2[0] == 'A', "" ); - static_assert ( sv2[1] == 'B', "" ); - static_assert ( sv2[2] == 'C', "" ); - } - - { - constexpr std::experimental::string_view sv2 = sv1.substr ( 3, 0 ); - static_assert ( sv2.size() == 0, "" ); - } - - { - constexpr std::experimental::string_view sv2 = sv1.substr ( 3, 3 ); - static_assert ( sv2.size() == 2, "" ); - static_assert ( sv2[0] == 'D', "" ); - static_assert ( sv2[1] == 'E', "" ); - } - } -#endif -} diff --git a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp b/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp deleted file mode 100644 index a32a2684c5485..0000000000000 --- a/test/std/experimental/string.view/string.view.ops/to_string.pass.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -// <string_view> - -// template<class Allocator> -// explicit operator basic_string<_CharT, _Traits, Allocator> () const; -// template<class _CharT, class _Traits = char_traits<_CharT>, class Allocator = allocator<_CharT> > -// basic_string<_CharT, _Traits, Allocator> to_string ( -// basic_string_view<_CharT, _Traits> _sv, const Allocator& _a = Allocator()) const; - -#include <experimental/string_view> -#include <cassert> -#include "min_allocator.h" - -template<typename CharT> -void test ( const CharT *s ) { - typedef std::basic_string<CharT> String ; - { - const std::experimental::basic_string_view<CharT> sv1 ( s ); - String str1 = (String) sv1; - - assert ( sv1.size() == str1.size ()); - assert ( std::char_traits<CharT>::compare ( sv1.data(), str1.data(), sv1.size()) == 0 ); - -#if TEST_STD_VER >= 11 - auto str2 = sv1.to_string(min_allocator<CharT>()); - assert ( sv1.size() == str2.size ()); - assert ( std::char_traits<CharT>::compare ( sv1.data(), str2.data(), sv1.size()) == 0 ); -#endif - } - - { - const std::experimental::basic_string_view<CharT> sv1; - String str1 = (String) sv1; - - assert ( sv1.size() == 0); - assert ( sv1.size() == str1.size ()); - -#if TEST_STD_VER >= 11 - auto str2 = sv1.to_string(min_allocator<CharT>()); - assert ( sv1.size() == str2.size ()); -#endif - } -} - -int main () { - test ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( "ABCDE"); - test ( "a" ); - test ( "" ); - - test ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( L"ABCDE" ); - test ( L"a" ); - test ( L"" ); - -#if TEST_STD_VER >= 11 - test ( u"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( u"ABCDE" ); - test ( u"a" ); - test ( u"" ); - - test ( U"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE" ); - test ( U"ABCDE" ); - test ( U"a" ); - test ( U"" ); -#endif -} diff --git a/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp b/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp deleted file mode 100644 index c21f8a701685b..0000000000000 --- a/test/std/experimental/string.view/string.view.synop/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <experimental/string_view> - -int main () {} diff --git a/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp b/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp deleted file mode 100644 index c21f8a701685b..0000000000000 --- a/test/std/experimental/string.view/string.view.template/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include <experimental/string_view> - -int main () {} diff --git a/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp deleted file mode 100644 index cb8db1febd275..0000000000000 --- a/test/std/experimental/utilities/meta/meta.logical/conjunction.pass.cpp +++ /dev/null @@ -1,68 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -// template<class... B> struct conjunction; // C++17 -// template<class... B> -// constexpr bool conjunction_v = conjunction<B...>::value; // C++17 - -#include <experimental/type_traits> -#include <cassert> - -namespace ex = std::experimental; - -struct True { static constexpr bool value = true; }; -struct False { static constexpr bool value = false; }; - -int main() -{ - static_assert ( ex::conjunction<>::value, "" ); - static_assert ( ex::conjunction<std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::false_type>::value, "" ); - - static_assert ( ex::conjunction_v<>, "" ); - static_assert ( ex::conjunction_v<std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::false_type>, "" ); - - static_assert ( ex::conjunction<std::true_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::true_type, std::false_type>::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::false_type>::value, "" ); - - static_assert ( ex::conjunction_v<std::true_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::true_type, std::false_type>, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::false_type>, "" ); - - static_assert ( ex::conjunction<std::true_type, std::true_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::true_type, std::false_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::true_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::false_type, std::true_type >::value, "" ); - static_assert (!ex::conjunction<std::true_type, std::true_type, std::false_type>::value, "" ); - static_assert (!ex::conjunction<std::true_type, std::false_type, std::false_type>::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::true_type, std::false_type>::value, "" ); - static_assert (!ex::conjunction<std::false_type, std::false_type, std::false_type>::value, "" ); - - static_assert ( ex::conjunction_v<std::true_type, std::true_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::true_type >, "" ); - static_assert (!ex::conjunction_v<std::true_type, std::true_type, std::false_type>, "" ); - static_assert (!ex::conjunction_v<std::true_type, std::false_type, std::false_type>, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::true_type, std::false_type>, "" ); - static_assert (!ex::conjunction_v<std::false_type, std::false_type, std::false_type>, "" ); - - static_assert ( ex::conjunction<True >::value, "" ); - static_assert (!ex::conjunction<False>::value, "" ); - - static_assert ( ex::conjunction_v<True >, "" ); - static_assert (!ex::conjunction_v<False>, "" ); -} diff --git a/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp deleted file mode 100644 index dcdbf09fb099c..0000000000000 --- a/test/std/experimental/utilities/meta/meta.logical/disjunction.pass.cpp +++ /dev/null @@ -1,68 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -// template<class... B> struct disjunction; -// template<class... B> -// constexpr bool disjunction_v = disjunction<B...>::value; - -#include <experimental/type_traits> -#include <cassert> - -namespace ex = std::experimental; - -struct True { static constexpr bool value = true; }; -struct False { static constexpr bool value = false; }; - -int main() -{ - static_assert (!ex::disjunction<>::value, "" ); - static_assert ( ex::disjunction<std::true_type >::value, "" ); - static_assert (!ex::disjunction<std::false_type>::value, "" ); - - static_assert (!ex::disjunction_v<>, "" ); - static_assert ( ex::disjunction_v<std::true_type >, "" ); - static_assert (!ex::disjunction_v<std::false_type>, "" ); - - static_assert ( ex::disjunction<std::true_type, std::true_type >::value, "" ); - static_assert ( ex::disjunction<std::true_type, std::false_type>::value, "" ); - static_assert ( ex::disjunction<std::false_type, std::true_type >::value, "" ); - static_assert (!ex::disjunction<std::false_type, std::false_type>::value, "" ); - - static_assert ( ex::disjunction_v<std::true_type, std::true_type >, "" ); - static_assert ( ex::disjunction_v<std::true_type, std::false_type>, "" ); - static_assert ( ex::disjunction_v<std::false_type, std::true_type >, "" ); - static_assert (!ex::disjunction_v<std::false_type, std::false_type>, "" ); - - static_assert ( ex::disjunction<std::true_type, std::true_type, std::true_type >::value, "" ); - static_assert ( ex::disjunction<std::true_type, std::false_type, std::true_type >::value, "" ); - static_assert ( ex::disjunction<std::false_type, std::true_type, std::true_type >::value, "" ); - static_assert ( ex::disjunction<std::false_type, std::false_type, std::true_type >::value, "" ); - static_assert ( ex::disjunction<std::true_type, std::true_type, std::false_type>::value, "" ); - static_assert ( ex::disjunction<std::true_type, std::false_type, std::false_type>::value, "" ); - static_assert ( ex::disjunction<std::false_type, std::true_type, std::false_type>::value, "" ); - static_assert (!ex::disjunction<std::false_type, std::false_type, std::false_type>::value, "" ); - - static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::true_type >, "" ); - static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::true_type >, "" ); - static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::true_type >, "" ); - static_assert ( ex::disjunction_v<std::false_type, std::false_type, std::true_type >, "" ); - static_assert ( ex::disjunction_v<std::true_type, std::true_type, std::false_type>, "" ); - static_assert ( ex::disjunction_v<std::true_type, std::false_type, std::false_type>, "" ); - static_assert ( ex::disjunction_v<std::false_type, std::true_type, std::false_type>, "" ); - static_assert (!ex::disjunction_v<std::false_type, std::false_type, std::false_type>, "" ); - - static_assert ( ex::disjunction<True >::value, "" ); - static_assert (!ex::disjunction<False>::value, "" ); - - static_assert ( ex::disjunction_v<True >, "" ); - static_assert (!ex::disjunction_v<False>, "" ); -} diff --git a/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp b/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp deleted file mode 100644 index b0d43d7e51229..0000000000000 --- a/test/std/experimental/utilities/meta/meta.logical/negation.pass.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -// template<class B> struct negation; -// template<class B> -// constexpr bool negation_v = negation<B>::value; - -#include <experimental/type_traits> -#include <cassert> - -namespace ex = std::experimental; - -struct True { static constexpr bool value = true; }; -struct False { static constexpr bool value = false; }; - -int main() -{ - static_assert (!ex::negation<std::true_type >::value, "" ); - static_assert ( ex::negation<std::false_type>::value, "" ); - - static_assert (!ex::negation_v<std::true_type >, "" ); - static_assert ( ex::negation_v<std::false_type>, "" ); - - static_assert (!ex::negation<True >::value, "" ); - static_assert ( ex::negation<False>::value, "" ); - - static_assert (!ex::negation_v<True >, "" ); - static_assert ( ex::negation_v<False>, "" ); - - static_assert ( ex::negation<ex::negation<std::true_type >>::value, "" ); - static_assert (!ex::negation<ex::negation<std::false_type>>::value, "" ); -} diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp deleted file mode 100644 index 8edc917303acf..0000000000000 --- a/test/std/experimental/utilities/meta/meta.type.synop/meta.rel.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -#include <experimental/type_traits> - -namespace ex = std::experimental; - -struct base_type {}; -struct derived_type : base_type {}; - -int main() -{ - { - typedef int T; - typedef int U; - static_assert(ex::is_same_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_same_v<T, U>), const bool>::value, ""); - static_assert(ex::is_same_v<T, U> == std::is_same<T, U>::value, ""); - } - { - typedef int T; - typedef long U; - static_assert(!ex::is_same_v<T, U>, ""); - static_assert(ex::is_same_v<T, U> == std::is_same<T, U>::value, ""); - } - { - typedef base_type T; - typedef derived_type U; - static_assert(ex::is_base_of_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_base_of_v<T, U>), const bool>::value, ""); - static_assert(ex::is_base_of_v<T, U> == std::is_base_of<T, U>::value, ""); - } - { - typedef int T; - typedef int U; - static_assert(!ex::is_base_of_v<T, U>, ""); - static_assert(ex::is_base_of_v<T, U> == std::is_base_of<T, U>::value, ""); - } - { - typedef int T; - typedef long U; - static_assert(ex::is_convertible_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_convertible_v<T, U>), const bool>::value, ""); - static_assert(ex::is_convertible_v<T, U> == std::is_convertible<T, U>::value, ""); - } - { - typedef void T; - typedef int U; - static_assert(!ex::is_convertible_v<T, U>, ""); - static_assert(ex::is_convertible_v<T, U> == std::is_convertible<T, U>::value, ""); - } -} - diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp deleted file mode 100644 index a4a91c1369278..0000000000000 --- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.cat.pass.cpp +++ /dev/null @@ -1,178 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -#include <experimental/type_traits> - -namespace ex = std::experimental; - -struct class_type {}; -enum enum_type {}; -union union_type {}; - -int main() -{ - { - typedef void T; - static_assert(ex::is_void_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_void_v<T>), const bool>::value, ""); - static_assert(ex::is_void_v<T> == std::is_void<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_void_v<T>, ""); - static_assert(ex::is_void_v<T> == std::is_void<T>::value, ""); - } - { - typedef decltype(nullptr) T; - static_assert(ex::is_null_pointer_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_null_pointer_v<T>), const bool>::value, ""); - static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_null_pointer_v<T>, ""); - static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_integral_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_integral_v<T>), const bool>::value, ""); - static_assert(ex::is_integral_v<T> == std::is_integral<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_integral_v<T>, ""); - static_assert(ex::is_integral_v<T> == std::is_integral<T>::value, ""); - } - { - typedef float T; - static_assert(ex::is_floating_point_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_floating_point_v<T>), const bool>::value, ""); - static_assert(ex::is_floating_point_v<T> == std::is_floating_point<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_floating_point_v<T>, ""); - static_assert(ex::is_floating_point_v<T> == std::is_floating_point<T>::value, ""); - } - { - typedef int(T)[42]; - static_assert(ex::is_array_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_array_v<T>), const bool>::value, ""); - static_assert(ex::is_array_v<T> == std::is_array<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_array_v<T>, ""); - static_assert(ex::is_array_v<T> == std::is_array<T>::value, ""); - } - { - typedef void* T; - static_assert(ex::is_pointer_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_pointer_v<T>), const bool>::value, ""); - static_assert(ex::is_pointer_v<T> == std::is_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_pointer_v<T>, ""); - static_assert(ex::is_pointer_v<T> == std::is_pointer<T>::value, ""); - } - { - typedef int & T; - static_assert(ex::is_lvalue_reference_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_lvalue_reference_v<T>), const bool>::value, ""); - static_assert(ex::is_lvalue_reference_v<T> == std::is_lvalue_reference<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_lvalue_reference_v<T>, ""); - static_assert(ex::is_lvalue_reference_v<T> == std::is_lvalue_reference<T>::value, ""); - } - { - typedef int && T; - static_assert(ex::is_rvalue_reference_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_rvalue_reference_v<T>), const bool>::value, ""); - static_assert(ex::is_rvalue_reference_v<T> == std::is_rvalue_reference<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_rvalue_reference_v<T>, ""); - static_assert(ex::is_rvalue_reference_v<T> == std::is_rvalue_reference<T>::value, ""); - } - { - typedef int class_type::*T; - static_assert(ex::is_member_object_pointer_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_member_object_pointer_v<T>), const bool>::value, ""); - static_assert(ex::is_member_object_pointer_v<T> == std::is_member_object_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_member_object_pointer_v<T>, ""); - static_assert(ex::is_member_object_pointer_v<T> == std::is_member_object_pointer<T>::value, ""); - } - { - typedef void(class_type::*T)(); - static_assert(ex::is_member_function_pointer_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_member_function_pointer_v<T>), const bool>::value, ""); - static_assert(ex::is_member_function_pointer_v<T> == std::is_member_function_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_member_function_pointer_v<T>, ""); - static_assert(ex::is_member_function_pointer_v<T> == std::is_member_function_pointer<T>::value, ""); - } - { - typedef enum_type T; - static_assert(ex::is_enum_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_enum_v<T>), const bool>::value, ""); - static_assert(ex::is_enum_v<T> == std::is_enum<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_enum_v<T>, ""); - static_assert(ex::is_enum_v<T> == std::is_enum<T>::value, ""); - } - { - typedef union_type T; - static_assert(ex::is_union_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_union_v<T>), const bool>::value, ""); - static_assert(ex::is_union_v<T> == std::is_union<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_union_v<T>, ""); - static_assert(ex::is_union_v<T> == std::is_union<T>::value, ""); - } - { - typedef class_type T; - static_assert(ex::is_class_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_class_v<T>), const bool>::value, ""); - static_assert(ex::is_class_v<T> == std::is_class<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_class_v<T>, ""); - static_assert(ex::is_class_v<T> == std::is_class<T>::value, ""); - } - { - typedef void(T)(); - static_assert(ex::is_function_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_function_v<T>), const bool>::value, ""); - static_assert(ex::is_function_v<T> == std::is_function<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_function_v<T>, ""); - static_assert(ex::is_function_v<T> == std::is_function<T>::value, ""); - } -} - diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp deleted file mode 100644 index b3927b120951e..0000000000000 --- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.comp.pass.cpp +++ /dev/null @@ -1,99 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -#include <experimental/type_traits> - -namespace ex = std::experimental; - -struct class_type {}; - -int main() -{ - { - typedef int & T; - static_assert(ex::is_reference_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_reference_v<T>), const bool>::value, ""); - static_assert(ex::is_reference_v<T> == std::is_reference<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_reference_v<T>, ""); - static_assert(ex::is_reference_v<T> == std::is_reference<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_arithmetic_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_arithmetic_v<T>), const bool>::value, ""); - static_assert(ex::is_arithmetic_v<T> == std::is_arithmetic<T>::value, ""); - } - { - typedef void* T; - static_assert(!ex::is_arithmetic_v<T>, ""); - static_assert(ex::is_arithmetic_v<T> == std::is_arithmetic<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_fundamental_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_fundamental_v<T>), const bool>::value, ""); - static_assert(ex::is_fundamental_v<T> == std::is_fundamental<T>::value, ""); - } - { - typedef class_type T; - static_assert(!ex::is_fundamental_v<T>, ""); - static_assert(ex::is_fundamental_v<T> == std::is_fundamental<T>::value, ""); - } - { - typedef class_type T; - static_assert(ex::is_object_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_object_v<T>), const bool>::value, ""); - static_assert(ex::is_object_v<T> == std::is_object<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_object_v<T>, ""); - static_assert(ex::is_object_v<T> == std::is_object<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_scalar_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_scalar_v<T>), const bool>::value, ""); - static_assert(ex::is_scalar_v<T> == std::is_scalar<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_scalar_v<T>, ""); - static_assert(ex::is_scalar_v<T> == std::is_scalar<T>::value, ""); - } - { - typedef void* T; - static_assert(ex::is_compound_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_compound_v<T>), const bool>::value, ""); - static_assert(ex::is_compound_v<T> == std::is_compound<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_compound_v<T>, ""); - static_assert(ex::is_compound_v<T> == std::is_compound<T>::value, ""); - } - { - typedef int class_type::*T; - static_assert(ex::is_member_pointer_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_member_pointer_v<T>), const bool>::value, ""); - static_assert(ex::is_member_pointer_v<T> == std::is_member_pointer<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_member_pointer_v<T>, ""); - static_assert(ex::is_member_pointer_v<T> == std::is_member_pointer<T>::value, ""); - } -} - diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp deleted file mode 100644 index bfd385a1b8e37..0000000000000 --- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp +++ /dev/null @@ -1,492 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// GCC returns true for __is_trivially_constructible(void, int) -// See gcc.gnu.org/PR80682 -// NOTE: This has been fixed in trunk and will be backported soon. -// XFAIL: gcc-7, gcc-6, gcc-5, gcc-4 - -// <experimental/type_traits> - -#include <experimental/type_traits> - -namespace ex = std::experimental; - -struct non_literal_type { non_literal_type() {} }; -struct empty_type {}; - -struct polymorphic_type -{ - virtual void foo() {} -}; - -struct abstract_type -{ - virtual void foo() = 0; -}; - -struct final_type final {}; - -struct virtual_dtor_type -{ - virtual ~virtual_dtor_type() {} -}; - -void type_properties_test() -{ - { - typedef const int T; - static_assert(ex::is_const_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_const_v<T>), const bool>::value, ""); - static_assert(ex::is_const_v<T> == std::is_const<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_const_v<T>, ""); - static_assert(ex::is_const_v<T> == std::is_const<T>::value, ""); - } - { - typedef volatile int T; - static_assert(ex::is_volatile_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_volatile_v<T>), const bool>::value, ""); - static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_volatile_v<T>, ""); - static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivial_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivial_v<T>), const bool>::value, ""); - static_assert(ex::is_trivial_v<T> == std::is_trivial<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_trivial_v<T>, ""); - static_assert(ex::is_trivial_v<T> == std::is_trivial<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_copyable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_copyable_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_copyable_v<T> == std::is_trivially_copyable<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_trivially_copyable_v<T>, ""); - static_assert(ex::is_trivially_copyable_v<T> == std::is_trivially_copyable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_standard_layout_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_standard_layout_v<T>), const bool>::value, ""); - static_assert(ex::is_standard_layout_v<T> == std::is_standard_layout<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_standard_layout_v<T>, ""); - static_assert(ex::is_standard_layout_v<T> == std::is_standard_layout<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_pod_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_pod_v<T>), const bool>::value, ""); - static_assert(ex::is_pod_v<T> == std::is_pod<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_pod_v<T>, ""); - static_assert(ex::is_pod_v<T> == std::is_pod<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_literal_type_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_literal_type_v<T>), const bool>::value, ""); - static_assert(ex::is_literal_type_v<T> == std::is_literal_type<T>::value, ""); - } - { - typedef non_literal_type T; - static_assert(!ex::is_literal_type_v<T>, ""); - static_assert(ex::is_literal_type_v<T> == std::is_literal_type<T>::value, ""); - } - { - typedef empty_type T; - static_assert(ex::is_empty_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_empty_v<T>), const bool>::value, ""); - static_assert(ex::is_empty_v<T> == std::is_empty<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_empty_v<T>, ""); - static_assert(ex::is_empty_v<T> == std::is_empty<T>::value, ""); - } - { - typedef polymorphic_type T; - static_assert(ex::is_polymorphic_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_polymorphic_v<T>), const bool>::value, ""); - static_assert(ex::is_polymorphic_v<T> == std::is_polymorphic<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_polymorphic_v<T>, ""); - static_assert(ex::is_polymorphic_v<T> == std::is_polymorphic<T>::value, ""); - } - { - typedef abstract_type T; - static_assert(ex::is_abstract_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_abstract_v<T>), const bool>::value, ""); - static_assert(ex::is_abstract_v<T> == std::is_abstract<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_abstract_v<T>, ""); - static_assert(ex::is_abstract_v<T> == std::is_abstract<T>::value, ""); - } - { - typedef final_type T; - static_assert(ex::is_final_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_final_v<T>), const bool>::value, ""); - static_assert(ex::is_final_v<T> == std::is_final<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_final_v<T>, ""); - static_assert(ex::is_final_v<T> == std::is_final<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_signed_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_signed_v<T>), const bool>::value, ""); - static_assert(ex::is_signed_v<T> == std::is_signed<T>::value, ""); - } - { - typedef unsigned T; - static_assert(!ex::is_signed_v<T>, ""); - static_assert(ex::is_signed_v<T> == std::is_signed<T>::value, ""); - } - { - typedef unsigned T; - static_assert(ex::is_unsigned_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_unsigned_v<T>), const bool>::value, ""); - static_assert(ex::is_unsigned_v<T> == std::is_unsigned<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::is_unsigned_v<T>, ""); - static_assert(ex::is_unsigned_v<T> == std::is_unsigned<T>::value, ""); - } -} - -void is_constructible_and_assignable_test() -{ - { - typedef int T; - static_assert(ex::is_constructible_v<T, int>, ""); - static_assert(std::is_same<decltype(ex::is_constructible_v<T, int>), const bool>::value, ""); - static_assert(ex::is_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_constructible_v<T, int>, ""); - static_assert(ex::is_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef int T; - static_assert(ex::is_default_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_default_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_default_constructible_v<T>, ""); - static_assert(ex::is_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_copy_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_copy_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_copy_constructible_v<T>, ""); - static_assert(ex::is_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_move_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_move_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_move_constructible_v<T>, ""); - static_assert(ex::is_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef int & T; - typedef int U; - static_assert(ex::is_assignable_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_assignable_v<T, U>), const bool>::value, ""); - static_assert(ex::is_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int & T; - typedef void U; - static_assert(!ex::is_assignable_v<T, U>, ""); - static_assert(ex::is_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int T; - static_assert(ex::is_copy_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_copy_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_copy_assignable_v<T>, ""); - static_assert(ex::is_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_move_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_move_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_move_assignable_v<T>, ""); - static_assert(ex::is_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_destructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_destructible_v<T>), const bool>::value, ""); - static_assert(ex::is_destructible_v<T> == std::is_destructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_destructible_v<T>, ""); - static_assert(ex::is_destructible_v<T> == std::is_destructible<T>::value, ""); - } -} - -void is_trivially_constructible_and_assignable_test() -{ - { - typedef int T; - static_assert(ex::is_trivially_constructible_v<T, int>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_constructible_v<T, int>), const bool>::value, ""); - static_assert(ex::is_trivially_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_constructible_v<T, int>, ""); - static_assert(ex::is_trivially_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_default_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_default_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_trivially_default_constructible_v<T>, ""); - static_assert(ex::is_trivially_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_copy_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_copy_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_copy_constructible_v<T>, ""); - static_assert(ex::is_trivially_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_move_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_move_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_move_constructible_v<T>, ""); - static_assert(ex::is_trivially_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef int & T; - typedef int U; - static_assert(ex::is_trivially_assignable_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_assignable_v<T, U>), const bool>::value, ""); - static_assert(ex::is_trivially_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int & T; - typedef void U; - static_assert(!ex::is_trivially_assignable_v<T, U>, ""); - static_assert(ex::is_trivially_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_copy_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_copy_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_copy_assignable_v<T>, ""); - static_assert(ex::is_trivially_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_move_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_move_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_move_assignable_v<T>, ""); - static_assert(ex::is_trivially_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_trivially_destructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_trivially_destructible_v<T>), const bool>::value, ""); - static_assert(ex::is_trivially_destructible_v<T> == std::is_destructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_trivially_destructible_v<T>, ""); - static_assert(ex::is_trivially_destructible_v<T> == std::is_destructible<T>::value, ""); - } -} - - - -void is_nothrow_constructible_and_assignable_test() -{ - { - typedef int T; - static_assert(ex::is_nothrow_constructible_v<T, int>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_constructible_v<T, int>), const bool>::value, ""); - static_assert(ex::is_nothrow_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_constructible_v<T, int>, ""); - static_assert(ex::is_nothrow_constructible_v<T, int> == std::is_constructible<T, int>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_default_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_default_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int & T; - static_assert(!ex::is_nothrow_default_constructible_v<T>, ""); - static_assert(ex::is_nothrow_default_constructible_v<T> == std::is_default_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_copy_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_copy_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_copy_constructible_v<T>, ""); - static_assert(ex::is_nothrow_copy_constructible_v<T> == std::is_copy_constructible<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_move_constructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_move_constructible_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_move_constructible_v<T>, ""); - static_assert(ex::is_nothrow_move_constructible_v<T> == std::is_move_constructible<T>::value, ""); - } - { - typedef int & T; - typedef int U; - static_assert(ex::is_nothrow_assignable_v<T, U>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_assignable_v<T, U>), const bool>::value, ""); - static_assert(ex::is_nothrow_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int & T; - typedef void U; - static_assert(!ex::is_nothrow_assignable_v<T, U>, ""); - static_assert(ex::is_nothrow_assignable_v<T, U> == std::is_assignable<T, U>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_copy_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_copy_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_copy_assignable_v<T>, ""); - static_assert(ex::is_nothrow_copy_assignable_v<T> == std::is_copy_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_move_assignable_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_move_assignable_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_move_assignable_v<T>, ""); - static_assert(ex::is_nothrow_move_assignable_v<T> == std::is_move_assignable<T>::value, ""); - } - { - typedef int T; - static_assert(ex::is_nothrow_destructible_v<T>, ""); - static_assert(std::is_same<decltype(ex::is_nothrow_destructible_v<T>), const bool>::value, ""); - static_assert(ex::is_nothrow_destructible_v<T> == std::is_destructible<T>::value, ""); - } - { - typedef void T; - static_assert(!ex::is_nothrow_destructible_v<T>, ""); - static_assert(ex::is_nothrow_destructible_v<T> == std::is_destructible<T>::value, ""); - } -} - -int main() -{ - type_properties_test(); - is_constructible_and_assignable_test(); - is_trivially_constructible_and_assignable_test(); - is_nothrow_constructible_and_assignable_test(); - { - typedef virtual_dtor_type T; - static_assert(ex::has_virtual_destructor_v<T>, ""); - static_assert(std::is_same<decltype(ex::has_virtual_destructor_v<T>), const bool>::value, ""); - static_assert(ex::has_virtual_destructor_v<T> == std::has_virtual_destructor<T>::value, ""); - } - { - typedef int T; - static_assert(!ex::has_virtual_destructor_v<T>, ""); - static_assert(ex::has_virtual_destructor_v<T> == std::has_virtual_destructor<T>::value, ""); - } -} - diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp deleted file mode 100644 index f91667da523c0..0000000000000 --- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.query.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 -// <experimental/type_traits> - -#include <experimental/type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef char T; - static_assert(ex::alignment_of_v<T> == 1, ""); - static_assert(std::is_same<decltype(ex::alignment_of_v<T>), const std::size_t>::value, ""); - static_assert(ex::alignment_of_v<T> == std::alignment_of<T>::value, ""); - } - { - typedef char(T)[1][1][1]; - static_assert(ex::rank_v<T> == 3, ""); - static_assert(std::is_same<decltype(ex::rank_v<T>), const std::size_t>::value, ""); - static_assert(ex::rank_v<T> == std::rank<T>::value, ""); - } - { - typedef void T; - static_assert(ex::rank_v<T> == 0, ""); - static_assert(ex::rank_v<T> == std::rank<T>::value, ""); - } - { - typedef char(T)[2][3][4]; - static_assert(ex::extent_v<T> == 2, ""); - static_assert(std::is_same<decltype(ex::extent_v<T>), const std::size_t>::value, ""); - static_assert(ex::extent_v<T> == std::extent<T>::value, ""); - } - { - typedef char(T)[2][3][4]; - static_assert(ex::extent_v<T, 0> == 2, ""); - static_assert(ex::extent_v<T, 0> == std::extent<T, 0>::value, ""); - } - { - typedef char(T)[2][3][4]; - static_assert(ex::extent_v<T, 1> == 3, ""); - static_assert(ex::extent_v<T, 1> == std::extent<T, 1>::value, ""); - } - { - typedef char(T)[2][3][4]; - static_assert(ex::extent_v<T, 5> == 0, ""); - static_assert(ex::extent_v<T, 5> == std::extent<T, 5>::value, ""); - } - { - typedef void T; - static_assert(ex::extent_v<T, 0> == 0, ""); - static_assert(ex::extent_v<T, 0> == std::extent<T, 0>::value, ""); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp deleted file mode 100644 index 485da33cdec76..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/includes.pass.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// Test that <ratio> is included. - -#include <experimental/ratio> - -int main() -{ - std::ratio<100> x; - ((void)x); -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp deleted file mode 100644 index 641e6ae22cc80..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_equal_v.pass.cpp +++ /dev/null @@ -1,47 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_equal_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_equal_v<R1, R2> == std::ratio_equal<R1, R2>::value, "" - ); - static_assert( - std::is_same<decltype(ex::ratio_equal_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, -1> R2; - static_assert( - !ex::ratio_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_equal_v<R1, R2> == std::ratio_equal<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp deleted file mode 100644 index 3896d0ac64dc2..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_equal_v.pass.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_greater_equal_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 2> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_greater_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_equal_v<R1, R2> - == std::ratio_greater_equal<R1, R2>::value, "" - ); - static_assert( - std::is_same< - decltype(ex::ratio_greater_equal_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_greater_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_equal_v<R1, R2> - == std::ratio_greater_equal<R1, R2>::value, "" - ); - } - { - typedef std::ratio<2, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_greater_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_equal_v<R1, R2> - == std::ratio_greater_equal<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp deleted file mode 100644 index bdc54515f629b..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_greater_v.pass.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_greater_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 2> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_greater_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, "" - ); - static_assert( - std::is_same<decltype(ex::ratio_greater_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_greater_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, "" - ); - } - { - typedef std::ratio<2, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_greater_v<R1, R2>, "" - ); - static_assert( - ex::ratio_greater_v<R1, R2> == std::ratio_greater<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp deleted file mode 100644 index 50f213b013396..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_equal_v.pass.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_less_equal_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 2> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_less_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, "" - ); - static_assert( - std::is_same<decltype(ex::ratio_less_equal_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_less_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, "" - ); - } - { - typedef std::ratio<2, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_less_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_equal_v<R1, R2> == std::ratio_less_equal<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp deleted file mode 100644 index 7a6d7738bd9d2..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_less_v.pass.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_less_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 2> R1; - typedef std::ratio<1, 1> R2; - static_assert( - ex::ratio_less_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, "" - ); - static_assert( - std::is_same<decltype(ex::ratio_less_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_less_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, "" - ); - } - { - typedef std::ratio<2, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_less_v<R1, R2>, "" - ); - static_assert( - ex::ratio_less_v<R1, R2> == std::ratio_less<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp b/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp deleted file mode 100644 index b5296ff24ef18..0000000000000 --- a/test/std/experimental/utilities/ratio/header.ratio.synop/ratio_not_equal_v.pass.cpp +++ /dev/null @@ -1,47 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/ratio> - -// template <class R1, class R2> constexpr bool ratio_not_equal_v; - -#include <experimental/ratio> -#include <type_traits> - -namespace ex = std::experimental; - -int main() -{ - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, -1> R2; - static_assert( - ex::ratio_not_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_not_equal_v<R1, R2> == std::ratio_not_equal<R1, R2>::value, "" - ); - static_assert( - std::is_same<decltype(ex::ratio_not_equal_v<R1, R2>), const bool>::value - , "" - ); - } - { - typedef std::ratio<1, 1> R1; - typedef std::ratio<1, 1> R2; - static_assert( - !ex::ratio_not_equal_v<R1, R2>, "" - ); - static_assert( - ex::ratio_not_equal_v<R1, R2> == std::ratio_not_equal<R1, R2>::value, "" - ); - } -} diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp deleted file mode 100644 index de813925f2188..0000000000000 --- a/test/std/experimental/utilities/syserror/header.system_error.synop/includes.pass.cpp +++ /dev/null @@ -1,21 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/system_error> - -#include <experimental/system_error> - -int main() -{ - // Check that <system_error> has been included - std::error_code ec; - ((void)ec); -} diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp deleted file mode 100644 index f944123ebc069..0000000000000 --- a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_code_enum_v.pass.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/system_error> - -// template <class T> constexpr bool is_error_code_enum_v; - -#include <experimental/system_error> -#include <ios> /* for std::io_errc */ - -namespace ex = std::experimental; - -int main() { - { - static_assert(ex::is_error_code_enum_v<std::io_errc>, ""); - - static_assert(ex::is_error_code_enum_v<std::io_errc> == - std::is_error_code_enum <std::io_errc>::value, ""); - - static_assert(std::is_same<decltype(ex::is_error_code_enum_v<std::io_errc>), - const bool>::value, ""); - } - { - static_assert(!ex::is_error_code_enum_v<int>, ""); - - static_assert(ex::is_error_code_enum_v<int> == - std::is_error_code_enum <int>::value, ""); - } -} diff --git a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp b/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp deleted file mode 100644 index ee8dc57aa9db9..0000000000000 --- a/test/std/experimental/utilities/syserror/header.system_error.synop/is_error_condition_enum.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/system_error> - -// template <class T> constexpr bool is_error_condition_enum_v; - -#include <experimental/system_error> -#include <type_traits> -namespace ex = std::experimental; - -int main() { - { - static_assert(ex::is_error_condition_enum_v<std::errc>, ""); - - static_assert(ex::is_error_condition_enum_v<std::errc> == - std::is_error_condition_enum <std::errc>::value, ""); - - static_assert( - std::is_same<decltype(ex::is_error_condition_enum_v<std::errc>), - const bool>::value, - ""); - } - { - static_assert(!ex::is_error_condition_enum_v<int>, ""); - - static_assert(ex::is_error_condition_enum_v<int> == - std::is_error_condition_enum <int>::value, ""); - } -} diff --git a/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp b/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp deleted file mode 100644 index f6ad37f9ee3e2..0000000000000 --- a/test/std/experimental/utilities/time/header.chrono.synop/includes.pass.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <experimental/chrono> - -#include <experimental/chrono> - -int main() -{ - // Check that <chrono> has been included. - std::chrono::seconds s; - ((void)s); -} diff --git a/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp b/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp deleted file mode 100644 index 9ac9a2ed1c83b..0000000000000 --- a/test/std/experimental/utilities/time/header.chrono.synop/treat_as_floating_point_v.pass.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/chrono> - -// template <class Rep> constexpr bool treat_as_floating_point_v; - -#include <experimental/chrono> -#include <type_traits> - -namespace ex = std::chrono::experimental; -namespace cr = std::chrono; - -template <class T, bool Expect> -void test() -{ - static_assert( - ex::treat_as_floating_point_v<T> == Expect, "" - ); - static_assert( - ex::treat_as_floating_point_v<T> == cr::treat_as_floating_point<T>::value, "" - ); -} - -int main() -{ - { - static_assert( - std::is_same< - decltype(ex::treat_as_floating_point_v<float>), const bool - >::value, "" - ); - } - test<int, false>(); - test<unsigned, false>(); - test<char, false>(); - test<bool, false>(); - test<float, true>(); - test<double, true>(); - test<long double, true>(); -} diff --git a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp b/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp deleted file mode 100644 index 5cfb15e3df298..0000000000000 --- a/test/std/experimental/utilities/tuple/header.tuple.synop/includes.pass.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -#include <experimental/tuple> - -int main() -{ - std::tuple<int> x(1); - (void)x; -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp deleted file mode 100644 index cb44707fa7e79..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/arg_type.pass.cpp +++ /dev/null @@ -1,187 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Test with different ref/ptr/cv qualified argument types. - -#include <experimental/tuple> -#include <array> -#include <utility> -#include <cassert> - -// std::array is explicitly allowed to be initialized with A a = { init-list };. -// Disable the missing braces warning for this reason. -#include "disable_missing_braces_warning.h" - - -namespace ex = std::experimental; - -int call_with_value(int x, int y) { return (x + y); } -int call_with_ref(int & x, int & y) { return (x + y); } -int call_with_const_ref(int const & x, int const & y) { return (x + y); } -int call_with_rvalue_ref(int && x, int && y) { return (x + y); } -int call_with_pointer(int * x, int * y) { return (*x + *y); } -int call_with_const_pointer(int const* x, int const * y) { return (*x + *y); } - - -template <class Tuple> -void test_values() -{ - { - Tuple t{1, 2}; - assert(3 == ex::apply(call_with_value, t)); - } - { - Tuple t{2, 2}; - assert(4 == ex::apply(call_with_ref, t)); - } - { - Tuple t{2, 3}; - assert(5 == ex::apply(call_with_const_ref, t)); - } - { - Tuple t{3, 3}; - assert(6 == ex::apply(call_with_rvalue_ref, static_cast<Tuple &&>(t))); - } - { - Tuple const t{4, 4}; - assert(8 == ex::apply(call_with_value, t)); - } - { - Tuple const t{4, 5}; - assert(9 == ex::apply(call_with_const_ref, t)); - } -} - -template <class Tuple> -void test_refs() -{ - int x = 0; - int y = 0; - { - x = 1; y = 2; - Tuple t{x, y}; - assert(3 == ex::apply(call_with_value, t)); - } - { - x = 2; y = 2; - Tuple t{x, y}; - assert(4 == ex::apply(call_with_ref, t)); - } - { - x = 2; y = 3; - Tuple t{x, y}; - assert(5 == ex::apply(call_with_const_ref, t)); - } - { - x = 3; y = 3; - Tuple const t{x, y}; - assert(6 == ex::apply(call_with_value, t)); - } - { - x = 3; y = 4; - Tuple const t{x, y}; - assert(7 == ex::apply(call_with_const_ref, t)); - } -} - -template <class Tuple> -void test_const_refs() -{ - int x = 0; - int y = 0; - { - x = 1; y = 2; - Tuple t{x, y}; - assert(3 == ex::apply(call_with_value, t)); - } - { - x = 2; y = 3; - Tuple t{x, y}; - assert(5 == ex::apply(call_with_const_ref, t)); - } - { - x = 3; y = 3; - Tuple const t{x, y}; - assert(6 == ex::apply(call_with_value, t)); - } - { - x = 3; y = 4; - Tuple const t{x, y}; - assert(7 == ex::apply(call_with_const_ref, t)); - } -} - - -template <class Tuple> -void test_pointer() -{ - int x = 0; - int y = 0; - { - x = 2; y = 2; - Tuple t{&x, &y}; - assert(4 == ex::apply(call_with_pointer, t)); - } - { - x = 2; y = 3; - Tuple t{&x, &y}; - assert(5 == ex::apply(call_with_const_pointer, t)); - } - { - x = 3; y = 4; - Tuple const t{&x, &y}; - assert(7 == ex::apply(call_with_const_pointer, t)); - } -} - - -template <class Tuple> -void test_const_pointer() -{ - int x = 0; - int y = 0; - { - x = 2; y = 3; - Tuple t{&x, &y}; - assert(5 == ex::apply(call_with_const_pointer, t)); - } - { - x = 3; y = 4; - Tuple const t{&x, &y}; - assert(7 == ex::apply(call_with_const_pointer, t)); - } -} - - -int main() -{ - test_values<std::tuple<int, int>>(); - test_values<std::pair<int, int>>(); - test_values<std::array<int, 2>>(); - - test_refs<std::tuple<int &, int &>>(); - test_refs<std::pair<int &, int &>>(); - - test_const_refs<std::tuple<int const &, int const &>>(); - test_const_refs<std::pair<int const &, int const &>>(); - - test_pointer<std::tuple<int *, int *>>(); - test_pointer<std::pair<int *, int *>>(); - test_pointer<std::array<int *, 2>>(); - - test_const_pointer<std::tuple<int const *, int const *>>(); - test_const_pointer<std::pair<int const *, int const *>>(); - test_const_pointer<std::array<int const *, 2>>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp deleted file mode 100644 index 5b8a8f09d1eee..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/constexpr_types.pass.cpp +++ /dev/null @@ -1,118 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Testing constexpr evaluation - -#include <experimental/tuple> -#include <utility> -#include <cassert> - -constexpr int f_int_0() { return 1; } -constexpr int f_int_1(int x) { return x; } -constexpr int f_int_2(int x, int y) { return (x + y); } - -struct A_int_0 -{ - constexpr A_int_0() {} - constexpr int operator()() const { return 1; } -}; - -struct A_int_1 -{ - constexpr A_int_1() {} - constexpr int operator()(int x) const { return x; } -}; - -struct A_int_2 -{ - constexpr A_int_2() {} - constexpr int operator()(int x, int y) const { return (x + y); } -}; - -namespace ex = std::experimental; - -template <class Tuple> -void test_0() -{ - // function - { - constexpr Tuple t{}; - static_assert(1 == ex::apply(f_int_0, t), ""); - } - // function pointer - { - constexpr Tuple t{}; - constexpr auto fp = &f_int_0; - static_assert(1 == ex::apply(fp, t), ""); - } - // functor - { - constexpr Tuple t{}; - constexpr A_int_0 a; - static_assert(1 == ex::apply(a, t), ""); - } -} - -template <class Tuple> -void test_1() -{ - // function - { - constexpr Tuple t{1}; - static_assert(1 == ex::apply(f_int_1, t), ""); - } - // function pointer - { - constexpr Tuple t{2}; - constexpr int (*fp)(int) = f_int_1; - static_assert(2 == ex::apply(fp, t), ""); - } - // functor - { - constexpr Tuple t{3}; - constexpr A_int_1 fn; - static_assert(3 == ex::apply(fn, t), ""); - } -} - -template <class Tuple> -void test_2() -{ - // function - { - constexpr Tuple t{1, 2}; - static_assert(3 == ex::apply(f_int_2, t), ""); - } - // function pointer - { - constexpr Tuple t{2, 3}; - constexpr auto fp = &f_int_2; - static_assert(5 == ex::apply(fp, t), ""); - } - // functor - { - constexpr Tuple t{3, 4}; - constexpr A_int_2 a; - static_assert(7 == ex::apply(a, t), ""); - } -} - -int main() -{ - test_0<std::tuple<>>(); - test_1<std::tuple<int>>(); - test_2<std::tuple<int, int>>(); - test_2<std::pair<int, int>>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp deleted file mode 100644 index 57dff44976bc8..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/extended_types.pass.cpp +++ /dev/null @@ -1,427 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Testing extended function types. The extended function types are those -// named by INVOKE but that are not actual callable objects. These include -// bullets 1-4 of invoke. - -#include <experimental/tuple> -#include <array> -#include <utility> -#include <cassert> - -// std::array is explicitly allowed to be initialized with A a = { init-list };. -// Disable the missing braces warning for this reason. -#include "disable_missing_braces_warning.h" - -int count = 0; - -struct A_int_0 -{ - A_int_0() : obj1(0){} - A_int_0(int x) : obj1(x) {} - int mem1() { return ++count; } - int mem2() const { return ++count; } - int const obj1; -}; - -struct A_int_1 -{ - A_int_1() {} - A_int_1(int) {} - int mem1(int x) { return count += x; } - int mem2(int x) const { return count += x; } -}; - -struct A_int_2 -{ - A_int_2() {} - A_int_2(int) {} - int mem1(int x, int y) { return count += (x + y); } - int mem2(int x, int y) const { return count += (x + y); } -}; - -template <class A> -struct A_wrap -{ - A_wrap() {} - A_wrap(int x) : m_a(x) {} - A & operator*() { return m_a; } - A const & operator*() const { return m_a; } - A m_a; -}; - -typedef A_wrap<A_int_0> A_wrap_0; -typedef A_wrap<A_int_1> A_wrap_1; -typedef A_wrap<A_int_2> A_wrap_2; - - -template <class A> -struct A_base : public A -{ - A_base() : A() {} - A_base(int x) : A(x) {} -}; - -typedef A_base<A_int_0> A_base_0; -typedef A_base<A_int_1> A_base_1; -typedef A_base<A_int_2> A_base_2; - -namespace ex = std::experimental; - -template < - class Tuple, class ConstTuple - , class TuplePtr, class ConstTuplePtr - , class TupleWrap, class ConstTupleWrap - , class TupleBase, class ConstTupleBase - > -void test_ext_int_0() -{ - count = 0; - typedef A_int_0 T; - typedef A_wrap_0 Wrap; - typedef A_base_0 Base; - - typedef int(T::*mem1_t)(); - mem1_t mem1 = &T::mem1; - - typedef int(T::*mem2_t)() const; - mem2_t mem2 = &T::mem2; - - typedef int const T::*obj1_t; - obj1_t obj1 = &T::obj1; - - // member function w/ref - { - T a; - Tuple t{a}; - assert(1 == ex::apply(mem1, t)); - assert(count == 1); - } - count = 0; - // member function w/pointer - { - T a; - TuplePtr t{&a}; - assert(1 == ex::apply(mem1, t)); - assert(count == 1); - } - count = 0; - // member function w/base - { - Base a; - TupleBase t{a}; - assert(1 == ex::apply(mem1, t)); - assert(count == 1); - } - count = 0; - // member function w/wrap - { - Wrap a; - TupleWrap t{a}; - assert(1 == ex::apply(mem1, t)); - assert(count == 1); - } - count = 0; - // const member function w/ref - { - T const a; - ConstTuple t{a}; - assert(1 == ex::apply(mem2, t)); - assert(count == 1); - } - count = 0; - // const member function w/pointer - { - T const a; - ConstTuplePtr t{&a}; - assert(1 == ex::apply(mem2, t)); - assert(count == 1); - } - count = 0; - // const member function w/base - { - Base const a; - ConstTupleBase t{a}; - assert(1 == ex::apply(mem2, t)); - assert(count == 1); - } - count = 0; - // const member function w/wrapper - { - Wrap const a; - ConstTupleWrap t{a}; - assert(1 == ex::apply(mem2, t)); - assert(1 == count); - } - // member object w/ref - { - T a{42}; - Tuple t{a}; - assert(42 == ex::apply(obj1, t)); - } - // member object w/pointer - { - T a{42}; - TuplePtr t{&a}; - assert(42 == ex::apply(obj1, t)); - } - // member object w/base - { - Base a{42}; - TupleBase t{a}; - assert(42 == ex::apply(obj1, t)); - } - // member object w/wrapper - { - Wrap a{42}; - TupleWrap t{a}; - assert(42 == ex::apply(obj1, t)); - } -} - - -template < - class Tuple, class ConstTuple - , class TuplePtr, class ConstTuplePtr - , class TupleWrap, class ConstTupleWrap - , class TupleBase, class ConstTupleBase - > -void test_ext_int_1() -{ - count = 0; - typedef A_int_1 T; - typedef A_wrap_1 Wrap; - typedef A_base_1 Base; - - typedef int(T::*mem1_t)(int); - mem1_t mem1 = &T::mem1; - - typedef int(T::*mem2_t)(int) const; - mem2_t mem2 = &T::mem2; - - // member function w/ref - { - T a; - Tuple t{a, 2}; - assert(2 == ex::apply(mem1, t)); - assert(count == 2); - } - count = 0; - // member function w/pointer - { - T a; - TuplePtr t{&a, 3}; - assert(3 == ex::apply(mem1, t)); - assert(count == 3); - } - count = 0; - // member function w/base - { - Base a; - TupleBase t{a, 4}; - assert(4 == ex::apply(mem1, t)); - assert(count == 4); - } - count = 0; - // member function w/wrap - { - Wrap a; - TupleWrap t{a, 5}; - assert(5 == ex::apply(mem1, t)); - assert(count == 5); - } - count = 0; - // const member function w/ref - { - T const a; - ConstTuple t{a, 6}; - assert(6 == ex::apply(mem2, t)); - assert(count == 6); - } - count = 0; - // const member function w/pointer - { - T const a; - ConstTuplePtr t{&a, 7}; - assert(7 == ex::apply(mem2, t)); - assert(count == 7); - } - count = 0; - // const member function w/base - { - Base const a; - ConstTupleBase t{a, 8}; - assert(8 == ex::apply(mem2, t)); - assert(count == 8); - } - count = 0; - // const member function w/wrapper - { - Wrap const a; - ConstTupleWrap t{a, 9}; - assert(9 == ex::apply(mem2, t)); - assert(9 == count); - } -} - - -template < - class Tuple, class ConstTuple - , class TuplePtr, class ConstTuplePtr - , class TupleWrap, class ConstTupleWrap - , class TupleBase, class ConstTupleBase - > -void test_ext_int_2() -{ - count = 0; - typedef A_int_2 T; - typedef A_wrap_2 Wrap; - typedef A_base_2 Base; - - typedef int(T::*mem1_t)(int, int); - mem1_t mem1 = &T::mem1; - - typedef int(T::*mem2_t)(int, int) const; - mem2_t mem2 = &T::mem2; - - // member function w/ref - { - T a; - Tuple t{a, 1, 1}; - assert(2 == ex::apply(mem1, t)); - assert(count == 2); - } - count = 0; - // member function w/pointer - { - T a; - TuplePtr t{&a, 1, 2}; - assert(3 == ex::apply(mem1, t)); - assert(count == 3); - } - count = 0; - // member function w/base - { - Base a; - TupleBase t{a, 2, 2}; - assert(4 == ex::apply(mem1, t)); - assert(count == 4); - } - count = 0; - // member function w/wrap - { - Wrap a; - TupleWrap t{a, 2, 3}; - assert(5 == ex::apply(mem1, t)); - assert(count == 5); - } - count = 0; - // const member function w/ref - { - T const a; - ConstTuple t{a, 3, 3}; - assert(6 == ex::apply(mem2, t)); - assert(count == 6); - } - count = 0; - // const member function w/pointer - { - T const a; - ConstTuplePtr t{&a, 3, 4}; - assert(7 == ex::apply(mem2, t)); - assert(count == 7); - } - count = 0; - // const member function w/base - { - Base const a; - ConstTupleBase t{a, 4, 4}; - assert(8 == ex::apply(mem2, t)); - assert(count == 8); - } - count = 0; - // const member function w/wrapper - { - Wrap const a; - ConstTupleWrap t{a, 4, 5}; - assert(9 == ex::apply(mem2, t)); - assert(9 == count); - } -} - -int main() -{ - { - test_ext_int_0< - std::tuple<A_int_0 &>, std::tuple<A_int_0 const &> - , std::tuple<A_int_0 *>, std::tuple<A_int_0 const *> - , std::tuple<A_wrap_0 &>, std::tuple<A_wrap_0 const &> - , std::tuple<A_base_0 &>, std::tuple<A_base_0 const &> - >(); - test_ext_int_0< - std::tuple<A_int_0>, std::tuple<A_int_0 const> - , std::tuple<A_int_0 *>, std::tuple<A_int_0 const *> - , std::tuple<A_wrap_0>, std::tuple<A_wrap_0 const> - , std::tuple<A_base_0>, std::tuple<A_base_0 const> - >(); - test_ext_int_0< - std::array<A_int_0, 1>, std::array<A_int_0 const, 1> - , std::array<A_int_0*, 1>, std::array<A_int_0 const*, 1> - , std::array<A_wrap_0, 1>, std::array<A_wrap_0 const, 1> - , std::array<A_base_0, 1>, std::array<A_base_0 const, 1> - >(); - } - { - test_ext_int_1< - std::tuple<A_int_1 &, int>, std::tuple<A_int_1 const &, int> - , std::tuple<A_int_1 *, int>, std::tuple<A_int_1 const *, int> - , std::tuple<A_wrap_1 &, int>, std::tuple<A_wrap_1 const &, int> - , std::tuple<A_base_1 &, int>, std::tuple<A_base_1 const &, int> - >(); - test_ext_int_1< - std::tuple<A_int_1, int>, std::tuple<A_int_1 const, int> - , std::tuple<A_int_1 *, int>, std::tuple<A_int_1 const *, int> - , std::tuple<A_wrap_1, int>, std::tuple<A_wrap_1 const, int> - , std::tuple<A_base_1, int>, std::tuple<A_base_1 const, int> - >(); - test_ext_int_1< - std::pair<A_int_1 &, int>, std::pair<A_int_1 const &, int> - , std::pair<A_int_1 *, int>, std::pair<A_int_1 const *, int> - , std::pair<A_wrap_1 &, int>, std::pair<A_wrap_1 const &, int> - , std::pair<A_base_1 &, int>, std::pair<A_base_1 const &, int> - >(); - test_ext_int_1< - std::pair<A_int_1, int>, std::pair<A_int_1 const, int> - , std::pair<A_int_1 *, int>, std::pair<A_int_1 const *, int> - , std::pair<A_wrap_1, int>, std::pair<A_wrap_1 const, int> - , std::pair<A_base_1, int>, std::pair<A_base_1 const, int> - >(); - } - { - test_ext_int_2< - std::tuple<A_int_2 &, int, int>, std::tuple<A_int_2 const &, int, int> - , std::tuple<A_int_2 *, int, int>, std::tuple<A_int_2 const *, int, int> - , std::tuple<A_wrap_2 &, int, int>, std::tuple<A_wrap_2 const &, int, int> - , std::tuple<A_base_2 &, int, int>, std::tuple<A_base_2 const &, int, int> - >(); - test_ext_int_2< - std::tuple<A_int_2, int, int>, std::tuple<A_int_2 const, int, int> - , std::tuple<A_int_2 *, int, int>, std::tuple<A_int_2 const *, int, int> - , std::tuple<A_wrap_2, int, int>, std::tuple<A_wrap_2 const, int, int> - , std::tuple<A_base_2, int, int>, std::tuple<A_base_2 const, int, int> - >(); - } -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp deleted file mode 100644 index 027258ad8d1d9..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/large_arity.pass.cpp +++ /dev/null @@ -1,146 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Stress testing large arities with tuple and array. - -#include <experimental/tuple> -#include <array> -#include <utility> -#include <cassert> - -//////////////////////////////////////////////////////////////////////////////// -template <class T, std::size_t Dummy = 0> -struct always_imp -{ - typedef T type; -}; - -template <class T, std::size_t Dummy = 0> -using always_t = typename always_imp<T, Dummy>::type; - -//////////////////////////////////////////////////////////////////////////////// -template <class Tuple, class Idx> -struct make_function; - -template <class Tp, std::size_t ...Idx> -struct make_function<Tp, std::integer_sequence<std::size_t, Idx...>> -{ - using type = bool (*)(always_t<Tp, Idx>...); -}; - -template <class Tp, std::size_t Size> -using make_function_t = typename make_function<Tp, std::make_index_sequence<Size>>::type; - -//////////////////////////////////////////////////////////////////////////////// -template <class Tp, class Idx> -struct make_tuple_imp; - -//////////////////////////////////////////////////////////////////////////////// -template <class Tp, std::size_t ...Idx> -struct make_tuple_imp<Tp, std::integer_sequence<std::size_t, Idx...>> -{ - using type = std::tuple<always_t<Tp, Idx>...>; -}; - -template <class Tp, std::size_t Size> -using make_tuple_t = typename make_tuple_imp<Tp, std::make_index_sequence<Size>>::type; - -template <class ...Types> -bool test_apply_fn(Types...) { return true; } - -namespace ex = std::experimental; - -template <std::size_t Size> -void test_all() -{ - - using A = std::array<int, Size>; - using ConstA = std::array<int const, Size>; - - using Tuple = make_tuple_t<int, Size>; - using CTuple = make_tuple_t<const int, Size>; - - using ValFn = make_function_t<int, Size>; - ValFn val_fn = &test_apply_fn; - - using RefFn = make_function_t<int &, Size>; - RefFn ref_fn = &test_apply_fn; - - using CRefFn = make_function_t<int const &, Size>; - CRefFn cref_fn = &test_apply_fn; - - using RRefFn = make_function_t<int &&, Size>; - RRefFn rref_fn = &test_apply_fn; - - { - A a{}; - assert(ex::apply(val_fn, a)); - assert(ex::apply(ref_fn, a)); - assert(ex::apply(cref_fn, a)); - assert(ex::apply(rref_fn, std::move(a))); - } - { - ConstA a{}; - assert(ex::apply(val_fn, a)); - assert(ex::apply(cref_fn, a)); - } - { - Tuple a{}; - assert(ex::apply(val_fn, a)); - assert(ex::apply(ref_fn, a)); - assert(ex::apply(cref_fn, a)); - assert(ex::apply(rref_fn, std::move(a))); - } - { - CTuple a{}; - assert(ex::apply(val_fn, a)); - assert(ex::apply(cref_fn, a)); - } - -} - - -template <std::size_t Size> -void test_one() -{ - using A = std::array<int, Size>; - using Tuple = make_tuple_t<int, Size>; - - using ValFn = make_function_t<int, Size>; - ValFn val_fn = &test_apply_fn; - - { - A a{}; - assert(ex::apply(val_fn, a)); - } - { - Tuple a{}; - assert(ex::apply(val_fn, a)); - } -} - -int main() -{ - // Instantiate with 1-5 arguments. - test_all<1>(); - test_all<2>(); - test_all<3>(); - test_all<4>(); - test_all<5>(); - - // Stress test with 128. - test_one<128>(); - //test_one<256>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp deleted file mode 100644 index 3cf259f531c9c..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/ref_qualifiers.pass.cpp +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Testing ref qualified functions - -#include <experimental/tuple> -#include <cassert> - -struct func_obj -{ - constexpr func_obj() {} - - constexpr int operator()() const & { return 1; } - constexpr int operator()() const && { return 2; } - constexpr int operator()() & { return 3; } - constexpr int operator()() && { return 4; } -}; - -namespace ex = std::experimental; - -int main() -{ -// TODO(ericwf): Re-enable constexpr support -/* - { - constexpr func_obj f; - constexpr std::tuple<> tp; - - static_assert(1 == ex::apply(static_cast<func_obj const &>(f), tp), ""); - static_assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp), ""); - } -*/ - { - func_obj f; - std::tuple<> tp; - assert(1 == ex::apply(static_cast<func_obj const &>(f), tp)); - assert(2 == ex::apply(static_cast<func_obj const &&>(f), tp)); - assert(3 == ex::apply(static_cast<func_obj &>(f), tp)); - assert(4 == ex::apply(static_cast<func_obj &&>(f), tp)); - } -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp deleted file mode 100644 index 01d36637e1c3e..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/return_type.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Test the return type deduction. - -#include <experimental/tuple> -#include <cassert> - -static int my_int = 42; - -template <int N> struct index_t {}; - -void f(index_t<0>) {} - -int f(index_t<1>) { return 0; } - -int & f(index_t<2>) { return static_cast<int &>(my_int); } -int const & f(index_t<3>) { return static_cast<int const &>(my_int); } -int volatile & f(index_t<4>) { return static_cast<int volatile &>(my_int); } -int const volatile & f(index_t<5>) { return static_cast<int const volatile &>(my_int); } - -int && f(index_t<6>) { return static_cast<int &&>(my_int); } -int const && f(index_t<7>) { return static_cast<int const &&>(my_int); } -int volatile && f(index_t<8>) { return static_cast<int volatile &&>(my_int); } -int const volatile && f(index_t<9>) { return static_cast<int const volatile &&>(my_int); } - -int * f(index_t<10>) { return static_cast<int *>(&my_int); } -int const * f(index_t<11>) { return static_cast<int const *>(&my_int); } -int volatile * f(index_t<12>) { return static_cast<int volatile *>(&my_int); } -int const volatile * f(index_t<13>) { return static_cast<int const volatile *>(&my_int); } - - -template <int Func, class Expect> -void test() -{ - using F = decltype(f(index_t<Func>{})); - static_assert(std::is_same<F, Expect>::value, ""); -} - -namespace ex = std::experimental; - -int main() -{ - test<0, void>(); - test<1, int>(); - test<2, int &>(); - test<3, int const &>(); - test<4, int volatile &>(); - test<5, int const volatile &>(); - test<6, int &&>(); - test<7, int const &&>(); - test<8, int volatile &&>(); - test<9, int const volatile &&>(); - test<10, int *>(); - test<11, int const *>(); - test<12, int volatile *>(); - test<13, int const volatile *>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp b/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp deleted file mode 100644 index 52eec276394ac..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple.apply/types.pass.cpp +++ /dev/null @@ -1,431 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class F, class T> constexpr decltype(auto) apply(F &&, T &&) - -// Test function types. - -#include <experimental/tuple> -#include <array> -#include <utility> -#include <cassert> - -// std::array is explicitly allowed to be initialized with A a = { init-list };. -// Disable the missing braces warning for this reason. -#include "disable_missing_braces_warning.h" - -namespace ex = std::experimental; - -int count = 0; - -void f_void_0() { ++count; } -void f_void_1(int i) { count += i; } -void f_void_2(int x, int y) { count += (x + y); } -void f_void_3(int x, int y, int z) { count += (x + y + z); } - -int f_int_0() { return ++count; } -int f_int_1(int x) { return count += x; } -int f_int_2(int x, int y) { return count += (x + y); } -int f_int_3(int x, int y, int z) { return count += (x + y + z); } - -struct A_void_0 -{ - A_void_0() {} - void operator()() { ++count; } - void operator()() const { ++count; ++count; } -}; - -struct A_void_1 -{ - A_void_1() {} - void operator()(int x) { count += x; } - void operator()(int x) const { count += x + 1; } -}; - -struct A_void_2 -{ - A_void_2() {} - void operator()(int x, int y) { count += (x + y); } - void operator()(int x, int y) const { count += (x + y) + 1; } -}; - -struct A_void_3 -{ - A_void_3() {} - void operator()(int x, int y, int z) { count += (x + y + z); } - void operator()(int x, int y, int z) const { count += (x + y + z) + 1; } -}; - - -struct A_int_0 -{ - A_int_0() {} - int operator()() { return ++count; } - int operator()() const { ++count; return ++count; } -}; - -struct A_int_1 -{ - A_int_1() {} - int operator()(int x) { return count += x; } - int operator()(int x) const { return count += (x + 1); } - -}; - -struct A_int_2 -{ - A_int_2() {} - int operator()(int x, int y) { return count += (x + y); } - int operator()(int x, int y) const { return count += (x + y + 1); } -}; - -struct A_int_3 -{ - A_int_3() {} - int operator()(int x, int y, int z) { return count += (x + y + z); } - int operator()(int x, int y, int z) const { return count += (x + y + z + 1); } -}; - - -template <class Tuple> -void test_void_0() -{ - count = 0; - // function - { - Tuple t{}; - ex::apply(f_void_0, t); - assert(count == 1); - } - count = 0; - // function pointer - { - Tuple t{}; - auto fp = &f_void_0; - ex::apply(fp, t); - assert(count == 1); - } - count = 0; - // functor - { - Tuple t{}; - A_void_0 a; - ex::apply(a, t); - assert(count == 1); - } - count = 0; - // const functor - { - Tuple t{}; - A_void_0 const a; - ex::apply(a, t); - assert(count == 2); - } -} - -template <class Tuple> -void test_void_1() -{ - count = 0; - // function - { - Tuple t{1}; - ex::apply(f_void_1, t); - assert(count == 1); - } - count = 0; - // function pointer - { - Tuple t{2}; - void (*fp)(int) = f_void_1; - ex::apply(fp, t); - assert(count == 2); - } - count = 0; - // functor - { - Tuple t{3}; - A_void_1 fn; - ex::apply(fn, t); - assert(count == 3); - } - count = 0; - // const functor - { - Tuple t{4}; - A_void_1 const a; - ex::apply(a, t); - assert(count == 5); - } -} - -template <class Tuple> -void test_void_2() -{ - count = 0; - // function - { - Tuple t{1, 2}; - ex::apply(f_void_2, t); - assert(count == 3); - } - count = 0; - // function pointer - { - Tuple t{2, 3}; - auto fp = &f_void_2; - ex::apply(fp, t); - assert(count == 5); - } - count = 0; - // functor - { - Tuple t{3, 4}; - A_void_2 a; - ex::apply(a, t); - assert(count == 7); - } - count = 0; - // const functor - { - Tuple t{4, 5}; - A_void_2 const a; - ex::apply(a, t); - assert(count == 10); - } -} - -template <class Tuple> -void test_void_3() -{ - count = 0; - // function - { - Tuple t{1, 2, 3}; - ex::apply(f_void_3, t); - assert(count == 6); - } - count = 0; - // function pointer - { - Tuple t{2, 3, 4}; - auto fp = &f_void_3; - ex::apply(fp, t); - assert(count == 9); - } - count = 0; - // functor - { - Tuple t{3, 4, 5}; - A_void_3 a; - ex::apply(a, t); - assert(count == 12); - } - count = 0; - // const functor - { - Tuple t{4, 5, 6}; - A_void_3 const a; - ex::apply(a, t); - assert(count == 16); - } -} - - - -template <class Tuple> -void test_int_0() -{ - count = 0; - // function - { - Tuple t{}; - assert(1 == ex::apply(f_int_0, t)); - assert(count == 1); - } - count = 0; - // function pointer - { - Tuple t{}; - auto fp = &f_int_0; - assert(1 == ex::apply(fp, t)); - assert(count == 1); - } - count = 0; - // functor - { - Tuple t{}; - A_int_0 a; - assert(1 == ex::apply(a, t)); - assert(count == 1); - } - count = 0; - // const functor - { - Tuple t{}; - A_int_0 const a; - assert(2 == ex::apply(a, t)); - assert(count == 2); - } -} - -template <class Tuple> -void test_int_1() -{ - count = 0; - // function - { - Tuple t{1}; - assert(1 == ex::apply(f_int_1, t)); - assert(count == 1); - } - count = 0; - // function pointer - { - Tuple t{2}; - int (*fp)(int) = f_int_1; - assert(2 == ex::apply(fp, t)); - assert(count == 2); - } - count = 0; - // functor - { - Tuple t{3}; - A_int_1 fn; - assert(3 == ex::apply(fn, t)); - assert(count == 3); - } - count = 0; - // const functor - { - Tuple t{4}; - A_int_1 const a; - assert(5 == ex::apply(a, t)); - assert(count == 5); - } -} - -template <class Tuple> -void test_int_2() -{ - count = 0; - // function - { - Tuple t{1, 2}; - assert(3 == ex::apply(f_int_2, t)); - assert(count == 3); - } - count = 0; - // function pointer - { - Tuple t{2, 3}; - auto fp = &f_int_2; - assert(5 == ex::apply(fp, t)); - assert(count == 5); - } - count = 0; - // functor - { - Tuple t{3, 4}; - A_int_2 a; - assert(7 == ex::apply(a, t)); - assert(count == 7); - } - count = 0; - // const functor - { - Tuple t{4, 5}; - A_int_2 const a; - assert(10 == ex::apply(a, t)); - assert(count == 10); - } -} - -template <class Tuple> -void test_int_3() -{ - count = 0; - // function - { - Tuple t{1, 2, 3}; - assert(6 == ex::apply(f_int_3, t)); - assert(count == 6); - } - count = 0; - // function pointer - { - Tuple t{2, 3, 4}; - auto fp = &f_int_3; - assert(9 == ex::apply(fp, t)); - assert(count == 9); - } - count = 0; - // functor - { - Tuple t{3, 4, 5}; - A_int_3 a; - assert(12 == ex::apply(a, t)); - assert(count == 12); - } - count = 0; - // const functor - { - Tuple t{4, 5, 6}; - A_int_3 const a; - assert(16 == ex::apply(a, t)); - assert(count == 16); - } -} - -template <class Tuple> -void test_0() -{ - test_void_0<Tuple>(); - test_int_0<Tuple>(); -} - -template <class Tuple> -void test_1() -{ - test_void_1<Tuple>(); - test_int_1<Tuple>(); -} - -template <class Tuple> -void test_2() -{ - test_void_2<Tuple>(); - test_int_2<Tuple>(); -} - -template <class Tuple> -void test_3() -{ - test_void_3<Tuple>(); - test_int_3<Tuple>(); -} - -int main() -{ - test_0<std::tuple<>>(); - - test_1<std::tuple<int>>(); - test_1<std::array<int, 1>>(); - - test_2<std::tuple<int, int>>(); - test_2<std::pair<int, int>>(); - test_2<std::array<int, 2>>(); - - test_3<std::tuple<int, int, int>>(); - test_3<std::array<int, 3>>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp b/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp deleted file mode 100644 index a25b18cf5386f..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple_size_v.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value; - -// Test with reference - -#include <experimental/tuple> - -namespace ex = std::experimental; - -int main() -{ - auto x = ex::tuple_size_v<std::tuple<> &>; -} diff --git a/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp b/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp deleted file mode 100644 index d7a5aa679fcdb..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple_size_v.pass.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value; - -#include <experimental/tuple> -#include <utility> -#include <array> - -namespace ex = std::experimental; - -template <class Tuple, int Expect> -void test() -{ - static_assert(ex::tuple_size_v<Tuple> == Expect, ""); - static_assert(ex::tuple_size_v<Tuple> == std::tuple_size<Tuple>::value, ""); - static_assert(ex::tuple_size_v<Tuple const> == std::tuple_size<Tuple>::value, ""); - static_assert(ex::tuple_size_v<Tuple volatile> == std::tuple_size<Tuple>::value, ""); - static_assert(ex::tuple_size_v<Tuple const volatile> == std::tuple_size<Tuple>::value, ""); -} - -int main() -{ - test<std::tuple<>, 0>(); - - test<std::tuple<int>, 1>(); - test<std::array<int, 1>, 1>(); - - test<std::tuple<int, int>, 2>(); - test<std::pair<int, int>, 2>(); - test<std::array<int, 2>, 2>(); - - test<std::tuple<int, int, int>, 3>(); - test<std::array<int, 3>, 3>(); -} diff --git a/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp b/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp deleted file mode 100644 index 7c2f0cc236f6d..0000000000000 --- a/test/std/experimental/utilities/tuple/tuple_size_v_3.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11 - -// <experimental/tuple> - -// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value; - -// Test with pointer - -#include <experimental/tuple> - -namespace ex = std::experimental; - -int main() -{ - auto x = ex::tuple_size_v<std::tuple<>*>; -} diff --git a/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp new file mode 100644 index 0000000000000..02e2b607e6d0a --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// basic_filebuf<charT,traits>* open(const filesystem::path& p, ios_base::openmode mode); + +#include <fstream> +#include <filesystem> +#include <cassert> +#include "platform_support.h" + +namespace fs = std::filesystem; + +int main() { + + fs::path p = get_temp_file_name(); + { + std::filebuf f; + assert(f.open(p, std::ios_base::out) != 0); + assert(f.is_open()); + assert(f.sputn("123", 3) == 3); + } + { + std::filebuf f; + assert(f.open(p, std::ios_base::in) != 0); + assert(f.is_open()); + assert(f.sbumpc() == '1'); + assert(f.sbumpc() == '2'); + assert(f.sbumpc() == '3'); + } + std::remove(p.c_str()); + { + std::wfilebuf f; + assert(f.open(p, std::ios_base::out) != 0); + assert(f.is_open()); + assert(f.sputn(L"123", 3) == 3); + } + { + std::wfilebuf f; + assert(f.open(p, std::ios_base::in) != 0); + assert(f.is_open()); + assert(f.sbumpc() == L'1'); + assert(f.sbumpc() == L'2'); + assert(f.sbumpc() == L'3'); + } + remove(p.c_str()); +} diff --git a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp index 4419cb51a6dc2..3ac505e52dbcd 100644 --- a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp @@ -11,11 +11,11 @@ // int_type pbackfail(int_type c = traits::eof()); -// This test is not entirely portable - #include <fstream> #include <cassert> +#include "test_macros.h" + template <class CharT> struct test_buf : public std::basic_filebuf<CharT> @@ -41,7 +41,12 @@ int main() assert(f.is_open()); assert(f.sbumpc() == '1'); assert(f.sgetc() == '2'); - assert(f.pbackfail('a') == -1); + typename test_buf<char>::int_type pbackResult = f.pbackfail('a'); + LIBCPP_ASSERT(pbackResult == -1); + if (pbackResult != -1) { + assert(f.sbumpc() == 'a'); + assert(f.sgetc() == '2'); + } } { test_buf<char> f; @@ -49,8 +54,11 @@ int main() assert(f.is_open()); assert(f.sbumpc() == '1'); assert(f.sgetc() == '2'); - assert(f.pbackfail('a') == 'a'); - assert(f.sbumpc() == 'a'); - assert(f.sgetc() == '2'); + typename test_buf<char>::int_type pbackResult = f.pbackfail('a'); + LIBCPP_ASSERT(pbackResult == 'a'); + if (pbackResult != -1) { + assert(f.sbumpc() == 'a'); + assert(f.sgetc() == '2'); + } } } diff --git a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp index eb15facad5baf..d2780c62762da 100644 --- a/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp @@ -14,11 +14,11 @@ // pos_type seekpos(pos_type sp, // ios_base::openmode which = ios_base::in | ios_base::out); -// This test is not entirely portable - #include <fstream> #include <cassert> +#include "test_macros.h" + int main() { { @@ -30,7 +30,7 @@ int main() | std::ios_base::trunc) != 0); assert(f.is_open()); f.sputn("abcdefghijklmnopqrstuvwxyz", 26); - assert(buf[0] == 'v'); + LIBCPP_ASSERT(buf[0] == 'v'); pos_type p = f.pubseekoff(-15, std::ios_base::cur); assert(p == 11); assert(f.sgetc() == 'l'); @@ -51,7 +51,7 @@ int main() | std::ios_base::trunc) != 0); assert(f.is_open()); f.sputn(L"abcdefghijklmnopqrstuvwxyz", 26); - assert(buf[0] == L'v'); + LIBCPP_ASSERT(buf[0] == L'v'); pos_type p = f.pubseekoff(-15, std::ios_base::cur); assert(p == 11); assert(f.sgetc() == L'l'); diff --git a/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp new file mode 100644 index 0000000000000..d9b4a8ccb55a7 --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp @@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// plate <class charT, class traits = char_traits<charT> > +// class basic_fstream + +// explicit basic_fstream(const filesystem::path& s, +// ios_base::openmode mode = ios_base::in|ios_base::out); + +#include <fstream> +#include <filesystem> +#include <cassert> +#include "platform_support.h" + +namespace fs = std::filesystem; + +int main() { + fs::path p = get_temp_file_name(); + { + std::fstream fs(p, std::ios_base::in | std::ios_base::out | + std::ios_base::trunc); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); + { + std::wfstream fs(p, std::ios_base::in | std::ios_base::out | + std::ios_base::trunc); + double x = 0; + fs << 3.25; + fs.seekg(0); + fs >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); +} diff --git a/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp new file mode 100644 index 0000000000000..69cbf3f5c977a --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp @@ -0,0 +1,52 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// plate <class charT, class traits = char_traits<charT> > +// class basic_fstream + +// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in|ios_base::out); + +#include <fstream> +#include <filesystem> +#include <cassert> +#include "platform_support.h" + +int main() { + std::filesystem::path p = get_temp_file_name(); + { + std::fstream stream; + assert(!stream.is_open()); + stream.open(p, + std::ios_base::in | std::ios_base::out | std::ios_base::trunc); + assert(stream.is_open()); + double x = 0; + stream << 3.25; + stream.seekg(0); + stream >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); + { + std::wfstream stream; + assert(!stream.is_open()); + stream.open(p, + std::ios_base::in | std::ios_base::out | std::ios_base::trunc); + assert(stream.is_open()); + double x = 0; + stream << 3.25; + stream.seekg(0); + stream >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); +} diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp new file mode 100644 index 0000000000000..99eae3a28a72e --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ifstream + +// explicit basic_ifstream(const filesystem::path& s, +// ios_base::openmode mode = ios_base::in); + +#include <fstream> +#include <filesystem> +#include <cassert> + +namespace fs = std::filesystem; + +int main() { + { + fs::path p; + static_assert(!std::is_convertible<fs::path, std::ifstream>::value, + "ctor should be explicit"); + static_assert(std::is_constructible<std::ifstream, fs::path const&, + std::ios_base::openmode>::value, + ""); + } + { + std::ifstream fs(fs::path("test.dat")); + double x = 0; + fs >> x; + assert(x == 3.25); + } + // std::ifstream(const fs::path&, std::ios_base::openmode) is tested in + // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp + // which creates writable files. + { + std::wifstream fs(fs::path("test.dat")); + double x = 0; + fs >> x; + assert(x == 3.25); + } + // std::wifstream(const fs::path&, std::ios_base::openmode) is tested in + // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp + // which creates writable files. +} diff --git a/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp new file mode 100644 index 0000000000000..82f7c64eba901 --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// template <class charT, class traits = char_traits<charT> > +// class basic_ifstream + +// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in); + +#include <fstream> +#include <filesystem> +#include <cassert> + +int main() { + { + std::ifstream fs; + assert(!fs.is_open()); + char c = 'a'; + fs >> c; + assert(fs.fail()); + assert(c == 'a'); + fs.open(std::filesystem::path("test.dat")); + assert(fs.is_open()); + fs >> c; + assert(c == 'r'); + } + { + std::wifstream fs; + assert(!fs.is_open()); + wchar_t c = L'a'; + fs >> c; + assert(fs.fail()); + assert(c == L'a'); + fs.open(std::filesystem::path("test.dat")); + assert(fs.is_open()); + fs >> c; + assert(c == L'r'); + } +} diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp new file mode 100644 index 0000000000000..9a23384b0b150 --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// plate <class charT, class traits = char_traits<charT> > +// class basic_ofstream + +// explicit basic_ofstream(const filesystem::path& s, ios_base::openmode mode = ios_base::out); + +#include <fstream> +#include <filesystem> +#include <cassert> +#include "platform_support.h" + +namespace fs = std::filesystem; + +int main() { + fs::path p = get_temp_file_name(); + { + static_assert(!std::is_convertible<fs::path, std::ofstream>::value, + "ctor should be explicit"); + static_assert(std::is_constructible<std::ofstream, fs::path const&, + std::ios_base::openmode>::value, + ""); + } + { + std::ofstream stream(p); + stream << 3.25; + } + { + std::ifstream stream(p); + double x = 0; + stream >> x; + assert(x == 3.25); + } + { + std::ifstream stream(p, std::ios_base::out); + double x = 0; + stream >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); + { + std::wofstream stream(p); + stream << 3.25; + } + { + std::wifstream stream(p); + double x = 0; + stream >> x; + assert(x == 3.25); + } + { + std::wifstream stream(p, std::ios_base::out); + double x = 0; + stream >> x; + assert(x == 3.25); + } + std::remove(p.c_str()); +} diff --git a/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp new file mode 100644 index 0000000000000..867998bb7af70 --- /dev/null +++ b/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp @@ -0,0 +1,62 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <fstream> + +// plate <class charT, class traits = char_traits<charT> > +// class basic_ofstream + +// void open(const filesystem::path& s, ios_base::openmode mode = ios_base::out); + +#include <fstream> +#include <filesystem> +#include <cassert> +#include "platform_support.h" + +namespace fs = std::filesystem; + +int main() { + fs::path p = get_temp_file_name(); + { + std::ofstream fs; + assert(!fs.is_open()); + char c = 'a'; + fs << c; + assert(fs.fail()); + fs.open(p); + assert(fs.is_open()); + fs << c; + } + { + std::ifstream fs(p.c_str()); + char c = 0; + fs >> c; + assert(c == 'a'); + } + std::remove(p.c_str()); + { + std::wofstream fs; + assert(!fs.is_open()); + wchar_t c = L'a'; + fs << c; + assert(fs.fail()); + fs.open(p); + assert(fs.is_open()); + fs << c; + } + { + std::wifstream fs(p.c_str()); + wchar_t c = 0; + fs >> c; + assert(c == L'a'); + } + std::remove(p.c_str()); +} diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink b/test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink index 76646beed5ed3..76646beed5ed3 120000 --- a/test/std/experimental/filesystem/Inputs/static_test_env/bad_symlink +++ b/test/std/input.output/filesystems/Inputs/static_test_env/bad_symlink diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3 index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/afile3 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/afile3 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5 index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/dir3/file5 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/dir3/file5 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4 index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/file4 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/file4 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 index 3979139526219..3979139526219 120000 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/dir2/symlink_to_dir3 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1 index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file1 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file1 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2 b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2 index 44834e586734f..44834e586734f 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/dir1/file2 +++ b/test/std/input.output/filesystems/Inputs/static_test_env/dir1/file2 diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/empty_file index e69de29bb2d1d..e69de29bb2d1d 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/empty_file +++ b/test/std/input.output/filesystems/Inputs/static_test_env/empty_file diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file index 44834e586734f..44834e586734f 100644 --- a/test/std/experimental/filesystem/Inputs/static_test_env/non_empty_file +++ b/test/std/input.output/filesystems/Inputs/static_test_env/non_empty_file diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir index df490f837a85c..df490f837a85c 120000 --- a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_dir +++ b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_dir diff --git a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file index b79b689fc85ac..b79b689fc85ac 120000 --- a/test/std/experimental/filesystem/Inputs/static_test_env/symlink_to_empty_file +++ b/test/std/input.output/filesystems/Inputs/static_test_env/symlink_to_empty_file diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp new file mode 100644 index 0000000000000..a81d5ea7960fd --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy.pass.cpp @@ -0,0 +1,74 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry(const directory_entry&) = default; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" +#include "test_convertible.hpp" + +TEST_SUITE(directory_entry_path_ctor_suite) + +TEST_CASE(copy_ctor) { + using namespace fs; + // Copy + { + static_assert(std::is_copy_constructible<directory_entry>::value, + "directory_entry must be copy constructible"); + static_assert(!std::is_nothrow_copy_constructible<directory_entry>::value, + "directory_entry's copy constructor cannot be noexcept"); + const path p("foo/bar/baz"); + const directory_entry e(p); + assert(e.path() == p); + directory_entry e2(e); + assert(e.path() == p); + assert(e2.path() == p); + } +} + +TEST_CASE(copy_ctor_copies_cache) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent(sym); + + fs::remove(sym); + + directory_entry ent_cp(ent); + TEST_CHECK(ent_cp.path() == sym); + TEST_CHECK(ent_cp.is_symlink()); + } + + { + directory_entry ent(file); + + fs::remove(file); + + directory_entry ent_cp(ent); + TEST_CHECK(ent_cp.path() == file); + TEST_CHECK(ent_cp.is_regular_file()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp new file mode 100644 index 0000000000000..204207276cb5a --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/copy_assign.pass.cpp @@ -0,0 +1,82 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry& operator=(directory_entry const&) = default; +// directory_entry& operator=(directory_entry&&) noexcept = default; +// void assign(path const&); +// void replace_filename(path const&); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +TEST_SUITE(directory_entry_ctor_suite) + +TEST_CASE(test_copy_assign_operator) { + using namespace fs; + // Copy + { + static_assert(std::is_copy_assignable<directory_entry>::value, + "directory_entry must be copy assignable"); + static_assert(!std::is_nothrow_copy_assignable<directory_entry>::value, + "directory_entry's copy assignment cannot be noexcept"); + const path p("foo/bar/baz"); + const path p2("abc"); + const directory_entry e(p); + directory_entry e2; + assert(e.path() == p && e2.path() == path()); + e2 = e; + assert(e.path() == p && e2.path() == p); + directory_entry e3(p2); + e2 = e3; + assert(e2.path() == p2 && e3.path() == p2); + } +} + +TEST_CASE(copy_assign_copies_cache) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent(sym); + + fs::remove(sym); + + directory_entry ent_cp; + ent_cp = ent; + TEST_CHECK(ent_cp.path() == sym); + TEST_CHECK(ent_cp.is_symlink()); + } + + { + directory_entry ent(file); + + fs::remove(file); + + directory_entry ent_cp; + ent_cp = ent; + TEST_CHECK(ent_cp.path() == file); + TEST_CHECK(ent_cp.is_regular_file()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp new file mode 100644 index 0000000000000..1d83cc69d6cbd --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry() noexcept = default; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +int main() { + using namespace fs; + // Default + { + static_assert(std::is_nothrow_default_constructible<directory_entry>::value, + "directory_entry must have a nothrow default constructor"); + directory_entry e; + assert(e.path() == path()); + } +} diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp new file mode 100644 index 0000000000000..240541d203d34 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/default_const.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 +// XFAIL: apple-clang-7, clang-3.7, clang-3.8 + +// <filesystem> + +// class directory_entry + +// directory_entry() noexcept = default; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +int main() { + using namespace fs; + // Default + { + static_assert(std::is_nothrow_default_constructible<directory_entry>::value, + "directory_entry must have a nothrow default constructor"); + const directory_entry e; + assert(e.path() == path()); + } +} diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp new file mode 100644 index 0000000000000..238a8549ea3bb --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move.pass.cpp @@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry(directory_entry&&) noexcept = default; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" +#include "test_convertible.hpp" + +TEST_SUITE(directory_entry_path_ctor_suite) + +TEST_CASE(move_ctor) { + using namespace fs; + // Move + { + static_assert(std::is_nothrow_move_constructible<directory_entry>::value, + "directory_entry must be nothrow move constructible"); + const path p("foo/bar/baz"); + directory_entry e(p); + assert(e.path() == p); + directory_entry e2(std::move(e)); + assert(e2.path() == p); + assert(e.path() != p); // Testing moved from state. + } +} + +TEST_CASE(move_ctor_copies_cache) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent(sym); + + fs::remove(sym); + + directory_entry ent_cp(std::move(ent)); + TEST_CHECK(ent_cp.path() == sym); + TEST_CHECK(ent_cp.is_symlink()); + } + + { + directory_entry ent(file); + + fs::remove(file); + + directory_entry ent_cp(std::move(ent)); + TEST_CHECK(ent_cp.path() == file); + TEST_CHECK(ent_cp.is_regular_file()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp new file mode 100644 index 0000000000000..f104980c9c479 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/move_assign.pass.cpp @@ -0,0 +1,78 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry& operator=(directory_entry const&) = default; +// directory_entry& operator=(directory_entry&&) noexcept = default; +// void assign(path const&); +// void replace_filename(path const&); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +TEST_SUITE(directory_entry_ctor_suite) + +TEST_CASE(test_move_assign_operator) { + using namespace fs; + // Copy + { + static_assert(std::is_nothrow_move_assignable<directory_entry>::value, + "directory_entry is noexcept move assignable"); + const path p("foo/bar/baz"); + const path p2("abc"); + directory_entry e(p); + directory_entry e2(p2); + assert(e.path() == p && e2.path() == p2); + e2 = std::move(e); + assert(e2.path() == p); + assert(e.path() != p); // testing moved from state + } +} + +TEST_CASE(move_assign_copies_cache) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent(sym); + + fs::remove(sym); + + directory_entry ent_cp; + ent_cp = std::move(ent); + TEST_CHECK(ent_cp.path() == sym); + TEST_CHECK(ent_cp.is_symlink()); + } + + { + directory_entry ent(file); + + fs::remove(file); + + directory_entry ent_cp; + ent_cp = std::move(ent); + TEST_CHECK(ent_cp.path() == file); + TEST_CHECK(ent_cp.is_regular_file()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp new file mode 100644 index 0000000000000..b06bd129384d4 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp @@ -0,0 +1,182 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// explicit directory_entry(const path); +// directory_entry(const path&, error_code& ec); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" +#include "test_convertible.hpp" + +TEST_SUITE(directory_entry_path_ctor_suite) + +TEST_CASE(path_ctor) { + using namespace fs; + { + static_assert(std::is_constructible<directory_entry, const path&>::value, + "directory_entry must be constructible from path"); + static_assert( + !std::is_nothrow_constructible<directory_entry, const path&>::value, + "directory_entry constructor should not be noexcept"); + static_assert(!std::is_convertible<path const&, directory_entry>::value, + "directory_entry constructor should be explicit"); + } + { + const path p("foo/bar/baz"); + const directory_entry e(p); + TEST_CHECK(e.path() == p); + } +} + +TEST_CASE(path_ec_ctor) { + using namespace fs; + { + static_assert( + std::is_constructible<directory_entry, const path&, + std::error_code&>::value, + "directory_entry must be constructible from path and error_code"); + static_assert(!std::is_nothrow_constructible<directory_entry, const path&, + std::error_code&>::value, + "directory_entry constructor should not be noexcept"); + static_assert( + test_convertible<directory_entry, const path&, std::error_code&>(), + "directory_entry constructor should not be explicit"); + } + { + std::error_code ec = GetTestEC(); + const directory_entry e(StaticEnv::File, ec); + TEST_CHECK(e.path() == StaticEnv::File); + TEST_CHECK(!ec); + } + { + const path p("foo/bar/baz"); + std::error_code ec = GetTestEC(); + const directory_entry e(p, ec); + TEST_CHECK(e.path() == p); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + } +} + +TEST_CASE(path_ctor_calls_refresh) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent(file); + std::error_code ec = GetTestEC(); + directory_entry ent_ec(file, ec); + TEST_CHECK(!ec); + + LIBCPP_ONLY(remove(file)); + + TEST_CHECK(ent.exists()); + TEST_CHECK(ent_ec.exists()); + + TEST_CHECK(ent.file_size() == 42); + TEST_CHECK(ent_ec.file_size() == 42); + } + + env.create_file("dir/file", 101); + + { + directory_entry ent(sym); + std::error_code ec = GetTestEC(); + directory_entry ent_ec(sym, ec); + TEST_CHECK(!ec); + + LIBCPP_ONLY(remove(file)); + LIBCPP_ONLY(remove(sym)); + + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent_ec.is_symlink()); + + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent_ec.is_regular_file()); + + TEST_CHECK(ent.file_size() == 101); + TEST_CHECK(ent_ec.file_size() == 101); + } +} + +TEST_CASE(path_ctor_dne) { + using namespace fs; + + { + std::error_code ec = GetTestEC(); + directory_entry ent(StaticEnv::DNE, ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + TEST_CHECK(ent.path() == StaticEnv::DNE); + } + // don't report dead symlinks as an error. + { + std::error_code ec = GetTestEC(); + directory_entry ent(StaticEnv::BadSymlink, ec); + TEST_CHECK(!ec); + TEST_CHECK(ent.path() == StaticEnv::BadSymlink); + } + // DNE does not cause the constructor to throw + { + directory_entry ent(StaticEnv::DNE); + TEST_CHECK(ent.path() == StaticEnv::DNE); + + directory_entry ent_two(StaticEnv::BadSymlink); + TEST_CHECK(ent_two.path() == StaticEnv::BadSymlink); + } +} + +TEST_CASE(path_ctor_cannot_resolve) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file1", 101); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("dir/file1", "dir/sym2"); + permissions(dir, perms::none); + + { + std::error_code ec = GetTestEC(); + directory_entry ent(file, ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + TEST_CHECK(ent.path() == file); + } + { + std::error_code ec = GetTestEC(); + directory_entry ent(sym_in_dir, ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + TEST_CHECK(ent.path() == sym_in_dir); + } + { + std::error_code ec = GetTestEC(); + directory_entry ent(sym_out_of_dir, ec); + TEST_CHECK(!ec); + TEST_CHECK(ent.path() == sym_out_of_dir); + } + { + TEST_CHECK_NO_THROW(directory_entry(file)); + TEST_CHECK_NO_THROW(directory_entry(sym_in_dir)); + TEST_CHECK_NO_THROW(directory_entry(sym_out_of_dir)); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp new file mode 100644 index 0000000000000..d19c8c2ad873c --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp @@ -0,0 +1,132 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry& operator=(directory_entry const&) = default; +// directory_entry& operator=(directory_entry&&) noexcept = default; +// void assign(path const&); +// void replace_filename(path const&); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +TEST_SUITE(directory_entry_mods_suite) + +TEST_CASE(test_path_assign_method) { + using namespace fs; + const path p("foo/bar/baz"); + const path p2("abc"); + directory_entry e(p); + { + static_assert(std::is_same<decltype(e.assign(p)), void>::value, + "return type should be void"); + static_assert(noexcept(e.assign(p)) == false, + "operation must not be noexcept"); + } + { + TEST_CHECK(e.path() == p); + e.assign(p2); + TEST_CHECK(e.path() == p2 && e.path() != p); + e.assign(p); + TEST_CHECK(e.path() == p && e.path() != p2); + } +} + +TEST_CASE(test_path_assign_ec_method) { + using namespace fs; + const path p("foo/bar/baz"); + const path p2("abc"); + { + std::error_code ec; + directory_entry e(p); + static_assert(std::is_same<decltype(e.assign(p, ec)), void>::value, + "return type should be void"); + static_assert(noexcept(e.assign(p, ec)) == false, + "operation must not be noexcept"); + } + { + directory_entry ent(p); + std::error_code ec = GetTestEC(); + ent.assign(p2, ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + TEST_CHECK(ent.path() == p2); + } +} + +TEST_CASE(test_assign_calls_refresh) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + { + directory_entry ent; + ent.assign(file); + + // removing the file demonstrates that the values where cached previously. + LIBCPP_ONLY(remove(file)); + + TEST_CHECK(ent.is_regular_file()); + } + env.create_file("dir/file", 101); + { + directory_entry ent; + ent.assign(sym); + + LIBCPP_ONLY(remove(file)); + LIBCPP_ONLY(remove(sym)); + + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + } +} + +TEST_CASE(test_assign_propagates_error) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path file_out_of_dir = env.create_file("file1"); + const path sym_in_dir = env.create_symlink("file1", "dir/sym1"); + + permissions(dir, perms::none); + + { + directory_entry ent; + std::error_code ec = GetTestEC(); + ent.assign(file, ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + } + { + directory_entry ent; + std::error_code ec = GetTestEC(); + ent.assign(sym_in_dir, ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + } + { + directory_entry ent; + std::error_code ec = GetTestEC(); + ent.assign(sym_out_of_dir, ec); + TEST_CHECK(!ec); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp new file mode 100644 index 0000000000000..575f0d59b4cd5 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp @@ -0,0 +1,341 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry& operator=(directory_entry const&) = default; +// directory_entry& operator=(directory_entry&&) noexcept = default; +// void assign(path const&); +// void replace_filename(path const&); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +TEST_SUITE(directory_entry_mods_suite) + +TEST_CASE(test_refresh_method) { + using namespace fs; + { + directory_entry e; + static_assert(noexcept(e.refresh()) == false, + "operation cannot be noexcept"); + static_assert(std::is_same<decltype(e.refresh()), void>::value, + "operation must return void"); + } + { + directory_entry e; + e.refresh(); + TEST_CHECK(!e.exists()); + } +} + +TEST_CASE(test_refresh_ec_method) { + using namespace fs; + { + directory_entry e; + std::error_code ec; + static_assert(noexcept(e.refresh(ec)), "operation should be noexcept"); + static_assert(std::is_same<decltype(e.refresh(ec)), void>::value, + "operation must return void"); + } + { + directory_entry e; + std::error_code ec = GetTestEC(); + e.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + } +} + +TEST_CASE(refresh_on_file_dne) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + + const perms old_perms = status(dir).permissions(); + + // test file doesn't exist + { + directory_entry ent(file); + remove(file); + TEST_CHECK(ent.exists()); + + ent.refresh(); + + permissions(dir, perms::none); + TEST_CHECK(!ent.exists()); + } + permissions(dir, old_perms); + env.create_file("dir/file", 101); + { + directory_entry ent(file); + remove(file); + TEST_CHECK(ent.exists()); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + permissions(dir, perms::none); + TEST_CHECK(!ent.exists()); + } +} + +void remove_if_exists(const fs::path& p) { + std::error_code ec; + remove(p, ec); +} + +TEST_CASE(refresh_on_bad_symlink) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path sym = env.create_symlink("dir/file", "sym"); + + const perms old_perms = status(dir).permissions(); + + // test file doesn't exist + { + directory_entry ent(sym); + LIBCPP_ONLY(remove(file)); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.exists()); + + remove_if_exists(file); + ent.refresh(); + + LIBCPP_ONLY(permissions(dir, perms::none)); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(!ent.is_regular_file()); + TEST_CHECK(!ent.exists()); + } + permissions(dir, old_perms); + env.create_file("dir/file", 101); + { + directory_entry ent(sym); + LIBCPP_ONLY(remove(file)); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.exists()); + + remove_if_exists(file); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(!ec); // we don't report bad symlinks as an error. + + LIBCPP_ONLY(permissions(dir, perms::none)); + TEST_CHECK(!ent.exists()); + } +} + +TEST_CASE(refresh_cannot_resolve) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file1", 99); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("file1", "dir/sym1"); + perms old_perms = status(dir).permissions(); + + { + directory_entry ent(file); + permissions(dir, perms::none); + + TEST_CHECK(ent.is_regular_file()); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + TEST_CHECK(ent.path() == file); + + ExceptionChecker Checker(file, std::errc::permission_denied, + "directory_entry::refresh"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh()); + } + permissions(dir, old_perms); + { + directory_entry ent(sym_in_dir); + permissions(dir, perms::none); + TEST_CHECK(ent.is_symlink()); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + TEST_CHECK(ent.path() == sym_in_dir); + + ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied, + "directory_entry::refresh"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.refresh()); + } + permissions(dir, old_perms); + { + directory_entry ent(sym_out_of_dir); + permissions(dir, perms::none); + TEST_CHECK(ent.is_symlink()); + + // Failure to resolve the linked entity due to permissions is not + // reported as an error. + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(!ec); + TEST_CHECK(ent.is_symlink()); + + ec = GetTestEC(); + TEST_CHECK(ent.exists(ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + TEST_CHECK(ent.path() == sym_out_of_dir); + } + permissions(dir, old_perms); + { + directory_entry ent_file(file); + directory_entry ent_sym(sym_in_dir); + directory_entry ent_sym2(sym_out_of_dir); + permissions(dir, perms::none); + ((void)ent_file); + ((void)ent_sym); + + TEST_CHECK_THROW(filesystem_error, ent_file.refresh()); + TEST_CHECK_THROW(filesystem_error, ent_sym.refresh()); + TEST_CHECK_NO_THROW(ent_sym2); + } +} + +TEST_CASE(refresh_doesnt_throw_on_dne_but_reports_it) { + using namespace fs; + scoped_test_env env; + + const path file = env.create_file("file1", 42); + const path sym = env.create_symlink("file1", "sym"); + + { + directory_entry ent(file); + TEST_CHECK(ent.file_size() == 42); + + remove(file); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + TEST_CHECK_NO_THROW(ent.refresh()); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + // doesn't throw! + TEST_CHECK_THROW(filesystem_error, ent.file_size()); + } + env.create_file("file1", 99); + { + directory_entry ent(sym); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.file_size() == 99); + + remove(file); + + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + TEST_CHECK_THROW(filesystem_error, ent.file_size()); + } +} + +TEST_CASE(access_cache_after_refresh_fails) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file1", 101); + const path sym = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("dir/file", "dir/sym2"); + + const perms old_perms = status(dir).permissions(); + +#define CHECK_ACCESS(func, expect) \ + ec = GetTestEC(); \ + TEST_CHECK(ent.func(ec) == expect); \ + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)) + + // test file doesn't exist + { + directory_entry ent(file); + + TEST_CHECK(!ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.exists()); + + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + CHECK_ACCESS(exists, false); + CHECK_ACCESS(is_symlink, false); + CHECK_ACCESS(last_write_time, file_time_type::min()); + CHECK_ACCESS(hard_link_count, uintmax_t(-1)); + } + permissions(dir, old_perms); + { + directory_entry ent(sym_in_dir); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.exists()); + + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + CHECK_ACCESS(exists, false); + CHECK_ACCESS(is_symlink, false); + CHECK_ACCESS(last_write_time, file_time_type::min()); + CHECK_ACCESS(hard_link_count, uintmax_t(-1)); + } + permissions(dir, old_perms); + { + directory_entry ent(sym); + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.exists()); + + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.refresh(ec); + TEST_CHECK(!ec); + TEST_CHECK(ent.is_symlink()); + + CHECK_ACCESS(exists, false); + CHECK_ACCESS(is_regular_file, false); + CHECK_ACCESS(last_write_time, file_time_type::min()); + CHECK_ACCESS(hard_link_count, uintmax_t(-1)); + } +#undef CHECK_ACCESS +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp new file mode 100644 index 0000000000000..4a9b76d6375fd --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp @@ -0,0 +1,169 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// directory_entry& operator=(directory_entry const&) = default; +// directory_entry& operator=(directory_entry&&) noexcept = default; +// void assign(path const&); +// void replace_filename(path const&); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +TEST_SUITE(directory_entry_mods_suite) + +TEST_CASE(test_replace_filename_method) { + using namespace fs; + + { + directory_entry e; + path replace; + static_assert(noexcept(e.replace_filename(replace)) == false, + "operation cannot be noexcept"); + static_assert( + std::is_same<decltype(e.replace_filename(replace)), void>::value, + "operation must return void"); + } + { + const path p("/path/to/foo.exe"); + const path replace("bar.out"); + const path expect("/path/to/bar.out"); + directory_entry e(p); + TEST_CHECK(e.path() == p); + e.replace_filename(replace); + TEST_CHECK(e.path() == expect); + } +} + +TEST_CASE(test_replace_filename_ec_method) { + using namespace fs; + + { + directory_entry e; + path replace; + std::error_code ec; + static_assert(noexcept(e.replace_filename(replace, ec)) == false, + "operation cannot be noexcept"); + static_assert( + std::is_same<decltype(e.replace_filename(replace, ec)), void>::value, + "operation must return void"); + } + { + const path p("/path/to/foo.exe"); + const path replace("bar.out"); + const path expect("/path/to/bar.out"); + directory_entry e(p); + TEST_CHECK(e.path() == p); + std::error_code ec = GetTestEC(); + e.replace_filename(replace, ec); + TEST_CHECK(e.path() == expect); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + } + { + const path p = StaticEnv::EmptyFile; + const path expect = StaticEnv::NonEmptyFile; + const path replace = StaticEnv::NonEmptyFile.filename(); + TEST_REQUIRE(expect.parent_path() == p.parent_path()); + directory_entry e(p); + TEST_CHECK(e.path() == p); + std::error_code ec = GetTestEC(); + e.replace_filename(replace, ec); + TEST_CHECK(e.path() == expect); + TEST_CHECK(!ec); + } +} + +TEST_CASE(test_replace_filename_calls_refresh) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_two = env.create_file("dir/file_two", 101); + const path sym = env.create_symlink("dir/file", "sym"); + const path sym_two = env.create_symlink("dir/file_two", "sym_two"); + + { + directory_entry ent(file); + ent.replace_filename(file_two.filename()); + TEST_REQUIRE(ent.path() == file_two); + + // removing the file demonstrates that the values where cached previously. + LIBCPP_ONLY(remove(file_two)); + + TEST_CHECK(ent.file_size() == 101); + } + env.create_file("dir/file_two", 99); + { + directory_entry ent(sym); + ent.replace_filename(sym_two.filename()); + TEST_REQUIRE(ent.path() == sym_two); + + LIBCPP_ONLY(remove(file_two)); + LIBCPP_ONLY(remove(sym_two)); + + TEST_CHECK(ent.is_symlink()); + TEST_CHECK(ent.is_regular_file()); + TEST_CHECK(ent.file_size() == 99); + } +} + +TEST_CASE(test_replace_filename_propagates_error) { + using namespace fs; + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_two = env.create_file("dir/file_two", 99); + const path file_out_of_dir = env.create_file("file_three", 101); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_out_of_dir_two = env.create_symlink("dir/file", "sym_two"); + const path sym_in_dir = env.create_symlink("file_two", "dir/sym_three"); + const path sym_in_dir_two = env.create_symlink("file_two", "dir/sym_four"); + + const perms old_perms = status(dir).permissions(); + + { + directory_entry ent(file); + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.replace_filename(file_two.filename(), ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + } + permissions(dir, old_perms); + { + directory_entry ent(sym_in_dir); + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.replace_filename(sym_in_dir_two.filename(), ec); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + } + permissions(dir, old_perms); + { + directory_entry ent(sym_out_of_dir); + permissions(dir, perms::none); + std::error_code ec = GetTestEC(); + ent.replace_filename(sym_out_of_dir_two.filename(), ec); + TEST_CHECK(!ec); + TEST_CHECK(ent.is_symlink()); + ec = GetTestEC(); + TEST_CHECK(!ent.exists(ec)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + } +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp index 96e5093002293..7df36fed3a6e1 100644 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/comparisons.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/comparisons.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_entry @@ -21,11 +21,10 @@ // bool operator>=(directory_entry const&) const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> -namespace fs = std::experimental::filesystem; #define CHECK_OP(Op) \ static_assert(std::is_same<decltype(ce. operator Op (ce)), bool>::value, ""); \ diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp new file mode 100644 index 0000000000000..04dec92c9c991 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp @@ -0,0 +1,242 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// uintmax_t file_size() const; +// uintmax_t file_size(error_code const&) const noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" + +#include <iostream> + +TEST_SUITE(directory_entry_obs_testsuite) + +TEST_CASE(signatures) { + using namespace fs; + { + const fs::directory_entry e = {}; + std::error_code ec; + static_assert(std::is_same<decltype(e.file_size()), uintmax_t>::value, ""); + static_assert(std::is_same<decltype(e.file_size(ec)), uintmax_t>::value, + ""); + static_assert(noexcept(e.file_size()) == false, ""); + static_assert(noexcept(e.file_size(ec)) == true, ""); + } +} + +TEST_CASE(basic) { + using namespace fs; + + scoped_test_env env; + const path file = env.create_file("file", 42); + const path dir = env.create_dir("dir"); + const path sym = env.create_symlink("file", "sym"); + + { + directory_entry ent(file); + uintmax_t expect = file_size(ent); + TEST_CHECK(expect == 42); + + // Remove the file to show that the results were already in the cache. + LIBCPP_ONLY(remove(file)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == expect); + TEST_CHECK(!ec); + } + env.create_file("file", 99); + { + directory_entry ent(sym); + + uintmax_t expect = file_size(ent); + TEST_CHECK(expect == 99); + + LIBCPP_ONLY(remove(ent)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == 99); + TEST_CHECK(!ec); + } +} + +TEST_CASE(not_regular_file) { + using namespace fs; + + scoped_test_env env; + struct { + const path p; + std::errc expected_err; + } TestCases[] = { + {env.create_dir("dir"), std::errc::is_a_directory}, + {env.create_fifo("fifo"), std::errc::not_supported}, + {env.create_symlink("dir", "sym"), std::errc::is_a_directory}}; + + for (auto const& TC : TestCases) { + const path& p = TC.p; + directory_entry ent(p); + TEST_CHECK(ent.path() == p); + std::error_code ec = GetTestEC(0); + + std::error_code other_ec = GetTestEC(1); + uintmax_t expect = file_size(p, other_ec); + + uintmax_t got = ent.file_size(ec); + TEST_CHECK(got == expect); + TEST_CHECK(got == uintmax_t(-1)); + TEST_CHECK(ec == other_ec); + TEST_CHECK(ErrorIs(ec, TC.expected_err)); + + ExceptionChecker Checker(p, TC.expected_err, "directory_entry::file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + } +} + +TEST_CASE(error_reporting) { + using namespace fs; + + scoped_test_env env; + + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file2", 101); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); + + const perms old_perms = status(dir).permissions(); + + // test a file which doesn't exist + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + ent.assign(StaticEnv::DNE, ec); + TEST_REQUIRE(ent.path() == StaticEnv::DNE); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::DNE, + std::errc::no_such_file_or_directory, + "directory_entry::file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + } + // test a dead symlink + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + uintmax_t expect_bad = file_size(StaticEnv::BadSymlink, ec); + TEST_CHECK(expect_bad == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + ent.assign(StaticEnv::BadSymlink, ec); + TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == expect_bad); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::BadSymlink, + std::errc::no_such_file_or_directory, + "directory_entry::file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + } + // test a file w/o appropriate permissions. + { + directory_entry ent; + uintmax_t expect_good = file_size(file); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(file, ec); + TEST_REQUIRE(ent.path() == file); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(file, std::errc::permission_denied, "file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.file_size()); + } + permissions(dir, old_perms); + // test a symlink w/o appropriate permissions. + { + directory_entry ent; + uintmax_t expect_good = file_size(sym_in_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_in_dir, ec); + TEST_REQUIRE(ent.path() == sym_in_dir); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied, + "file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.file_size()); + } + permissions(dir, old_perms); + // test a symlink to a file w/o appropriate permissions + { + directory_entry ent; + uintmax_t expect_good = file_size(sym_out_of_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_out_of_dir, ec); + TEST_REQUIRE(ent.path() == sym_out_of_dir); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied, + "file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.file_size(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.file_size()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp new file mode 100644 index 0000000000000..2a0d80ca6262c --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp @@ -0,0 +1,258 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// file_status status() const; +// file_status status(error_code const&) const noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" + +TEST_SUITE(directory_entry_obs_testsuite) + +TEST_CASE(file_dne) { + using namespace fs; + directory_entry p("dne"); +} + +TEST_CASE(signatures) { + using namespace fs; + const directory_entry e = {}; + std::error_code ec; +#define TEST_FUNC(name) \ + static_assert(std::is_same<decltype(e.name()), bool>::value, \ + "wrong return type"); \ + static_assert(noexcept(e.name()) == false, "should not be noexcept"); \ + static_assert(std::is_same<decltype(e.name(ec)), bool>::value, \ + "wrong return type"); \ + static_assert(noexcept(e.name(ec)) == true, "should be noexcept") + + TEST_FUNC(exists); + TEST_FUNC(is_block_file); + TEST_FUNC(is_character_file); + TEST_FUNC(is_directory); + TEST_FUNC(is_fifo); + TEST_FUNC(is_other); + TEST_FUNC(is_regular_file); + TEST_FUNC(is_socket); + TEST_FUNC(is_symlink); + +#undef TEST_FUNC +} + +TEST_CASE(test_without_ec) { + using namespace fs; + using fs::directory_entry; + using fs::file_status; + using fs::path; + + scoped_test_env env; + path f = env.create_file("foo", 42); + path d = env.create_dir("dir"); + path fifo = env.create_fifo("fifo"); + path hl = env.create_hardlink("foo", "hl"); + for (auto p : {hl, f, d, fifo}) { + directory_entry e(p); + file_status st = status(p); + file_status sym_st = symlink_status(p); + fs::remove(p); + TEST_REQUIRE(e.exists()); + TEST_REQUIRE(!exists(p)); + TEST_CHECK(e.exists() == exists(st)); + TEST_CHECK(e.is_block_file() == is_block_file(st)); + TEST_CHECK(e.is_character_file() == is_character_file(st)); + TEST_CHECK(e.is_directory() == is_directory(st)); + TEST_CHECK(e.is_fifo() == is_fifo(st)); + TEST_CHECK(e.is_other() == is_other(st)); + TEST_CHECK(e.is_regular_file() == is_regular_file(st)); + TEST_CHECK(e.is_socket() == is_socket(st)); + TEST_CHECK(e.is_symlink() == is_symlink(sym_st)); + } +} + +TEST_CASE(test_with_ec) { + using namespace fs; + using fs::directory_entry; + using fs::file_status; + using fs::path; + + scoped_test_env env; + path f = env.create_file("foo", 42); + path d = env.create_dir("dir"); + path fifo = env.create_fifo("fifo"); + path hl = env.create_hardlink("foo", "hl"); + for (auto p : {hl, f, d, fifo}) { + directory_entry e(p); + std::error_code status_ec = GetTestEC(); + std::error_code sym_status_ec = GetTestEC(1); + file_status st = status(p, status_ec); + file_status sym_st = symlink_status(p, sym_status_ec); + fs::remove(p); + std::error_code ec = GetTestEC(2); + auto CheckEC = [&](std::error_code const& other_ec) { + bool res = ec == other_ec; + ec = GetTestEC(2); + return res; + }; + + TEST_REQUIRE(e.exists(ec)); + TEST_CHECK(CheckEC(status_ec)); + TEST_REQUIRE(!exists(p)); + + TEST_CHECK(e.exists(ec) == exists(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_block_file(ec) == is_block_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_character_file(ec) == is_character_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_directory(ec) == is_directory(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_fifo(ec) == is_fifo(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_other(ec) == is_other(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_socket(ec) == is_socket(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st)); + TEST_CHECK(CheckEC(sym_status_ec)); + } +} + +TEST_CASE(test_with_ec_dne) { + using namespace fs; + using fs::directory_entry; + using fs::file_status; + using fs::path; + + for (auto p : {StaticEnv::DNE, StaticEnv::BadSymlink}) { + + directory_entry e(p); + std::error_code status_ec = GetTestEC(); + std::error_code sym_status_ec = GetTestEC(1); + file_status st = status(p, status_ec); + file_status sym_st = symlink_status(p, sym_status_ec); + std::error_code ec = GetTestEC(2); + auto CheckEC = [&](std::error_code const& other_ec) { + bool res = ec == other_ec; + ec = GetTestEC(2); + return res; + }; + + TEST_CHECK(e.exists(ec) == exists(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_block_file(ec) == is_block_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_character_file(ec) == is_character_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_directory(ec) == is_directory(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_fifo(ec) == is_fifo(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_other(ec) == is_other(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_socket(ec) == is_socket(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st)); + TEST_CHECK(CheckEC(sym_status_ec)); + } +} + +TEST_CASE(test_with_ec_cannot_resolve) { + using namespace fs; + using fs::directory_entry; + using fs::file_status; + using fs::path; + + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file2", 99); + const path sym = env.create_symlink("file2", "dir/sym"); + + perms old_perms = fs::status(dir).permissions(); + + for (auto p : {file, sym}) { + permissions(dir, old_perms); + directory_entry e(p); + + permissions(dir, perms::none); + std::error_code dummy_ec; + e.refresh(dummy_ec); + TEST_REQUIRE(dummy_ec); + + std::error_code status_ec = GetTestEC(); + std::error_code sym_status_ec = GetTestEC(1); + file_status st = status(p, status_ec); + file_status sym_st = symlink_status(p, sym_status_ec); + std::error_code ec = GetTestEC(2); + auto CheckEC = [&](std::error_code const& other_ec) { + bool res = ec == other_ec; + ec = GetTestEC(2); + return res; + }; + + TEST_CHECK(e.exists(ec) == exists(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_block_file(ec) == is_block_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_character_file(ec) == is_character_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_directory(ec) == is_directory(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_fifo(ec) == is_fifo(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_other(ec) == is_other(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_regular_file(ec) == is_regular_file(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_socket(ec) == is_socket(st)); + TEST_CHECK(CheckEC(status_ec)); + + TEST_CHECK(e.is_symlink(ec) == is_symlink(sym_st)); + TEST_CHECK(CheckEC(sym_status_ec)); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp new file mode 100644 index 0000000000000..17124c132cb4a --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp @@ -0,0 +1,242 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// uintmax_t hard_link_count() const; +// uintmax_t hard_link_count(error_code const&) const noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" + +TEST_SUITE(directory_entry_obs_testsuite) + +TEST_CASE(signatures) { + using namespace fs; + { + const directory_entry e = {}; + std::error_code ec; + static_assert(std::is_same<decltype(e.hard_link_count()), uintmax_t>::value, ""); + static_assert(std::is_same<decltype(e.hard_link_count(ec)), uintmax_t>::value, + ""); + static_assert(noexcept(e.hard_link_count()) == false, ""); + static_assert(noexcept(e.hard_link_count(ec)) == true, ""); + } +} + +TEST_CASE(basic) { + using namespace fs; + + scoped_test_env env; + const path file = env.create_file("file", 42); + const path dir = env.create_dir("dir"); + const path sym = env.create_symlink("file", "sym"); + + { + directory_entry ent(file); + uintmax_t expect = hard_link_count(ent); + + // Remove the file to show that the results were already in the cache. + LIBCPP_ONLY(remove(file)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect); + TEST_CHECK(!ec); + } + { + directory_entry ent(dir); + uintmax_t expect = hard_link_count(ent); + + LIBCPP_ONLY(remove(dir)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect); + TEST_CHECK(!ec); + } + env.create_file("file", 99); + env.create_hardlink("file", "hl"); + { + directory_entry ent(sym); + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == 2); + TEST_CHECK(!ec); + } +} + +TEST_CASE(not_regular_file) { + using namespace fs; + + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path dir2 = env.create_dir("dir/dir2"); + const path fifo = env.create_fifo("dir/fifo"); + const path sym_to_fifo = env.create_symlink("dir/fifo", "dir/sym"); + + const perms old_perms = status(dir).permissions(); + + for (auto p : {dir2, fifo, sym_to_fifo}) { + permissions(dir, old_perms); + std::error_code dummy_ec = GetTestEC(); + directory_entry ent(p, dummy_ec); + TEST_CHECK(!dummy_ec); + + uintmax_t expect = hard_link_count(p); + + LIBCPP_ONLY(permissions(dir, perms::none)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.hard_link_count()); + } +} + +TEST_CASE(error_reporting) { + using namespace fs; + + scoped_test_env env; + + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file2", 101); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); + + const perms old_perms = status(dir).permissions(); + + // test a file which doesn't exist + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + ent.assign(StaticEnv::DNE, ec); + TEST_CHECK(ec); + TEST_REQUIRE(ent.path() == StaticEnv::DNE); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::DNE, + std::errc::no_such_file_or_directory, + "directory_entry::hard_link_count"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); + } + // test a dead symlink + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + uintmax_t expect_bad = hard_link_count(StaticEnv::BadSymlink, ec); + TEST_CHECK(expect_bad == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + ent.assign(StaticEnv::BadSymlink, ec); + TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect_bad); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::BadSymlink, + std::errc::no_such_file_or_directory, + "directory_entry::hard_link_count"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); + } + // test a file w/o appropriate permissions. + { + directory_entry ent; + uintmax_t expect_good = hard_link_count(file); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(file, ec); + TEST_REQUIRE(ent.path() == file); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(file, std::errc::permission_denied, + "hard_link_count"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.hard_link_count()); + } + permissions(dir, old_perms); + // test a symlink w/o appropriate permissions. + { + directory_entry ent; + uintmax_t expect_good = hard_link_count(sym_in_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_in_dir, ec); + TEST_REQUIRE(ent.path() == sym_in_dir); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied, + "hard_link_count"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.hard_link_count()); + } + permissions(dir, old_perms); + // test a symlink to a file w/o appropriate permissions + { + directory_entry ent; + uintmax_t expect_good = hard_link_count(sym_out_of_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_out_of_dir, ec); + TEST_REQUIRE(ent.path() == sym_out_of_dir); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == uintmax_t(-1)); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied, + "hard_link_count"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.hard_link_count(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.hard_link_count()); + } +} + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp new file mode 100644 index 0000000000000..afdd47a513c2a --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp @@ -0,0 +1,215 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// file_time_type last_write_time() const; +// file_time_type last_write_time(error_code const&) const noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" + +TEST_SUITE(directory_entry_obs_testsuite) + +TEST_CASE(signatures) { + using namespace fs; + { + const fs::directory_entry e = {}; + std::error_code ec; + static_assert(std::is_same<decltype(e.last_write_time()), file_time_type>::value, + ""); + static_assert(std::is_same<decltype(e.last_write_time(ec)), file_time_type>::value, + ""); + static_assert(noexcept(e.last_write_time()) == false, ""); + static_assert(noexcept(e.last_write_time(ec)) == true, ""); + } +} + +TEST_CASE(basic) { + using namespace fs; + + scoped_test_env env; + const path file = env.create_file("file", 42); + const path dir = env.create_dir("dir"); + const path sym = env.create_symlink("file", "sym"); + + { + directory_entry ent(file); + file_time_type expect = last_write_time(ent); + + // Remove the file to show that the results were already in the cache. + LIBCPP_ONLY(remove(file)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect); + TEST_CHECK(!ec); + } + { + directory_entry ent(dir); + file_time_type expect = last_write_time(ent); + + LIBCPP_ONLY(remove(dir)); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect); + TEST_CHECK(!ec); + } + env.create_file("file", 99); + { + directory_entry ent(sym); + file_time_type expect = last_write_time(sym); + + std::error_code ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect); + TEST_CHECK(!ec); + } +} + +TEST_CASE(error_reporting) { + using namespace fs; + + scoped_test_env env; + + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + const path file_out_of_dir = env.create_file("file2", 101); + const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); + const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); + + const perms old_perms = status(dir).permissions(); + + // test a file which doesn't exist + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + ent.assign(StaticEnv::DNE, ec); + TEST_REQUIRE(ent.path() == StaticEnv::DNE); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::DNE, + std::errc::no_such_file_or_directory, + "directory_entry::last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); + } + // test a dead symlink + { + directory_entry ent; + + std::error_code ec = GetTestEC(); + file_time_type expect_bad = last_write_time(StaticEnv::BadSymlink, ec); + TEST_CHECK(expect_bad == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ec = GetTestEC(); + ent.assign(StaticEnv::BadSymlink, ec); + TEST_REQUIRE(ent.path() == StaticEnv::BadSymlink); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect_bad); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); + + ExceptionChecker Checker(StaticEnv::BadSymlink, + std::errc::no_such_file_or_directory, + "directory_entry::last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); + } + // test a file w/o appropriate permissions. + { + directory_entry ent; + file_time_type expect_good = last_write_time(file); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(file, ec); + TEST_REQUIRE(ent.path() == file); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(file, std::errc::permission_denied, + "last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.last_write_time()); + } + permissions(dir, old_perms); + // test a symlink w/o appropriate permissions. + { + directory_entry ent; + file_time_type expect_good = last_write_time(sym_in_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_in_dir, ec); + TEST_REQUIRE(ent.path() == sym_in_dir); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_in_dir, std::errc::permission_denied, + "last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.last_write_time()); + } + permissions(dir, old_perms); + // test a symlink to a file w/o appropriate permissions + { + directory_entry ent; + file_time_type expect_good = last_write_time(sym_out_of_dir); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + ent.assign(sym_out_of_dir, ec); + TEST_REQUIRE(ent.path() == sym_out_of_dir); + TEST_CHECK(!ec); + + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(sym_out_of_dir, std::errc::permission_denied, + "last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); + + permissions(dir, old_perms); + ec = GetTestEC(); + TEST_CHECK(ent.last_write_time(ec) == expect_good); + TEST_CHECK(!ec); + TEST_CHECK_NO_THROW(ent.last_write_time()); + } +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp index d228a3d926413..2abb13df1f88d 100644 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/path.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/path.pass.cpp @@ -9,18 +9,17 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_entry // const path& path() const noexcept; // operator const path&() const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> -namespace fs = std::experimental::filesystem; void test_path_method() { using namespace fs; diff --git a/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp new file mode 100644 index 0000000000000..ec654468b9ae2 --- /dev/null +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/status.pass.cpp @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class directory_entry + +// file_status status() const; +// file_status status(error_code const&) const noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" + +TEST_SUITE(directory_entry_status_testsuite) + +TEST_CASE(test_basic) { + using namespace fs; + { + const fs::directory_entry e("foo"); + std::error_code ec; + static_assert(std::is_same<decltype(e.status()), fs::file_status>::value, ""); + static_assert(std::is_same<decltype(e.status(ec)), fs::file_status>::value, ""); + static_assert(noexcept(e.status()) == false, ""); + static_assert(noexcept(e.status(ec)) == true, ""); + } + path TestCases[] = {StaticEnv::File, StaticEnv::Dir, StaticEnv::SymlinkToFile, + StaticEnv::DNE}; + for (const auto& p : TestCases) { + const directory_entry e(p); + std::error_code pec = GetTestEC(), eec = GetTestEC(1); + file_status ps = fs::status(p, pec); + file_status es = e.status(eec); + TEST_CHECK(ps.type() == es.type()); + TEST_CHECK(ps.permissions() == es.permissions()); + TEST_CHECK(pec == eec); + } + for (const auto& p : TestCases) { + const directory_entry e(p); + file_status ps = fs::status(p); + file_status es = e.status(); + TEST_CHECK(ps.type() == es.type()); + TEST_CHECK(ps.permissions() == es.permissions()); + } +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp index 3a99eb671b44e..e8850c3a7b157 100644 --- a/test/std/experimental/filesystem/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/symlink_status.pass.cpp @@ -9,20 +9,23 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_entry // file_status symlink_status() const; // file_status symlink_status(error_code&) const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "filesystem_test_helper.hpp" +#include "rapid-cxx-test.hpp" -int main() { +TEST_SUITE(directory_entry_obs_suite) + +TEST_CASE(test_signature) { using namespace fs; { const directory_entry e("foo"); @@ -32,19 +35,24 @@ int main() { static_assert(noexcept(e.symlink_status()) == false, ""); static_assert(noexcept(e.symlink_status(ec)) == true, ""); } - auto TestFn = [](path const& p) { + path TestCases[] = {StaticEnv::File, StaticEnv::Dir, StaticEnv::SymlinkToFile, + StaticEnv::DNE}; + for (const auto& p : TestCases) { const directory_entry e(p); - std::error_code pec, eec; + std::error_code pec = GetTestEC(), eec = GetTestEC(1); file_status ps = fs::symlink_status(p, pec); file_status es = e.symlink_status(eec); - assert(ps.type() == es.type()); - assert(ps.permissions() == es.permissions()); - assert(pec == eec); - }; - { - TestFn(StaticEnv::File); - TestFn(StaticEnv::Dir); - TestFn(StaticEnv::SymlinkToFile); - TestFn(StaticEnv::DNE); + TEST_CHECK(ps.type() == es.type()); + TEST_CHECK(ps.permissions() == es.permissions()); + TEST_CHECK(pec == eec); + } + for (const auto& p : TestCases) { + const directory_entry e(p); + file_status ps = fs::symlink_status(p); + file_status es = e.symlink_status(); + TEST_CHECK(ps.type() == es.type()); + TEST_CHECK(ps.permissions() == es.permissions()); } } + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp index 5c4583391e74f..ac224ac7ae639 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator(directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_copy_construct_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp index 0d5ebf3ebe964..3f08e4024de5b 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/copy_assign.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator& operator=(directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_copy_assign_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp index 4fd60887b54c5..0a33544c547dd 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/ctor.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator @@ -18,7 +18,7 @@ // directory_iterator(const path& p, error_code& ec); // directory_iterator(const path& p, directory_options options, error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -27,7 +27,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_constructor_tests) @@ -86,7 +86,7 @@ TEST_CASE(test_construction_from_bad_path) TEST_CASE(access_denied_test_case) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; path const testDir = env.make_env_path("dir1"); path const testFile = testDir / "testFile"; @@ -122,7 +122,7 @@ TEST_CASE(access_denied_test_case) TEST_CASE(access_denied_to_file_test_case) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; path const testFile = env.make_env_path("file1"); env.create_file(testFile, 42); diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp index 94ace185a6aa8..21c4ed3b72370 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator::directory_iterator() noexcept -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { { diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp index 8d888717b101c..7ec814b214e28 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/increment.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/increment.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator& operator++(); // directory_iterator& increment(error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -26,7 +26,7 @@ #include "filesystem_test_helper.hpp" #include <iostream> -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_increment_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp index f6c94e18eb0e8..a2bf2ac9f2c07 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator(directory_iterator&&) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_move_construct_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp index 445f05a3c3e1e..1c7224344027e 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/move_assign.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator& operator=(directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -30,7 +30,7 @@ #pragma clang diagnostic ignored "-Wself-move" #endif -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_move_assign_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp index f93a184521895..71e8e55ae0343 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.nonmembers/begin_end.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator // directory_iterator begin(directory_iterator iter) noexcept; // directory_iterator end(directory_iterator iter) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -26,7 +26,7 @@ #include "filesystem_test_helper.hpp" #include <iostream> -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(directory_iterator_begin_end_tests) diff --git a/test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp index dad278f43d79d..4619083e8c378 100644 --- a/test/std/experimental/filesystem/class.directory_iterator/types.pass.cpp +++ b/test/std/input.output/filesystems/class.directory_iterator/types.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator @@ -19,13 +19,12 @@ // typedef ... reference; // typedef ... iterator_category -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp index a744e659f5b5b..6676c7b7d6ab1 100644 --- a/test/std/experimental/filesystem/class.file_status/file_status.cons.pass.cpp +++ b/test/std/input.output/filesystems/class.file_status/file_status.cons.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class file_status // explicit file_status() noexcept; // explicit file_status(file_type, perms prms = perms::unknown) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_convertible.hpp" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp index 8681b2dc50d6f..4cbf2062a1f72 100644 --- a/test/std/experimental/filesystem/class.file_status/file_status.mods.pass.cpp +++ b/test/std/input.output/filesystems/class.file_status/file_status.mods.pass.cpp @@ -9,18 +9,17 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class file_status // void type(file_type) noexcept; // void permissions(perms) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp b/test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp index 4113dee453dc6..89739b77df573 100644 --- a/test/std/experimental/filesystem/class.file_status/file_status.obs.pass.cpp +++ b/test/std/input.output/filesystems/class.file_status/file_status.obs.pass.cpp @@ -9,18 +9,17 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class file_status // file_type type() const noexcept; // perms permissions(p) const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp b/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp index 68b67ed72803b..b7484df5cc78a 100644 --- a/test/std/experimental/filesystem/class.filesystem_error/filesystem_error.members.pass.cpp +++ b/test/std/input.output/filesystems/class.filesystem_error/filesystem_error.members.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class filesystem_error @@ -21,13 +21,12 @@ // const path& path1() const noexcept; // const path& path2() const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; void test_constructors() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp b/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp index 12330ebb5ca8c..b7a0383e0472e 100644 --- a/test/std/experimental/filesystem/class.path/path.itr/iterator.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -19,7 +19,7 @@ // path(InputIterator first, InputIterator last); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <iterator> #include <type_traits> #include <cassert> @@ -27,7 +27,6 @@ #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; template <class It> @@ -84,14 +83,14 @@ void checkBeginEndBasic() { } { path p("//root_name//first_dir////second_dir"); - const path expect[] = {"//root_name", "/", "first_dir", "second_dir"}; + const path expect[] = {"/", "root_name", "first_dir", "second_dir"}; assert(checkCollectionsEqual(p.begin(), p.end(), std::begin(expect), std::end(expect))); assert(checkCollectionsEqualBackwards(p.begin(), p.end(), std::begin(expect), std::end(expect))); } { path p("////foo/bar/baz///"); - const path expect[] = {"/", "foo", "bar", "baz", "."}; + const path expect[] = {"/", "foo", "bar", "baz", ""}; assert(checkCollectionsEqual(p.begin(), p.end(), std::begin(expect), std::end(expect))); assert(checkCollectionsEqualBackwards(p.begin(), p.end(), std::begin(expect), std::end(expect))); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp index a6172d1981cf6..a02ef18c453d6 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.append.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -22,7 +22,7 @@ // path& append(InputIterator first, InputIterator last); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <string_view> #include <cassert> @@ -31,8 +31,8 @@ #include "test_iterators.h" #include "count_new.hpp" #include "filesystem_test_helper.hpp" +#include "verbose_assert.h" -namespace fs = std::experimental::filesystem; struct AppendOperatorTestcase { MultiStringType lhs; @@ -46,13 +46,22 @@ const AppendOperatorTestcase Cases[] = {S(""), S(""), S("")} , {S("p1"), S("p2"), S("p1/p2")} , {S("p1/"), S("p2"), S("p1/p2")} - , {S("p1"), S("/p2"), S("p1/p2")} - , {S("p1/"), S("/p2"), S("p1//p2")} + , {S("p1"), S("/p2"), S("/p2")} + , {S("p1/"), S("/p2"), S("/p2")} , {S("p1"), S("\\p2"), S("p1/\\p2")} , {S("p1\\"), S("p2"), S("p1\\/p2")} , {S("p1\\"), S("\\p2"), S("p1\\/\\p2")} - , {S("p1"), S(""), S("p1")} , {S(""), S("p2"), S("p2")} + , {S("/p1"), S("p2"), S("/p1/p2")} + , {S("/p1"), S("/p2"), S("/p2")} + , {S("/p1/p3"), S("p2"), S("/p1/p3/p2")} + , {S("/p1/p3/"), S("p2"), S("/p1/p3/p2")} + , {S("/p1/"), S("p2"), S("/p1/p2")} + , {S("/p1/p3/"), S("/p2/p4"), S("/p2/p4")} + , {S("/"), S(""), S("/")} + , {S("/p1"), S("/p2/"), S("/p2/")} + , {S("p1"), S(""), S("p1/")} + , {S("p1/"), S(""), S("p1/")} }; @@ -60,7 +69,8 @@ const AppendOperatorTestcase LongLHSCases[] = { {S("p1"), S("p2"), S("p1/p2")} , {S("p1/"), S("p2"), S("p1/p2")} - , {S("p1"), S("/p2"), S("p1/p2")} + , {S("p1"), S("/p2"), S("/p2")} + , {S("/p1"), S("p2"), S("/p1/p2")} }; #undef S @@ -99,7 +109,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) DisableAllocationGuard g; LHS /= RHS; } - assert(LHS == E); + ASSERT_PRED(PathEq, LHS , E); } // basic_string_view { @@ -109,7 +119,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) DisableAllocationGuard g; LHS /= RHS; } - assert(LHS == E); + assert(PathEq(LHS, E)); } // CharT* { @@ -119,7 +129,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) DisableAllocationGuard g; LHS /= RHS; } - assert(LHS == E); + assert(PathEq(LHS, E)); } { path LHS(L); PathReserve(LHS, ReserveSize); @@ -128,7 +138,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) DisableAllocationGuard g; LHS.append(RHS, StrEnd(RHS)); } - assert(LHS == E); + assert(PathEq(LHS, E)); } // input iterator - For non-native char types, appends needs to copy the // iterator range into a contiguous block of memory before it can perform the @@ -144,7 +154,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) if (DisableAllocations) g.requireExactly(0); LHS /= RHS; } - assert(LHS == E); + assert(PathEq(LHS, E)); } { path LHS(L); PathReserve(LHS, ReserveSize); @@ -155,7 +165,7 @@ void doAppendSourceAllocTest(AppendOperatorTestcase const& TC) if (DisableAllocations) g.requireExactly(0); LHS.append(RHS, REnd); } - assert(LHS == E); + assert(PathEq(LHS, E)); } } @@ -172,17 +182,18 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) const Ptr E = TC.expect; // basic_string { - path LHS(L); + path Result(L); Str RHS(R); - path& Ref = (LHS /= RHS); - assert(LHS == E); - assert(&Ref == &LHS); + path& Ref = (Result /= RHS); + ASSERT_EQ(Result, E) + << DISPLAY(L) << DISPLAY(R); + assert(&Ref == &Result); } { path LHS(L); Str RHS(R); path& Ref = LHS.append(RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } // basic_string_view @@ -190,14 +201,14 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) path LHS(L); StrView RHS(R); path& Ref = (LHS /= RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } { path LHS(L); StrView RHS(R); path& Ref = LHS.append(RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } // Char* @@ -205,21 +216,22 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) path LHS(L); Str RHS(R); path& Ref = (LHS /= RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } { path LHS(L); Ptr RHS(R); path& Ref = LHS.append(RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } { path LHS(L); Ptr RHS(R); path& Ref = LHS.append(RHS, StrEnd(RHS)); - assert(LHS == E); + ASSERT_PRED(PathEq, LHS, E) + << DISPLAY(L) << DISPLAY(R); assert(&Ref == &LHS); } // iterators @@ -227,13 +239,13 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) path LHS(L); InputIter RHS(R); path& Ref = (LHS /= RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } { path LHS(L); InputIter RHS(R); path& Ref = LHS.append(RHS); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } { @@ -241,7 +253,7 @@ void doAppendSourceTest(AppendOperatorTestcase const& TC) InputIter RHS(R); InputIter REnd(StrEnd(R)); path& Ref = LHS.append(RHS, REnd); - assert(LHS == E); + assert(PathEq(LHS, E)); assert(&Ref == &LHS); } } @@ -305,11 +317,14 @@ int main() using namespace fs; for (auto const & TC : Cases) { { - path LHS((const char*)TC.lhs); - path RHS((const char*)TC.rhs); - path& Ref = (LHS /= RHS); - assert(LHS == (const char*)TC.expect); - assert(&Ref == &LHS); + const char* LHS_In = TC.lhs; + const char* RHS_In = TC.rhs; + path LHS(LHS_In); + path RHS(RHS_In); + path& Res = (LHS /= RHS); + ASSERT_PRED(PathEq, Res, (const char*)TC.expect) + << DISPLAY(LHS_In) << DISPLAY(RHS_In); + assert(&Res == &LHS); } doAppendSourceTest<char> (TC); doAppendSourceTest<wchar_t> (TC); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp index c5da52f652483..fe677c3e6540e 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.assign/braced_init.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& operator=(path const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "count_new.hpp" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp index 5c26f8464c121..a0575e649d610 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.assign/copy.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& operator=(path const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp index 7263424ad252f..71fa47d1b9de6 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.assign/move.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& operator=(path&&) noexcept -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "count_new.hpp" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp index 8c31ef51d9448..92eff6e078a02 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.assign/source.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -22,7 +22,7 @@ // path& assign(InputIterator first, InputIterator last); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <string_view> #include <cassert> @@ -33,7 +33,6 @@ #include "filesystem_test_helper.hpp" #include <iostream> -namespace fs = std::experimental::filesystem; template <class CharT> void RunTestCase(MultiStringType const& MS) { diff --git a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp index 69d08e6eb49a5..7791097dcd178 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.compare.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -26,7 +26,8 @@ // // size_t hash_value(path const&) noexcept; -#include <experimental/filesystem> + +#include "filesystem_include.hpp" #include <type_traits> #include <vector> #include <cassert> @@ -35,8 +36,7 @@ #include "test_iterators.h" #include "count_new.hpp" #include "filesystem_test_helper.hpp" - -namespace fs = std::experimental::filesystem; +#include "verbose_assert.h" struct PathCompareTest { const char* LHS; @@ -58,8 +58,9 @@ const PathCompareTest CompareTestCases[] = {"a/b/c", "b/a/c", -1}, {"a/b", "a/b/c", -1}, {"a/b/c", "a/b", 1}, - {"a/b/", "a/b/.", 0}, - {"a/b//////", "a/b/////.", 0}, + {"a/b/", "a/b/.", -1}, + {"a/b/", "a/b", 1}, + {"a/b//////", "a/b/////.", -1}, {"a/.././b", "a///..//.////b", 0}, {"//foo//bar///baz////", "//foo/bar/baz/", 0}, // duplicate separators {"///foo/bar", "/foo/bar", 0}, // "///" is not a root directory @@ -95,8 +96,13 @@ int main() int ret2 = normalize_ret(p1.compare(R)); int ret3 = normalize_ret(p1.compare(TC.RHS)); int ret4 = normalize_ret(p1.compare(RV)); - assert(ret1 == ret2 && ret1 == ret3 && ret1 == ret4); - assert(ret1 == E); + + g.release(); + ASSERT_EQ(ret1, ret2); + ASSERT_EQ(ret1, ret3); + ASSERT_EQ(ret1, ret4); + ASSERT_EQ(ret1, E) + << DISPLAY(TC.LHS) << DISPLAY(TC.RHS); // check signatures ASSERT_NOEXCEPT(p1.compare(p2)); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp index 76df0e9eef76a..03d5134fe0909 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.concat.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -28,7 +28,7 @@ // path& concat(InputIterator first, InputIterator last); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <string> #include <string_view> @@ -39,7 +39,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; struct ConcatOperatorTestcase { MultiStringType lhs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp index 67b8a04049ecc..69bdb74159fd3 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.construct/copy.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path(path const&) -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp index f26504616d50b..aa4b03e9bc3fb 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.construct/default.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/default.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path() noexcept -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp index b8ac4b307005a..2e8cce22880aa 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.construct/move.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path(path&&) noexcept -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "count_new.hpp" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp index a04f35af57808..39d63f456e959 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -19,7 +19,7 @@ // path(InputIterator first, InputIterator last); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -28,10 +28,9 @@ #include "min_allocator.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; -template <class CharT> -void RunTestCase(MultiStringType const& MS) { +template <class CharT, class ...Args> +void RunTestCaseImpl(MultiStringType const& MS, Args... args) { using namespace fs; const char* Expect = MS; const CharT* TestPath = MS; @@ -42,44 +41,52 @@ void RunTestCase(MultiStringType const& MS) { // StringTypes { const std::basic_string<CharT> S(TestPath); - path p(S); + path p(S, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); assert(p.string<CharT>() == S); } { const std::basic_string_view<CharT> S(TestPath); - path p(S); + path p(S, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); assert(p.string<CharT>() == S); } // Char* pointers { - path p(TestPath); + path p(TestPath, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); } { - path p(TestPath, TestPathEnd); + path p(TestPath, TestPathEnd, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); } // Iterators { using It = input_iterator<const CharT*>; - path p(It{TestPath}); + path p(It{TestPath}, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); } { using It = input_iterator<const CharT*>; - path p(It{TestPath}, It{TestPathEnd}); + path p(It{TestPath}, It{TestPathEnd}, args...); assert(p.native() == Expect); assert(p.string<CharT>() == TestPath); } } +template <class CharT, class ...Args> +void RunTestCase(MultiStringType const& MS) { + RunTestCaseImpl<CharT>(MS); + RunTestCaseImpl<CharT>(MS, fs::path::format::auto_format); + RunTestCaseImpl<CharT>(MS, fs::path::format::native_format); + RunTestCaseImpl<CharT>(MS, fs::path::format::generic_format); +} + void test_sfinae() { using namespace fs; { diff --git a/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp b/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp index 7e1fea7d34d26..1a722d7a2a0c7 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp @@ -8,7 +8,7 @@ // //===----------------------------------------------------------------------===// -// <experimental/filesystem> +// <filesystem> // class path @@ -17,12 +17,12 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 // UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" int main () { - std::experimental::filesystem::path c; + fs::path c; c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} } diff --git a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp index 267d4932c316b..4eb15cd0bf265 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -44,7 +44,7 @@ // iterator end() const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <vector> #include <cassert> @@ -53,8 +53,15 @@ #include "test_iterators.h" #include "count_new.hpp" #include "filesystem_test_helper.hpp" +#include "assert_checkpoint.h" +#include "verbose_assert.h" + +struct ComparePathExact { + bool operator()(std::string const& LHS, std::string const& RHS) const { + return LHS == RHS; + } +}; -namespace fs = std::experimental::filesystem; struct PathDecomposeTestcase { std::string raw; @@ -73,80 +80,89 @@ const PathDecomposeTestcase PathTestCases[] = , {".", {"."}, "", "", "", ".", "", "."} , {"..", {".."}, "", "", "", "..", "", ".."} , {"foo", {"foo"}, "", "", "", "foo", "", "foo"} - , {"/", {"/"}, "/", "", "/", "", "", "/"} + , {"/", {"/"}, "/", "", "/", "", "/", ""} , {"/foo", {"/", "foo"}, "/", "", "/", "foo", "/", "foo"} - , {"foo/", {"foo", "."}, "", "", "", "foo/", "foo", "."} - , {"/foo/", {"/", "foo", "."}, "/", "", "/", "foo/", "/foo", "."} + , {"foo/", {"foo", ""}, "", "", "", "foo/", "foo", ""} + , {"/foo/", {"/", "foo", ""}, "/", "", "/", "foo/", "/foo", ""} , {"foo/bar", {"foo","bar"}, "", "", "", "foo/bar", "foo", "bar"} , {"/foo//bar", {"/","foo","bar"}, "/", "", "/", "foo/bar", "/foo", "bar"} - , {"//net", {"//net"}, "//net", "//net", "", "", "", "//net"} - , {"//net/foo", {"//net", "/", "foo"}, "//net/", "//net", "/", "foo", "//net/", "foo"} - , {"///foo///", {"/", "foo", "."}, "/", "", "/", "foo///", "///foo", "."} + , {"//net", {"/", "net"}, "/", "", "/", "net", "/", "net"} + , {"//net/foo", {"/", "net", "foo"}, "/", "", "/", "net/foo", "/net", "foo"} + , {"///foo///", {"/", "foo", ""}, "/", "", "/", "foo///", "///foo", ""} , {"///foo///bar", {"/", "foo", "bar"}, "/", "", "/", "foo///bar", "///foo", "bar"} , {"/.", {"/", "."}, "/", "", "/", ".", "/", "."} - , {"./", {".", "."}, "", "", "", "./", ".", "."} + , {"./", {".", ""}, "", "", "", "./", ".", ""} , {"/..", {"/", ".."}, "/", "", "/", "..", "/", ".."} - , {"../", {"..", "."}, "", "", "", "../", "..", "."} + , {"../", {"..", ""}, "", "", "", "../", "..", ""} , {"foo/.", {"foo", "."}, "", "", "", "foo/.", "foo", "."} , {"foo/..", {"foo", ".."}, "", "", "", "foo/..", "foo", ".."} - , {"foo/./", {"foo", ".", "."}, "", "", "", "foo/./", "foo/.", "."} + , {"foo/./", {"foo", ".", ""}, "", "", "", "foo/./", "foo/.", ""} , {"foo/./bar", {"foo", ".", "bar"}, "", "", "", "foo/./bar", "foo/.", "bar"} - , {"foo/../", {"foo", "..", "."}, "", "", "", "foo/../", "foo/..", "."} + , {"foo/../", {"foo", "..", ""}, "", "", "", "foo/../", "foo/..", ""} , {"foo/../bar", {"foo", "..", "bar"}, "", "", "", "foo/../bar", "foo/..", "bar"} , {"c:", {"c:"}, "", "", "", "c:", "", "c:"} - , {"c:/", {"c:", "."}, "", "", "", "c:/", "c:", "."} + , {"c:/", {"c:", ""}, "", "", "", "c:/", "c:", ""} , {"c:foo", {"c:foo"}, "", "", "", "c:foo", "", "c:foo"} , {"c:/foo", {"c:", "foo"}, "", "", "", "c:/foo", "c:", "foo"} - , {"c:foo/", {"c:foo", "."}, "", "", "", "c:foo/", "c:foo", "."} - , {"c:/foo/", {"c:", "foo", "."}, "", "", "", "c:/foo/", "c:/foo", "."} + , {"c:foo/", {"c:foo", ""}, "", "", "", "c:foo/", "c:foo", ""} + , {"c:/foo/", {"c:", "foo", ""}, "", "", "", "c:/foo/", "c:/foo", ""} , {"c:/foo/bar", {"c:", "foo", "bar"}, "", "", "", "c:/foo/bar", "c:/foo", "bar"} , {"prn:", {"prn:"}, "", "", "", "prn:", "", "prn:"} , {"c:\\", {"c:\\"}, "", "", "", "c:\\", "", "c:\\"} , {"c:\\foo", {"c:\\foo"}, "", "", "", "c:\\foo", "", "c:\\foo"} , {"c:foo\\", {"c:foo\\"}, "", "", "", "c:foo\\", "", "c:foo\\"} , {"c:\\foo\\", {"c:\\foo\\"}, "", "", "", "c:\\foo\\", "", "c:\\foo\\"} - , {"c:\\foo/", {"c:\\foo", "."}, "", "", "", "c:\\foo/", "c:\\foo", "."} + , {"c:\\foo/", {"c:\\foo", ""}, "", "", "", "c:\\foo/", "c:\\foo", ""} , {"c:/foo\\bar", {"c:", "foo\\bar"}, "", "", "", "c:/foo\\bar", "c:", "foo\\bar"} - , {"//", {"//"}, "//", "//", "", "", "", "//"} + , {"//", {"/"}, "/", "", "/", "", "/", ""} }; void decompPathTest() { using namespace fs; for (auto const & TC : PathTestCases) { - path p(TC.raw); - assert(p == TC.raw); + CHECKPOINT(TC.raw.c_str()); + fs::path p(TC.raw); + ASSERT(p == TC.raw); - assert(p.root_path() == TC.root_path); - assert(p.has_root_path() != TC.root_path.empty()); + ASSERT_EQ(p.root_path(), TC.root_path); + ASSERT_NEQ(p.has_root_path(), TC.root_path.empty()); - assert(p.root_name() == TC.root_name); - assert(p.has_root_name() != TC.root_name.empty()); + ASSERT(p.root_name().native().empty()) + << DISPLAY(p.root_name()); + ASSERT_EQ(p.root_name(),TC.root_name); + ASSERT_NEQ(p.has_root_name(), TC.root_name.empty()); - assert(p.root_directory() == TC.root_directory); - assert(p.has_root_directory() != TC.root_directory.empty()); + ASSERT_EQ(p.root_directory(), TC.root_directory); + ASSERT_NEQ(p.has_root_directory(), TC.root_directory.empty()); - assert(p.relative_path() == TC.relative_path); - assert(p.has_relative_path() != TC.relative_path.empty()); + ASSERT_EQ(p.relative_path(), TC.relative_path); + ASSERT_NEQ(p.has_relative_path(), TC.relative_path.empty()); - assert(p.parent_path() == TC.parent_path); - assert(p.has_parent_path() != TC.parent_path.empty()); + ASSERT_EQ(p.parent_path(), TC.parent_path); + ASSERT_NEQ(p.has_parent_path(), TC.parent_path.empty()); - assert(p.filename() == TC.filename); - assert(p.has_filename() != TC.filename.empty()); + ASSERT_EQ(p.filename(), TC.filename); + ASSERT_NEQ(p.has_filename(), TC.filename.empty()); - assert(p.is_absolute() == p.has_root_directory()); - assert(p.is_relative() != p.is_absolute()); + ASSERT_EQ(p.is_absolute(), p.has_root_directory()); + ASSERT_NEQ(p.is_relative(), p.is_absolute()); + if (p.empty()) + ASSERT(p.is_relative()); - assert(checkCollectionsEqual(p.begin(), p.end(), - TC.elements.begin(), TC.elements.end())); + ASSERT_COLLECTION_EQ_COMP( + p.begin(), p.end(), + TC.elements.begin(), TC.elements.end(), + ComparePathExact() + ); // check backwards std::vector<fs::path> Parts; for (auto it = p.end(); it != p.begin(); ) Parts.push_back(*--it); - assert(checkCollectionsEqual(Parts.begin(), Parts.end(), - TC.elements.rbegin(), TC.elements.rend())); + ASSERT_COLLECTION_EQ_COMP(Parts.begin(), Parts.end(), + TC.elements.rbegin(), TC.elements.rend(), + ComparePathExact()); } } @@ -164,10 +180,12 @@ const FilenameDecompTestcase FilenameTestCases[] = {"", "", "", ""} , {".", ".", ".", ""} , {"..", "..", "..", ""} - , {"/", "/", "/", ""} + , {"/", "", "", ""} , {"foo", "foo", "foo", ""} , {"/foo/bar.txt", "bar.txt", "bar", ".txt"} , {"foo..txt", "foo..txt", "foo.", ".txt"} + , {".profile", ".profile", ".profile", ""} + , {".profile.txt", ".profile.txt", ".profile", ".txt"} }; @@ -175,18 +193,19 @@ void decompFilenameTest() { using namespace fs; for (auto const & TC : FilenameTestCases) { - path p(TC.raw); - assert(p == TC.raw); + CHECKPOINT(TC.raw.c_str()); + fs::path p(TC.raw); + ASSERT_EQ(p, TC.raw); ASSERT_NOEXCEPT(p.empty()); - assert(p.filename() == TC.filename); - assert(p.has_filename() != TC.filename.empty()); + ASSERT_EQ(p.filename(), TC.filename); + ASSERT_NEQ(p.has_filename(), TC.filename.empty()); - assert(p.stem() == TC.stem); - assert(p.has_stem() != TC.stem.empty()); + ASSERT_EQ(p.stem(), TC.stem); + ASSERT_NEQ(p.has_stem(), TC.stem.empty()); - assert(p.extension() == TC.extension); - assert(p.has_extension() != TC.extension.empty()); + ASSERT_EQ(p.extension(), TC.extension); + ASSERT_NEQ(p.has_extension(), TC.extension.empty()); } } diff --git a/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp new file mode 100644 index 0000000000000..3e2fdd08de152 --- /dev/null +++ b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp @@ -0,0 +1,142 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class path + +// path lexically_normal() const; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <vector> +#include <iostream> +#include <cassert> + +#include "test_macros.h" +#include "test_iterators.h" +#include "count_new.hpp" +#include "filesystem_test_helper.hpp" + + +int main() { + // clang-format off + struct { + std::string input; + std::string expect; + } TestCases[] = { + {"", ""}, + {"/a/b/c", "/a/b/c"}, + {"/a/b//c", "/a/b/c"}, + {"foo/./bar/..", "foo/"}, + {"foo/.///bar/../", "foo/"}, + {"/a/b/", "/a/b/"}, + {"a/b", "a/b"}, + {"a/b/.", "a/b/"}, + {"a/b/./", "a/b/"}, + {"a/..", "."}, + {".", "."}, + {"./", "."}, + {"./.", "."}, + {"./..", ".."}, + {"..", ".."}, + {"../..", "../.."}, + {"/../", "/"}, + {"/../..", "/"}, + {"/../../", "/"}, + {"..", ".."}, + {"../", ".."}, + {"/a/b/c/../", "/a/b/"}, + {"/a/b/./", "/a/b/"}, + {"/a/b/c/../d", "/a/b/d"}, + {"/a/b/c/../d/", "/a/b/d/"}, + {"//a/", "/a/"}, + {"//a/b/", "/a/b/"}, + {"//a/b/.", "/a/b/"}, + {"//a/..", "/"}, + ///===---------------------------------------------------------------===// + /// Tests specifically for the clauses under [fs.path.generic]p6 + ///===---------------------------------------------------------------===// + // p1: If the path is empty, stop. + {"", ""}, + // p2: Replace each slash character in the root-name with a preferred + // separator. + {"NO_ROOT_NAME_ON_LINUX", "NO_ROOT_NAME_ON_LINUX"}, + // p3: Replace each directory-separator with a preferred-separator. + // [ Note: The generic pathname grammar ([fs.path.generic]) defines + // directory-separator as one or more slashes and preferred-separators. + // — end note ] + {"/", "/"}, + {"//", "/"}, + {"///", "/"}, + {"a/b", "a/b"}, + {"a//b", "a/b"}, + {"a///b", "a/b"}, + {"a/b/", "a/b/"}, + {"a/b//", "a/b/"}, + {"a/b///", "a/b/"}, + {"///a////b//////", "/a/b/"}, + // p4: Remove each dot filename and any immediately following directory + // separators + {"foo/.", "foo/"}, + {"foo/./bar/.", "foo/bar/"}, + {"./foo/././bar/./", "foo/bar/"}, + {".///foo//.////./bar/.///", "foo/bar/"}, + // p5: As long as any appear, remove a non-dot-dot filename immediately + // followed by a directory-separator and a dot-dot filename, along with + // any immediately following directory separator. + {"foo/..", "."}, + {"foo/../", "."}, + {"foo/bar/..", "foo/"}, + {"foo/bar/../", "foo/"}, + {"foo/bar/../..", "."}, + {"foo/bar/../../", "."}, + {"foo/bar/baz/../..", "foo/"}, + {"foo/bar/baz/../../", "foo/"}, + {"foo/bar/./..", "foo/"}, + {"foo/bar/./../", "foo/"}, + // p6: If there is a root-directory, remove all dot-dot filenames and any + // directory-separators immediately following them. [ Note: These dot-dot + // filenames attempt to refer to nonexistent parent directories. — end note ] + {"/..", "/"}, + {"/../", "/"}, + {"/foo/../..", "/"}, + {"/../foo", "/foo"}, + {"/../foo/../..", "/"}, + // p7: If the last filename is dot-dot, remove any trailing + // directory-separator. + {"../", ".."}, + {"../../", "../.."}, + {"foo/../bar/../..///", ".."}, + {"foo/../bar/..//..///../", "../.."}, + // p8: If the path is empty, add a dot + {".", "."}, + {"./", "."}, + {"foo/..", "."} + }; + // clang-format on + int ID = 0; + bool Failed = false; + for (auto& TC : TestCases) { + ++ID; + fs::path p(TC.input); + const fs::path output = p.lexically_normal(); + if (!PathEq(output, TC.expect)) { + Failed = true; + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Expected: '" << TC.expect << "'\n"; + std::cerr << " Output: '" << output.native() << "'"; + std::cerr << std::endl; + } + } + return Failed; +} diff --git a/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp new file mode 100644 index 0000000000000..52c577bc8a71c --- /dev/null +++ b/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class path + +// path lexically_relative(const path& p) const; +// path lexically_proximate(const path& p) const; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <vector> +#include <iostream> +#include <cassert> + +#include "test_macros.h" +#include "test_iterators.h" +#include "count_new.hpp" +#include "filesystem_test_helper.hpp" + + +int main() { + // clang-format off + struct { + std::string input; + std::string base; + std::string expect; + } TestCases[] = { + {"", "", "."}, + {"/", "a", ""}, + {"a", "/", ""}, + {"//net", "a", ""}, + {"a", "//net", ""}, + {"//net/", "//net", ""}, + {"//net", "//net/", ".."}, + {"//base", "a", ""}, + {"a", "a", "."}, + {"a/b", "a/b", "."}, + {"a/b/c/", "a/b/c/", "."}, + {"//net", "//net", "."}, + {"//net/", "//net/", "."}, + {"//net/a/b", "//net/a/b", "."}, + {"/a/d", "/a/b/c", "../../d"}, + {"/a/b/c", "/a/d", "../b/c"}, + {"a/b/c", "a", "b/c"}, + {"a/b/c", "a/b/c/x/y", "../.."}, + {"a/b/c", "a/b/c", "."}, + {"a/b", "c/d", "../../a/b"} + }; + // clang-format on + int ID = 0; + bool Failed = false; + for (auto& TC : TestCases) { + ++ID; + const fs::path p(TC.input); + const fs::path output = p.lexically_relative(TC.base); + auto ReportErr = [&](const char* Testing, fs::path const& Output, + fs::path const& Expected) { + Failed = true; + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Testing: " << Testing << "\n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Base: '" << TC.base << "'\n"; + std::cerr << " Expected: '" << Expected << "'\n"; + std::cerr << " Output: '" << Output.native() << "'"; + std::cerr << std::endl; + }; + if (!PathEq(output, TC.expect)) + ReportErr("path::lexically_relative", output, TC.expect); + const fs::path proximate_output = p.lexically_proximate(TC.base); + // [path.gen] lexically_proximate + // Returns: If the value of lexically_relative(base) is not an empty path, + // return it.Otherwise return *this. + const fs::path proximate_expected = output.native().empty() ? p + : output; + if (!PathEq(proximate_expected, proximate_output)) + ReportErr("path::lexically_proximate", proximate_output, proximate_expected); + } + return Failed; +} diff --git a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp index 47e94c9a213f6..93c49a6ab61f1 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -18,7 +18,7 @@ // basic_string<ECharT, Traits, Allocator> // generic_string(const Allocator& a = Allocator()) const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -28,8 +28,6 @@ #include "min_allocator.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; - MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp index 81d06843640db..d41ab619a893d 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.generic.obs/named_overloads.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -20,7 +20,7 @@ // std::u32string generic_u32string() const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -30,8 +30,6 @@ #include "min_allocator.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; - MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); int main() diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp index 7881c9700d6e3..fca642647b85f 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/clear.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/clear.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // void clear() noexcept -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -24,7 +24,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp index 559538cf0ec42..ec914b1bc485d 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/make_preferred.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/make_preferred.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& make_preferred() -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -24,7 +24,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; struct MakePreferredTestcase { const char* value; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp index e414202bf8ff2..b4019e7f2289a 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/remove_filename.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& remove_filename() -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,8 +23,7 @@ #include "test_iterators.h" #include "count_new.hpp" #include "filesystem_test_helper.hpp" - -namespace fs = std::experimental::filesystem; +#include "verbose_assert.h" struct RemoveFilenameTestcase { const char* value; @@ -34,27 +33,29 @@ struct RemoveFilenameTestcase { const RemoveFilenameTestcase TestCases[] = { {"", ""} - , {"/", ""} - , {"//", ""} - , {"///", ""} + , {"/", "/"} + , {"//", "//"} + , {"///", "///"} , {"\\", ""} , {".", ""} , {"..", ""} , {"/foo", "/"} - , {"//foo", ""} - , {"//foo/", ""} - , {"//foo///", ""} - , {"///foo", "/"} - , {"///foo/", "///foo"} - , {"/foo/", "/foo"} - , {"/foo/.", "/foo"} - , {"/foo/..", "/foo"} - , {"/foo/////", "/foo"} + , {"foo/bar", "foo/"} + , {"foo/", "foo/"} + , {"//foo", "//"} + , {"//foo/", "//foo/"} + , {"//foo///", "//foo///"} + , {"///foo", "///"} + , {"///foo/", "///foo/"} + , {"/foo/", "/foo/"} + , {"/foo/.", "/foo/"} + , {"/foo/..", "/foo/"} + , {"/foo/////", "/foo/////"} , {"/foo\\\\", "/"} - , {"/foo//\\/", "/foo//\\"} - , {"///foo", "/"} + , {"/foo//\\/", "/foo//\\/"} + , {"///foo", "///"} , {"file.txt", ""} - , {"bar/../baz/./file.txt", "bar/../baz/."} + , {"bar/../baz/./file.txt", "bar/../baz/./"} }; int main() @@ -65,16 +66,8 @@ int main() path p(p_orig); assert(p == TC.value); path& Ref = (p.remove_filename()); - assert(p == TC.expect); + ASSERT_EQ(p, TC.expect) << DISPLAY(p_orig); assert(&Ref == &p); - { - const path parentp = p_orig.parent_path(); - if (parentp == p_orig.root_name()) { - - assert(p.empty()); - } else { - assert(p == parentp); - } - } + assert(!p.has_filename()); } } diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp index 98f6e9b88ab8c..c118b87142a75 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_extension.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_extension.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& replace_extension(path const& p = path()) -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -24,7 +24,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; struct ReplaceExtensionTestcase { const char* value; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp index 66c97218c8331..07cd327728fd3 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/replace_filename.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // path& replace_filename() -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,8 +23,8 @@ #include "test_iterators.h" #include "count_new.hpp" #include "filesystem_test_helper.hpp" - -namespace fs = std::experimental::filesystem; +#include "assert_checkpoint.h" +#include "verbose_assert.h" struct ReplaceFilenameTestcase { const char* value; @@ -37,9 +37,9 @@ const ReplaceFilenameTestcase TestCases[] = {"/foo", "/bar", "bar"} , {"/foo", "/", ""} , {"foo", "bar", "bar"} - , {"/", "bar", "bar"} + , {"/", "/bar", "bar"} , {"\\", "bar", "bar"} - , {"///", "bar", "bar"} + , {"///", "///bar", "bar"} , {"\\\\", "bar", "bar"} , {"\\/\\", "\\/bar", "bar"} , {".", "bar", "bar"} @@ -53,9 +53,11 @@ int main() using namespace fs; for (auto const & TC : TestCases) { path p(TC.value); - assert(p == TC.value); + ASSERT_EQ(p, TC.value); path& Ref = (p.replace_filename(TC.filename)); - assert(p == TC.expect); + ASSERT_EQ(p, TC.expect) + << DISPLAY(TC.value) + << DISPLAY(TC.filename); assert(&Ref == &p); // Tests Effects "as-if": remove_filename() append(filename) { @@ -63,7 +65,7 @@ int main() path replace(TC.filename); p2.remove_filename(); p2 /= replace; - assert(p2 == p); + ASSERT_EQ(p, p2); } } } diff --git a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp index 04bbe3751a59f..eecfe4252517d 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.modifiers/swap.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.modifiers/swap.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // void swap(path& rhs) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -24,7 +24,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; struct SwapTestcase { const char* value1; diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp index 7966094327279..e035764d2c222 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/c_str.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp @@ -10,20 +10,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // const value_type* c_str() const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; int main() { diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp index 2a83fef9f9e64..bb0f58cab7594 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/named_overloads.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -20,7 +20,7 @@ // std::u32string u32string() const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -30,7 +30,6 @@ #include "min_allocator.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp index db1326483776b..ca02b8680b040 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/native.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // const string_type& native() const noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; int main() { diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp index 013d26cdb7f6c..4f5f77df4035a 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/operator_string.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp @@ -10,20 +10,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path // operator string_type() const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; int main() { diff --git a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp index e983297350001..744ad4df8171d 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.native.obs/string_alloc.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -18,7 +18,7 @@ // basic_string<ECharT, Traits, Allocator> // string(const Allocator& a = Allocator()) const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -28,7 +28,6 @@ #include "min_allocator.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; // the SSO is always triggered for strings of size 2. MultiStringType shortString = MKSTR("a"); diff --git a/test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp b/test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp index 9cf37d4cd537a..be662fcb16c03 100644 --- a/test/std/experimental/filesystem/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.member/path.query/tested_in_path_decompose.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp index 58983778446a9..09498bf2135ac 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/append_op.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/append_op.pass.cpp @@ -9,18 +9,17 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // path operator/(path const&, path const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; // This is mainly tested via the member append functions. int main() diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp index 28867432c61de..28867432c61de 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/comparison_ops_tested_elsewhere.pass.cpp diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp index b03b8008b6220..b03b8008b6220 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/hash_value_tested_elswhere.pass.cpp diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp index 4853994b49500..96b8286d5e1bc 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/path.factory.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // template <class Source> // path u8path(Source const&); // template <class InputIter> // path u8path(InputIter, InputIter); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -25,7 +25,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; int main() { diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp index 4b7ad735c7f81..7902289edd8db 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -22,10 +22,11 @@ // operator>>(basic_istream<charT, traits>& is, path& p) // -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <sstream> #include <cassert> +#include <iostream> #include "test_macros.h" #include "test_iterators.h" @@ -35,6 +36,8 @@ MultiStringType InStr = MKSTR("abcdefg/\"hijklmnop\"/qrstuvwxyz/123456789"); MultiStringType OutStr = MKSTR("\"abcdefg/\\\"hijklmnop\\\"/qrstuvwxyz/123456789\""); + + template <class CharT> void doIOTest() { using namespace fs; @@ -56,10 +59,40 @@ void doIOTest() { } } +namespace impl { +using namespace fs; + +template <class Stream, class Tp, class = decltype(std::declval<Stream&>() << std::declval<Tp&>())> +std::true_type is_ostreamable_imp(int); + +template <class Stream, class Tp> +std::false_type is_ostreamable_imp(long); + +template <class Stream, class Tp, class = decltype(std::declval<Stream&>() >> std::declval<Tp&>())> +std::true_type is_istreamable_imp(int); + +template <class Stream, class Tp> +std::false_type is_istreamable_imp(long); + + +} // namespace impl + +template <class Stream, class Tp> +struct is_ostreamable : decltype(impl::is_ostreamable_imp<Stream, Tp>(0)) {}; +template <class Stream, class Tp> +struct is_istreamable : decltype(impl::is_istreamable_imp<Stream, Tp>(0)) {}; + +void test_LWG2989() { + static_assert(!is_ostreamable<decltype(std::cout), std::wstring>::value, ""); + static_assert(!is_ostreamable<decltype(std::wcout), std::string>::value, ""); + static_assert(!is_istreamable<decltype(std::cin), std::wstring>::value, ""); + static_assert(!is_istreamable<decltype(std::wcin), std::string>::value, ""); +} int main() { doIOTest<char>(); doIOTest<wchar_t>(); //doIOTest<char16_t>(); //doIOTest<char32_t>(); + test_LWG2989(); } diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp index 3a9b48b2669a7..65be19fdc4cce 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/path.io.unicode_bug.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/path.io.unicode_bug.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -27,7 +27,7 @@ // passes. // XFAIL: * -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <sstream> #include <cassert> diff --git a/test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp b/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp index 8d180463a5776..554b5129cc951 100644 --- a/test/std/experimental/filesystem/class.path/path.nonmember/swap.pass.cpp +++ b/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp @@ -9,11 +9,11 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void swap(path& lhs, path& rhs) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -21,7 +21,6 @@ #include "count_new.hpp" #include "filesystem_test_helper.hpp" -namespace fs = std::experimental::filesystem; // NOTE: this is tested in path.members/path.modifiers via the member swap. int main() diff --git a/test/std/experimental/filesystem/class.path/synop.pass.cpp b/test/std/input.output/filesystems/class.path/synop.pass.cpp index 883feb287d06c..875f92fb68a2b 100644 --- a/test/std/experimental/filesystem/class.path/synop.pass.cpp +++ b/test/std/input.output/filesystems/class.path/synop.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class path @@ -17,13 +17,12 @@ // typedef basic_string<value_type> string_type; // static constexpr value_type preferred_separator = ...; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; int main() { using namespace fs; diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp index 4dbd599e543a3..40ce491b718db 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_recursive_directory_iterator(recursive_recursive_directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_copy_construct_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp index 3e9257eac8fa1..00c8c35fc0bf4 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_directory_iterator& operator=(recursive_directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_copy_assign_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp index 1469dae049eb8..e02d6679c0eb9 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class directory_iterator @@ -20,7 +20,7 @@ // recursive_directory_iterator(const path& p, directory_options options, error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -29,7 +29,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; using RDI = recursive_directory_iterator; @@ -87,7 +87,7 @@ TEST_CASE(test_construction_from_bad_path) TEST_CASE(access_denied_test_case) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; path const testDir = env.make_env_path("dir1"); path const testFile = testDir / "testFile"; @@ -124,7 +124,7 @@ TEST_CASE(access_denied_test_case) TEST_CASE(access_denied_to_file_test_case) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; path const testFile = env.make_env_path("file1"); env.create_file(testFile, 42); diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp index 676e6f27c886b..9b239c6bf441c 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // int depth() const -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_depth_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp index 387c6145b6a50..799494f1be4de 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/disable_recursion_pending.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // void disable_recursion_pending(); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp index ea81ee25313d2..bfc818924d18d 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_directory_iterator& operator++(); // recursive_directory_iterator& increment(error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,9 +24,8 @@ #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -#include <iostream> -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_increment_tests) @@ -141,7 +140,7 @@ TEST_CASE(test_follow_symlinks) TEST_CASE(access_denied_on_recursion_test_case) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; const path testFiles[] = { env.create_dir("dir1"), @@ -240,7 +239,7 @@ TEST_CASE(access_denied_on_recursion_test_case) // See llvm.org/PR35078 TEST_CASE(test_PR35078) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; const path testFiles[] = { env.create_dir("dir1"), @@ -256,8 +255,8 @@ TEST_CASE(test_PR35078) // Change the permissions so we can no longer iterate permissions(permDeniedDir, - perms::remove_perms|perms::group_exec - |perms::owner_exec|perms::others_exec); + perms::group_exec|perms::owner_exec|perms::others_exec, + perm_options::remove); const std::error_code eacess_ec = std::make_error_code(std::errc::permission_denied); @@ -304,13 +303,25 @@ TEST_CASE(test_PR35078) TEST_CHECK(*it == nestedFile); } } + { + bool SeenNestedFile = false; + recursive_directory_iterator it = SetupState(false, SeenNestedFile); + TEST_REQUIRE(it != endIt); + TEST_REQUIRE(*it == nestedDir); + + ExceptionChecker Checker(std::errc::permission_denied, + "recursive_directory_iterator::operator++()", + format_string("attempting recursion into \"%s\"", + nestedDir.native())); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ++it); + } } // See llvm.org/PR35078 TEST_CASE(test_PR35078_with_symlink) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; const path testFiles[] = { env.create_dir("dir1"), @@ -330,8 +341,8 @@ TEST_CASE(test_PR35078_with_symlink) // Change the permissions so we can no longer iterate permissions(permDeniedDir, - perms::remove_perms|perms::group_exec - |perms::owner_exec|perms::others_exec); + perms::group_exec|perms::owner_exec|perms::others_exec, + perm_options::remove); const std::error_code eacess_ec = std::make_error_code(std::errc::permission_denied); @@ -347,7 +358,6 @@ TEST_CASE(test_PR35078_with_symlink) Opts |= directory_options::follow_directory_symlink; recursive_directory_iterator it(startDir, Opts, ec); while (!ec && it != endIt && *it != symDir) { - std::cout << *it << std::endl; if (*it == nestedFile) SeenFile3 = true; it.increment(ec); @@ -395,7 +405,7 @@ TEST_CASE(test_PR35078_with_symlink) // See llvm.org/PR35078 TEST_CASE(test_PR35078_with_symlink_file) { - using namespace std::experimental::filesystem; + using namespace fs; scoped_test_env env; const path testFiles[] = { env.create_dir("dir1"), @@ -415,8 +425,8 @@ TEST_CASE(test_PR35078_with_symlink_file) // Change the permissions so we can no longer iterate permissions(permDeniedDir, - perms::remove_perms|perms::group_exec - |perms::owner_exec|perms::others_exec); + perms::group_exec|perms::owner_exec|perms::others_exec, + perm_options::remove); const std::error_code eacess_ec = std::make_error_code(std::errc::permission_denied); diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp index 16dde66d216ea..e258c45e343df 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_directory_iterator(recursive_directory_iterator&&) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_move_construct_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp index 915d00267a828..61bb8724bde02 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/move_assign.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_directory_iterator& operator=(recursive_directory_iterator const&); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -30,7 +30,7 @@ #pragma clang diagnostic ignored "-Wself-move" #endif -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_move_assign_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp index befa30484c0c3..fe6ce5ff36e69 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/pop.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // void pop(); // void pop(error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_pop_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp index 5a3bdd9d482bb..662c11446a268 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/recursion_pending.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // bool recursion_pending() const; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_recursion_pending_tests) diff --git a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp index ca5117f0e32f3..04bc2dd1d96b6 100644 --- a/test/std/experimental/filesystem/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp +++ b/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.nonmembers/begin_end.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // class recursive_directory_iterator // recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept; // recursive_directory_iterator end(recursive_directory_iterator iter) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <set> #include <cassert> @@ -26,7 +26,7 @@ #include "filesystem_test_helper.hpp" #include <iostream> -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(recursive_directory_iterator_begin_end_tests) diff --git a/test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp b/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp index 77b136f3fcad9..77b136f3fcad9 100644 --- a/test/std/experimental/filesystem/fs.enum/check_bitmask_types.hpp +++ b/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp diff --git a/test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp index 22f0cb845a72a..75477309faeb0 100644 --- a/test/std/experimental/filesystem/fs.enum/enum.copy_options.pass.cpp +++ b/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp @@ -9,18 +9,17 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // enum class copy_options; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "check_bitmask_types.hpp" #include "test_macros.h" -namespace fs = std::experimental::filesystem; constexpr fs::copy_options ME(int val) { return static_cast<fs::copy_options>(val); } diff --git a/test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp index 7dbf7b2887e85..db40f6de91bb0 100644 --- a/test/std/experimental/filesystem/fs.enum/enum.directory_options.pass.cpp +++ b/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp @@ -9,11 +9,11 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // enum class directory_options; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include <sys/stat.h> @@ -21,7 +21,6 @@ #include "test_macros.h" #include "check_bitmask_types.hpp" -namespace fs = std::experimental::filesystem; constexpr fs::directory_options ME(int val) { return static_cast<fs::directory_options>(val); } diff --git a/test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp index ab94ad2877aac..899ab682042f8 100644 --- a/test/std/experimental/filesystem/fs.enum/enum.file_type.pass.cpp +++ b/test/std/input.output/filesystems/fs.enum/enum.file_type.pass.cpp @@ -9,17 +9,16 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // enum class file_type; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include "test_macros.h" -namespace fs = std::experimental::filesystem; constexpr fs::file_type ME(int val) { return static_cast<fs::file_type>(val); } diff --git a/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp new file mode 100644 index 0000000000000..d4ec48e8480ad --- /dev/null +++ b/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// class path; +// enum class format; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +int main() { + typedef fs::path::format E; + static_assert(std::is_enum<E>::value, ""); + + // Check that E is a scoped enum by checking for conversions. + typedef std::underlying_type<E>::type UT; + static_assert(!std::is_convertible<E, UT>::value, ""); + + LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, "")); // Implementation detail + + static_assert( + E::auto_format != E::native_format && + E::auto_format != E::generic_format && + E::native_format != E::generic_format, + "Expected enumeration values are not unique"); +} diff --git a/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp new file mode 100644 index 0000000000000..5af504530def1 --- /dev/null +++ b/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// enum class perm_options; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> +#include <sys/stat.h> + +#include "test_macros.h" +#include "check_bitmask_types.hpp" + + +constexpr fs::perm_options ME(int val) { + return static_cast<fs::perm_options>(val); +} + +int main() { + typedef fs::perm_options E; + static_assert(std::is_enum<E>::value, ""); + + // Check that E is a scoped enum by checking for conversions. + typedef std::underlying_type<E>::type UT; + static_assert(!std::is_convertible<E, UT>::value, ""); + + static_assert(std::is_same<UT, unsigned char >::value, ""); // Implementation detail + + typedef check_bitmask_type<E, E::replace, E::nofollow> BitmaskTester; + assert(BitmaskTester::check()); + + static_assert( + E::replace == ME(1) && + E::add == ME(2) && + E::remove == ME(4) && + E::nofollow == ME(8), + "Expected enumeration values do not match"); +} diff --git a/test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp b/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp index c0b14ba4b9b9a..9f2e4e214be32 100644 --- a/test/std/experimental/filesystem/fs.enum/enum.perms.pass.cpp +++ b/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp @@ -9,11 +9,11 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // enum class perms; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> #include <sys/stat.h> @@ -21,7 +21,6 @@ #include "test_macros.h" #include "check_bitmask_types.hpp" -namespace fs = std::experimental::filesystem; constexpr fs::perms ME(int val) { return static_cast<fs::perms>(val); } @@ -60,9 +59,6 @@ int main() { E::set_gid == ME(02000) && E::sticky_bit == ME(01000) && E::mask == ME(07777) && - E::unknown == ME(0xFFFF) && - E::add_perms == ME(0x10000) && - E::remove_perms == ME(0x20000) && - E::symlink_nofollow == ME(0x40000), + E::unknown == ME(0xFFFF), "Expected enumeration values do not match"); } diff --git a/test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp b/test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp index b58f5c55b643a..b58f5c55b643a 100644 --- a/test/std/experimental/filesystem/fs.error.report/tested_elsewhere.pass.cpp +++ b/test/std/input.output/filesystems/fs.error.report/tested_elsewhere.pass.cpp diff --git a/test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp b/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp index 447fb46e840b9..157083a309492 100644 --- a/test/std/experimental/filesystem/fs.filesystem.synopsis/file_time_type.pass.cpp +++ b/test/std/input.output/filesystems/fs.filesystem.synopsis/file_time_type.pass.cpp @@ -9,23 +9,38 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // typedef TrivialClock file_time_type; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <chrono> #include <type_traits> +#include "test_macros.h" + // system_clock is used because it meets the requirements of TrivialClock, // and the resolution and range of system_clock should match the operating // system's file time type. -typedef std::chrono::system_clock ExpectedClock; -typedef std::chrono::time_point<ExpectedClock> ExpectedTimePoint; + +void test_trivial_clock() { + using namespace fs; + using Clock = file_time_type::clock; + ASSERT_NOEXCEPT(Clock::now()); + ASSERT_SAME_TYPE(decltype(Clock::now()), file_time_type); + ASSERT_SAME_TYPE(Clock::time_point, file_time_type); + volatile auto* odr_use = &Clock::is_steady; + ((void)odr_use); +} + +void test_time_point_resolution_and_range() { + using namespace fs; + using Dur = file_time_type::duration; + using Period = Dur::period; + ASSERT_SAME_TYPE(Period, std::nano); +} int main() { - static_assert(std::is_same< - std::experimental::filesystem::file_time_type, - ExpectedTimePoint - >::value, ""); + test_trivial_clock(); + test_time_point_resolution_and_range(); } diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp new file mode 100644 index 0000000000000..b2a5794a5dd5d --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp @@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// path absolute(const path& p, const path& base=current_path()); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +using namespace fs; + +TEST_SUITE(filesystem_absolute_path_test_suite) + +TEST_CASE(absolute_signature_test) +{ + const path p; ((void)p); + std::error_code ec; + ASSERT_NOT_NOEXCEPT(absolute(p)); + ASSERT_NOT_NOEXCEPT(absolute(p, ec)); +} + + +TEST_CASE(basic_test) +{ + const fs::path cwd = fs::current_path(); + const struct { + std::string input; + std::string expect; + } TestCases [] = { + {"", cwd / ""}, + {"foo", cwd / "foo"}, + {"foo/", cwd / "foo/"}, + {"/already_absolute", "/already_absolute"} + }; + for (auto& TC : TestCases) { + std::error_code ec = GetTestEC(); + const path ret = absolute(TC.input, ec); + TEST_CHECK(!ec); + TEST_CHECK(ret.is_absolute()); + TEST_CHECK(PathEq(ret, TC.expect)); + } +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp index 407f5b111a836..eb10d9816c6b6 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.canonical/canonical.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp @@ -9,13 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> -// path canonical(const path& p, const path& base = current_path()); +// path canonical(const path& p); // path canonical(const path& p, error_code& ec); -// path canonical(const path& p, const path& base, error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +22,16 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; + +struct CWDGuard { + path OldCWD; + CWDGuard() : OldCWD(fs::current_path()) { } + ~CWDGuard() { fs::current_path(OldCWD); } + + CWDGuard(CWDGuard const&) = delete; + CWDGuard& operator=(CWDGuard const&) = delete; +}; TEST_SUITE(filesystem_canonical_path_test_suite) @@ -32,15 +40,14 @@ TEST_CASE(signature_test) const path p; ((void)p); std::error_code ec; ((void)ec); ASSERT_NOT_NOEXCEPT(canonical(p)); - ASSERT_NOT_NOEXCEPT(canonical(p, p)); ASSERT_NOT_NOEXCEPT(canonical(p, ec)); - ASSERT_NOT_NOEXCEPT(canonical(p, p, ec)); } // There are 4 cases is the proposal for absolute path. // Each scope tests one of the cases. TEST_CASE(test_canonical) { + CWDGuard guard; // has_root_name() && has_root_directory() const path Root = StaticEnv::Root; const path RootName = Root.filename(); @@ -65,54 +72,51 @@ TEST_CASE(test_canonical) { SymlinkName, StaticEnv::File, StaticEnv::Root} }; for (auto& TC : testCases) { - std::error_code ec; - const path ret = canonical(TC.p, TC.base, ec); + std::error_code ec = GetTestEC(); + fs::current_path(TC.base); + const path ret = canonical(TC.p, ec); TEST_REQUIRE(!ec); - const path ret2 = canonical(TC.p, TC.base); - TEST_CHECK(ret == TC.expect); - TEST_CHECK(ret == ret2); + const path ret2 = canonical(TC.p); + TEST_CHECK(PathEq(ret, TC.expect)); + TEST_CHECK(PathEq(ret, ret2)); TEST_CHECK(ret.is_absolute()); } } TEST_CASE(test_dne_path) { - std::error_code ec; + std::error_code ec = GetTestEC(); { const path ret = canonical(StaticEnv::DNE, ec); - TEST_REQUIRE(ec); - TEST_CHECK(ret == path{}); - } - ec.clear(); - { - const path ret = canonical(StaticEnv::DNE, StaticEnv::Root, ec); + TEST_CHECK(ec != GetTestEC()); TEST_REQUIRE(ec); TEST_CHECK(ret == path{}); } { TEST_CHECK_THROW(filesystem_error, canonical(StaticEnv::DNE)); - TEST_CHECK_THROW(filesystem_error, canonical(StaticEnv::DNE, StaticEnv::Root)); } } TEST_CASE(test_exception_contains_paths) { #ifndef TEST_HAS_NO_EXCEPTIONS + CWDGuard guard; const path p = "blabla/dne"; - const path base = StaticEnv::Root; try { - canonical(p, base); + canonical(p); TEST_REQUIRE(false); } catch (filesystem_error const& err) { TEST_CHECK(err.path1() == p); - TEST_CHECK(err.path2() == base); + // libc++ provides the current path as the second path in the exception + LIBCPP_ONLY(TEST_CHECK(err.path2() == current_path())); } + fs::current_path(StaticEnv::Dir); try { canonical(p); TEST_REQUIRE(false); } catch (filesystem_error const& err) { TEST_CHECK(err.path1() == p); - TEST_CHECK(err.path2() == current_path()); + LIBCPP_ONLY(TEST_CHECK(err.path2() == StaticEnv::Dir)); } #endif } diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp index 8f44e0d5a23b4..ba579d0af641e 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy/copy.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void copy(const path& from, const path& to); // void copy(const path& from, const path& to, error_code& ec); @@ -17,7 +17,7 @@ // void copy(const path& from, const path& to, copy_options options, // error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cstddef> #include <cassert> @@ -26,8 +26,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; using CO = fs::copy_options; diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp new file mode 100644 index 0000000000000..a67b431fbc80f --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp @@ -0,0 +1,189 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// bool copy_file(const path& from, const path& to); +// bool copy_file(const path& from, const path& to, error_code& ec) noexcept; +// bool copy_file(const path& from, const path& to, copy_options options); +// bool copy_file(const path& from, const path& to, copy_options options, +// error_code& ec) noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <chrono> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +#include <iostream> + +using namespace fs; + +using CO = fs::copy_options; + +TEST_SUITE(filesystem_copy_file_test_suite) + +TEST_CASE(test_signatures) { + const path p; + ((void)p); + const copy_options opts{}; + ((void)opts); + std::error_code ec; + ((void)ec); + ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p)), bool); + ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts)), bool); + ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, ec)), bool); + ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts, ec)), bool); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p)); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts)); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, ec)); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts, ec)); +} + +TEST_CASE(test_error_reporting) { + + scoped_test_env env; + const path file = env.create_file("file1", 42); + const path file2 = env.create_file("file2", 55); + const path non_regular_file = env.create_fifo("non_reg"); + const path dne = env.make_env_path("dne"); + + { // exists(to) && equivalent(to, from) + std::error_code ec; + TEST_CHECK(fs::copy_file(file, file, copy_options::overwrite_existing, + ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::file_exists)); + ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing)); + + } + { // exists(to) && !(skip_existing | overwrite_existing | update_existing) + std::error_code ec; + TEST_CHECK(fs::copy_file(file, file2, ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::file_exists)); + ExceptionChecker Checker(file, file, std::errc::file_exists, "copy_file"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, copy_file(file, file, copy_options::overwrite_existing)); + + } +} + +TEST_CASE(non_regular_file_test) { + scoped_test_env env; + const path fifo = env.create_fifo("fifo"); + const path dest = env.make_env_path("dest"); + const path file = env.create_file("file", 42); + + { + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::not_supported)); + TEST_CHECK(!exists(dest)); + } + { + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing, + ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::not_supported)); + TEST_CHECK(is_fifo(fifo)); + } + +} + +TEST_CASE(test_attributes_get_copied) { + scoped_test_env env; + const path file = env.create_file("file1", 42); + const path dest = env.make_env_path("file2"); + auto st = status(file); + perms new_perms = perms::owner_read; + permissions(file, new_perms); + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(file, dest, ec) == true); + TEST_CHECK(!ec); + auto new_st = status(dest); + TEST_CHECK(new_st.permissions() == new_perms); +} + +TEST_CASE(copy_dir_test) { + scoped_test_env env; + const path file = env.create_file("file1", 42); + const path dest = env.create_dir("dir1"); + std::error_code ec = GetTestEC(); + TEST_CHECK(fs::copy_file(file, dest, ec) == false); + TEST_CHECK(ec); + TEST_CHECK(ec != GetTestEC()); + ec = GetTestEC(); + TEST_CHECK(fs::copy_file(dest, file, ec) == false); + TEST_CHECK(ec); + TEST_CHECK(ec != GetTestEC()); +} + +TEST_CASE(copy_file) { + scoped_test_env env; + const path file = env.create_file("file1", 42); + + { // !exists(to) + const path dest = env.make_env_path("dest1"); + std::error_code ec = GetTestEC(); + + TEST_REQUIRE(fs::copy_file(file, dest, ec) == true); + TEST_CHECK(!ec); + TEST_CHECK(file_size(dest) == 42); + } + { // exists(to) && overwrite_existing + const path dest = env.create_file("dest2", 55); + permissions(dest, perms::all); + permissions(file, + perms::group_write | perms::owner_write | perms::others_write, + perm_options::remove); + + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(file, dest, copy_options::overwrite_existing, + ec) == true); + TEST_CHECK(!ec); + TEST_CHECK(file_size(dest) == 42); + TEST_CHECK(status(dest).permissions() == status(file).permissions()); + } + { // exists(to) && update_existing + using Sec = std::chrono::seconds; + const path older = env.create_file("older_file", 1); + + SleepFor(Sec(2)); + const path from = env.create_file("update_from", 55); + + SleepFor(Sec(2)); + const path newer = env.create_file("newer_file", 2); + + std::error_code ec = GetTestEC(); + TEST_REQUIRE( + fs::copy_file(from, older, copy_options::update_existing, ec) == true); + TEST_CHECK(!ec); + TEST_CHECK(file_size(older) == 55); + + TEST_REQUIRE( + fs::copy_file(from, newer, copy_options::update_existing, ec) == false); + TEST_CHECK(!ec); + TEST_CHECK(file_size(newer) == 2); + } + { // skip_existing + const path file2 = env.create_file("file2", 55); + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(file, file2, copy_options::skip_existing, ec) == + false); + TEST_CHECK(!ec); + TEST_CHECK(file_size(file2) == 55); + } +} + + +TEST_SUITE_END() diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp new file mode 100644 index 0000000000000..61733d526e326 --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp @@ -0,0 +1,99 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 +// REQUIRES: long_tests + +// <filesystem> + +// bool copy_file(const path& from, const path& to); +// bool copy_file(const path& from, const path& to, error_code& ec) noexcept; +// bool copy_file(const path& from, const path& to, copy_options options); +// bool copy_file(const path& from, const path& to, copy_options options, +// error_code& ec) noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <chrono> +#include <cassert> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +using namespace fs; + +TEST_SUITE(filesystem_copy_file_test_suite) + +static std::string random_hex_chars(uintmax_t size) { + std::string data; + data.reserve(size); + for (uintmax_t I = 0; I < size; ++I) + data.push_back(random_utils::random_hex_char()); + return data; +} + +// This test is intended to test 'sendfile's 2gb limit for a single call, and +// to ensure that libc++ correctly copies files larger than that limit. +// However it requires allocating ~5GB of filesystem space. This might not +// be acceptable on all systems. +TEST_CASE(large_file) { + using namespace fs; + constexpr uintmax_t sendfile_size_limit = 2147479552ull; + constexpr uintmax_t additional_size = 1024; + constexpr uintmax_t test_file_size = sendfile_size_limit + additional_size; + static_assert(test_file_size > sendfile_size_limit, ""); + + scoped_test_env env; + + // Check that we have more than sufficient room to create the files needed + // to perform the test. + if (space(env.test_root).available < 3 * test_file_size) { + TEST_UNSUPPORTED(); + } + + // Use python to create a file right at the size limit. + const path file = env.create_file("source", sendfile_size_limit); + // Create some random data that looks different than the data before the + // size limit. + const std::string additional_data = random_hex_chars(additional_size); + // Append this known data to the end of the source file. + { + std::ofstream outf(file.native(), std::ios_base::app); + TEST_REQUIRE(outf.good()); + outf << additional_data; + TEST_REQUIRE(outf); + } + TEST_REQUIRE(file_size(file) == test_file_size); + const path dest = env.make_env_path("dest"); + + std::error_code ec = GetTestEC(); + TEST_CHECK(copy_file(file, dest, ec)); + TEST_CHECK(!ec); + + TEST_REQUIRE(is_regular_file(dest)); + TEST_CHECK(file_size(dest) == test_file_size); + + // Read the data from the end of the destination file, and ensure it matches + // the data at the end of the source file. + std::string out_data; + out_data.reserve(additional_size); + { + std::ifstream dest_file(dest.native()); + TEST_REQUIRE(dest_file); + dest_file.seekg(sendfile_size_limit); + TEST_REQUIRE(dest_file); + dest_file >> out_data; + TEST_CHECK(dest_file.eof()); + } + TEST_CHECK(out_data.size() == additional_data.size()); + TEST_CHECK(out_data == additional_data); +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp index fe47298067728..ee4a9ed4bc5c6 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_symlink/copy_symlink.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void copy_symlink(const path& existing_symlink, const path& new_symlink); // void copy_symlink(const path& existing_symlink, const path& new_symlink, // error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,8 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_copy_symlink_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp index ba060254956fe..6b651dfb01e0d 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool create_directories(const path& p); // bool create_directories(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,8 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_create_directories_test_suite) @@ -34,7 +33,7 @@ TEST_CASE(test_signatures) ASSERT_SAME_TYPE(decltype(fs::create_directories(p)), bool); ASSERT_SAME_TYPE(decltype(fs::create_directories(p, ec)), bool); ASSERT_NOT_NOEXCEPT(fs::create_directories(p)); - ASSERT_NOEXCEPT(fs::create_directories(p, ec)); + ASSERT_NOT_NOEXCEPT(fs::create_directories(p, ec)); } TEST_CASE(create_existing_directory) @@ -67,4 +66,36 @@ TEST_CASE(create_directories_multi_level) TEST_CHECK(is_directory(dir)); } +TEST_CASE(create_directory_symlinks) { + scoped_test_env env; + const path root = env.create_dir("dir"); + const path sym_dest_dead = env.make_env_path("dead"); + const path dead_sym = env.create_symlink(sym_dest_dead, "dir/sym_dir"); + const path target = env.make_env_path("dir/sym_dir/foo"); + { + std::error_code ec = GetTestEC(); + TEST_CHECK(create_directories(target, ec) == false); + TEST_CHECK(ec); + TEST_CHECK(!exists(sym_dest_dead)); + TEST_CHECK(!exists(dead_sym)); + } +} + + +TEST_CASE(create_directory_through_symlinks) { + scoped_test_env env; + const path root = env.create_dir("dir"); + const path sym_dir = env.create_symlink(root, "sym_dir"); + const path target = env.make_env_path("sym_dir/foo"); + const path resolved_target = env.make_env_path("dir/foo"); + TEST_REQUIRE(is_directory(sym_dir)); + { + std::error_code ec = GetTestEC(); + TEST_CHECK(create_directories(target, ec) == true); + TEST_CHECK(!ec); + TEST_CHECK(is_directory(target)); + TEST_CHECK(is_directory(resolved_target)); + } +} + TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp index 5fce217bc49e2..e73e21ffb4468 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool create_directory(const path& p); // bool create_directory(const path& p, error_code& ec) noexcept; // bool create_directory(const path& p, const path& attr); // bool create_directory(const path& p, const path& attr, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -27,8 +27,7 @@ #include <sys/types.h> #include <sys/stat.h> -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; fs::perms read_umask() { mode_t old_mask = umask(0); @@ -95,9 +94,9 @@ TEST_CASE(dest_is_file) { scoped_test_env env; const path file = env.create_file("file", 42); - std::error_code ec; + std::error_code ec = GetTestEC(); TEST_CHECK(fs::create_directory(file, ec) == false); - TEST_CHECK(ec); + TEST_CHECK(!ec); TEST_CHECK(is_regular_file(file)); } diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp index c32bdd2d1928e..f013bbb203b5d 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool create_directory(const path& p, const path& attr); // bool create_directory(const path& p, const path& attr, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,8 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_create_directory_test_suite) @@ -61,7 +60,7 @@ TEST_CASE(create_directory_one_level) { scoped_test_env env; // Remove setgid which mkdir would inherit - permissions(env.test_root, perms::remove_perms | perms::set_gid); + permissions(env.test_root, perms::set_gid, perm_options::remove); const path dir = env.make_env_path("dir1"); const path attr_dir = env.create_dir("dir2"); @@ -83,9 +82,9 @@ TEST_CASE(create_directory_multi_level) const path dir = env.make_env_path("dir1/dir2"); const path dir1 = env.make_env_path("dir1"); const path attr_dir = env.create_dir("attr_dir"); - std::error_code ec; + std::error_code ec = GetTestEC(); TEST_CHECK(fs::create_directory(dir, attr_dir, ec) == false); - TEST_CHECK(ec); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); TEST_CHECK(!is_directory(dir)); TEST_CHECK(!is_directory(dir1)); } @@ -95,10 +94,39 @@ TEST_CASE(dest_is_file) scoped_test_env env; const path file = env.create_file("file", 42); const path attr_dir = env.create_dir("attr_dir"); - std::error_code ec; + std::error_code ec = GetTestEC(); TEST_CHECK(fs::create_directory(file, attr_dir, ec) == false); - TEST_CHECK(ec); + TEST_CHECK(!ec); TEST_CHECK(is_regular_file(file)); } +TEST_CASE(attr_dir_is_invalid) { + scoped_test_env env; + const path file = env.create_file("file", 42); + const path dest = env.make_env_path("dir"); + const path dne = env.make_env_path("dne"); + { + std::error_code ec = GetTestEC(); + TEST_CHECK(create_directory(dest, file, ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory)); + } + TEST_REQUIRE(!exists(dest)); + { + std::error_code ec = GetTestEC(); + TEST_CHECK(create_directory(dest, dne, ec) == false); + TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory)); + } +} + +TEST_CASE(dest_is_symlink) { + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path sym = env.create_symlink("dne_sym", "dne_sym_name"); + { + std::error_code ec = GetTestEC(); + TEST_CHECK(create_directory(sym, dir, ec) == false); + TEST_CHECK(!ec); + } +} + TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp index 85a3b6cb34653..f1d9ff04190a3 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory_symlink/create_directory_symlink.pass.cpp @@ -9,21 +9,20 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void create_directory_symlink(const path& existing_symlink, const path& new_symlink); // void create_directory_symlink(const path& existing_symlink, const path& new_symlink, // error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <cassert> #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_create_directory_symlink_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp index 7aefece46a4a9..f1ffc74c25774 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_hard_link/create_hard_link.pass.cpp @@ -9,20 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void create_hard_link(const path& existing_symlink, const path& new_symlink); // void create_hard_link(const path& existing_symlink, const path& new_symlink, // error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_create_hard_link_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp index d261d987a1ee1..e69aae186cebb 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_symlink/create_symlink.pass.cpp @@ -9,21 +9,20 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void create_symlink(const path& existing_symlink, const path& new_symlink); // void create_symlink(const path& existing_symlink, const path& new_symlink, // error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <cassert> #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_create_symlink_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp index 9d004ab854c1d..dd3736e089db4 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.current_path/current_path.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp @@ -9,14 +9,14 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // path current_path(); // path current_path(error_code& ec); // void current_path(path const&); // void current_path(path const&, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_current_path_path_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp index a3591e0267e6c..392f66c6defe1 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.equivalent/equivalent.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool equivalent(path const& lhs, path const& rhs); // bool equivalent(path const& lhs, path const& rhs, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,7 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(equivalent_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp index 2b9f57e7e9542..916052b748300 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool exists(file_status s) noexcept // bool exists(path const& p); // bool exists(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(exists_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp index 460e42dd1c3f3..60e0042cf353b 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.file_size/file_size.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.file_size/file_size.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // uintmax_t file_size(const path& p); // uintmax_t file_size(const path& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,7 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(file_size_test_suite) @@ -62,17 +62,23 @@ TEST_CASE(symlink_test_case) TEST_CASE(file_size_error_cases) { - const path testCases[] = { - StaticEnv::Dir, - StaticEnv::SymlinkToDir, - StaticEnv::BadSymlink, - StaticEnv::DNE - }; + struct { + path p; + std::errc expected_err; + } TestCases[] = { + {StaticEnv::Dir, std::errc::is_a_directory}, + {StaticEnv::SymlinkToDir, std::errc::is_a_directory}, + {StaticEnv::BadSymlink, std::errc::no_such_file_or_directory}, + {StaticEnv::DNE, std::errc::no_such_file_or_directory}, + {"", std::errc::no_such_file_or_directory}}; const uintmax_t expect = static_cast<uintmax_t>(-1); - for (auto& TC : testCases) { - std::error_code ec; - TEST_CHECK(file_size(TC, ec) == expect); - TEST_CHECK(ec); + for (auto& TC : TestCases) { + std::error_code ec = GetTestEC(); + TEST_CHECK(file_size(TC.p, ec) == expect); + TEST_CHECK(ErrorIs(ec, TC.expected_err)); + + ExceptionChecker Checker(TC.p, TC.expected_err, "file_size"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, file_size(TC.p)); } } diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp index 6b542a5b67a58..2e9704a3dbeaa 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // uintmax_t hard_link_count(const path& p); // uintmax_t hard_link_count(const path& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,7 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(hard_link_count_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp index dee28aa5be618..36f1d6bbd9157 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_block_file(file_status s) noexcept // bool is_block_file(path const& p); // bool is_block_file(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_block_file_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp index 2de42bf209758..b0c3fe542f376 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_character_file(file_status s) noexcept // bool is_character_file(path const& p); // bool is_character_file(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_character_file_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp index d6ecb1a1e684d..bb578b9cfa0c0 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_directory(file_status s) noexcept // bool is_directory(path const& p); // bool is_directory(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_directory_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp index 2da163c33471d..cd4dd174852ed 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_empty(path const& p); // bool is_empty(path const& p, std::error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -22,7 +22,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_empty_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp index 44892f65d86e9..3c86dc0e7c26a 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_fifo(file_status s) noexcept // bool is_fifo(path const& p); // bool is_fifo(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_fifo_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp index e86b66b4ea64f..a2134c7c1dbeb 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_other/is_other.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_other(file_status s) noexcept // bool is_other(path const& p); // bool is_other(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_other_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp index be68dcfc35de3..0c34886355b45 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_regular_file(file_status s) noexcept // bool is_regular_file(path const& p); // bool is_regular_file(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_regular_file_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp index 49fd402eb546b..7273c6c2e5ce4 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_socket(file_status s) noexcept // bool is_socket(path const& p); // bool is_socket(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_socket_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp index 3de002978683a..e1ac98a80d0b0 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp @@ -9,13 +9,13 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool is_symlink(file_status s) noexcept // bool is_symlink(path const& p); // bool is_symlink(path const& p, std::error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -23,7 +23,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(is_symlink_test_suite) diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp new file mode 100644 index 0000000000000..bc77f3f6351bc --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -0,0 +1,594 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// file_time_type last_write_time(const path& p); +// file_time_type last_write_time(const path& p, std::error_code& ec) noexcept; +// void last_write_time(const path& p, file_time_type new_time); +// void last_write_time(const path& p, file_time_type new_type, +// std::error_code& ec) noexcept; + +#include "filesystem_include.hpp" +#include <type_traits> +#include <chrono> +#include <fstream> +#include <cstdlib> + +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + +#include <sys/stat.h> +#include <iostream> + +#include <fcntl.h> +#include <sys/time.h> + +using namespace fs; + +using TimeSpec = struct ::timespec; +using StatT = struct ::stat; + +using Sec = std::chrono::duration<file_time_type::rep>; +using Hours = std::chrono::hours; +using Minutes = std::chrono::minutes; +using MicroSec = std::chrono::duration<file_time_type::rep, std::micro>; +using NanoSec = std::chrono::duration<file_time_type::rep, std::nano>; +using std::chrono::duration_cast; + +#if defined(__APPLE__) +TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; } +TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; } +#else +TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; } +TimeSpec extract_atime(StatT const& st) { return st.st_atim; } +#endif + +bool ConvertToTimeSpec(TimeSpec& ts, file_time_type ft) { + using SecFieldT = decltype(TimeSpec::tv_sec); + using NSecFieldT = decltype(TimeSpec::tv_nsec); + using SecLim = std::numeric_limits<SecFieldT>; + using NSecLim = std::numeric_limits<NSecFieldT>; + + auto secs = duration_cast<Sec>(ft.time_since_epoch()); + auto nsecs = duration_cast<NanoSec>(ft.time_since_epoch() - secs); + if (nsecs.count() < 0) { + if (Sec::min().count() > SecLim::min()) { + secs += Sec(1); + nsecs -= Sec(1); + } else { + nsecs = NanoSec(0); + } + } + if (SecLim::max() < secs.count() || SecLim::min() > secs.count()) + return false; + if (NSecLim::max() < nsecs.count() || NSecLim::min() > nsecs.count()) + return false; + ts.tv_sec = secs.count(); + ts.tv_nsec = nsecs.count(); + return true; +} + +bool ConvertFromTimeSpec(file_time_type& ft, TimeSpec ts) { + auto secs_part = duration_cast<file_time_type::duration>(Sec(ts.tv_sec)); + if (duration_cast<Sec>(secs_part).count() != ts.tv_sec) + return false; + auto subsecs = duration_cast<file_time_type::duration>(NanoSec(ts.tv_nsec)); + auto dur = secs_part + subsecs; + if (dur < secs_part && subsecs.count() >= 0) + return false; + ft = file_time_type(dur); + return true; +} + +bool CompareTimeExact(TimeSpec ts, TimeSpec ts2) { + return ts2.tv_sec == ts.tv_sec && ts2.tv_nsec == ts.tv_nsec; +} +bool CompareTimeExact(file_time_type ft, TimeSpec ts) { + TimeSpec ts2 = {}; + if (!ConvertToTimeSpec(ts2, ft)) + return false; + return CompareTimeExact(ts, ts2); +} +bool CompareTimeExact(TimeSpec ts, file_time_type ft) { + return CompareTimeExact(ft, ts); +} + +struct Times { + TimeSpec access, write; +}; + +Times GetTimes(path const& p) { + using Clock = file_time_type::clock; + StatT st; + if (::stat(p.c_str(), &st) == -1) { + std::error_code ec(errno, std::generic_category()); +#ifndef TEST_HAS_NO_EXCEPTIONS + throw ec; +#else + std::cerr << ec.message() << std::endl; + std::exit(EXIT_FAILURE); +#endif + } + return {extract_atime(st), extract_mtime(st)}; +} + +TimeSpec LastAccessTime(path const& p) { return GetTimes(p).access; } + +TimeSpec LastWriteTime(path const& p) { return GetTimes(p).write; } + +std::pair<TimeSpec, TimeSpec> GetSymlinkTimes(path const& p) { + using Clock = file_time_type::clock; + StatT st; + if (::lstat(p.c_str(), &st) == -1) { + std::error_code ec(errno, std::generic_category()); +#ifndef TEST_HAS_NO_EXCEPTIONS + throw ec; +#else + std::cerr << ec.message() << std::endl; + std::exit(EXIT_FAILURE); +#endif + } + return {extract_atime(st), extract_mtime(st)}; +} + +namespace { + +// In some configurations, the comparison is tautological and the test is valid. +// We disable the warning so that we can actually test it regardless. Also, that +// diagnostic is pretty new, so also don't fail if old clang does not support it +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wtautological-constant-compare" +#endif + +static const bool SupportsNegativeTimes = [] { + using namespace std::chrono; + std::error_code ec; + TimeSpec old_write_time, new_write_time; + { // WARNING: Do not assert in this scope. + scoped_test_env env; + const path file = env.create_file("file", 42); + old_write_time = LastWriteTime(file); + file_time_type tp(seconds(-5)); + fs::last_write_time(file, tp, ec); + new_write_time = LastWriteTime(file); + } + + return !ec && new_write_time.tv_sec < 0; +}(); + +static const bool SupportsMaxTime = [] { + using namespace std::chrono; + TimeSpec max_ts = {}; + if (!ConvertToTimeSpec(max_ts, file_time_type::max())) + return false; + + std::error_code ec; + TimeSpec old_write_time, new_write_time; + { // WARNING: Do not assert in this scope. + scoped_test_env env; + const path file = env.create_file("file", 42); + old_write_time = LastWriteTime(file); + file_time_type tp = file_time_type::max(); + fs::last_write_time(file, tp, ec); + new_write_time = LastWriteTime(file); + } + return !ec && new_write_time.tv_sec > max_ts.tv_sec - 1; +}(); + +static const bool SupportsMinTime = [] { + using namespace std::chrono; + TimeSpec min_ts = {}; + if (!ConvertToTimeSpec(min_ts, file_time_type::min())) + return false; + std::error_code ec; + TimeSpec old_write_time, new_write_time; + { // WARNING: Do not assert in this scope. + scoped_test_env env; + const path file = env.create_file("file", 42); + old_write_time = LastWriteTime(file); + file_time_type tp = file_time_type::min(); + fs::last_write_time(file, tp, ec); + new_write_time = LastWriteTime(file); + } + return !ec && new_write_time.tv_sec < min_ts.tv_sec + 1; +}(); + +static const bool SupportsNanosecondRoundTrip = [] { + NanoSec ns(3); + static_assert(std::is_same<file_time_type::period, std::nano>::value, ""); + + // Test that the system call we use to set the times also supports nanosecond + // resolution. (utimes does not) + file_time_type ft(ns); + { + scoped_test_env env; + const path p = env.create_file("file", 42); + last_write_time(p, ft); + return last_write_time(p) == ft; + } +}(); + +// The HFS+ filesystem (used by default before macOS 10.13) stores timestamps at +// a 1-second granularity, and APFS (now the default) at a 1 nanosecond granularity. +// 1-second granularity is also the norm on many of the supported filesystems +// on Linux as well. +static const bool WorkaroundStatTruncatesToSeconds = [] { + MicroSec micros(3); + static_assert(std::is_same<file_time_type::period, std::nano>::value, ""); + + file_time_type ft(micros); + { + scoped_test_env env; + const path p = env.create_file("file", 42); + if (LastWriteTime(p).tv_nsec != 0) + return false; + last_write_time(p, ft); + return last_write_time(p) != ft && LastWriteTime(p).tv_nsec == 0; + } +}(); + +static const bool SupportsMinRoundTrip = [] { + TimeSpec ts = {}; + if (!ConvertToTimeSpec(ts, file_time_type::min())) + return false; + file_time_type min_val = {}; + if (!ConvertFromTimeSpec(min_val, ts)) + return false; + return min_val == file_time_type::min(); +}(); + +} // end namespace + +static bool CompareTime(TimeSpec t1, TimeSpec t2) { + if (SupportsNanosecondRoundTrip) + return CompareTimeExact(t1, t2); + if (t1.tv_sec != t2.tv_sec) + return false; + + auto diff = std::abs(t1.tv_nsec - t2.tv_nsec); + if (WorkaroundStatTruncatesToSeconds) + return diff < duration_cast<NanoSec>(Sec(1)).count(); + return diff < duration_cast<NanoSec>(MicroSec(1)).count(); +} + +static bool CompareTime(file_time_type t1, TimeSpec t2) { + TimeSpec ts1 = {}; + if (!ConvertToTimeSpec(ts1, t1)) + return false; + return CompareTime(ts1, t2); +} + +static bool CompareTime(TimeSpec t1, file_time_type t2) { + return CompareTime(t2, t1); +} + +static bool CompareTime(file_time_type t1, file_time_type t2) { + auto min_secs = duration_cast<Sec>(file_time_type::min().time_since_epoch()); + bool IsMin = + t1.time_since_epoch() < min_secs || t2.time_since_epoch() < min_secs; + + if (SupportsNanosecondRoundTrip && (!IsMin || SupportsMinRoundTrip)) + return t1 == t2; + if (IsMin) { + return duration_cast<Sec>(t1.time_since_epoch()) == + duration_cast<Sec>(t2.time_since_epoch()); + } + file_time_type::duration dur; + if (t1 > t2) + dur = t1 - t2; + else + dur = t2 - t1; + if (WorkaroundStatTruncatesToSeconds) + return duration_cast<Sec>(dur).count() == 0; + return duration_cast<MicroSec>(dur).count() == 0; +} + +// Check if a time point is representable on a given filesystem. Check that: +// (A) 'tp' is representable as a time_t +// (B) 'tp' is non-negative or the filesystem supports negative times. +// (C) 'tp' is not 'file_time_type::max()' or the filesystem supports the max +// value. +// (D) 'tp' is not 'file_time_type::min()' or the filesystem supports the min +// value. +inline bool TimeIsRepresentableByFilesystem(file_time_type tp) { + TimeSpec ts = {}; + if (!ConvertToTimeSpec(ts, tp)) + return false; + else if (tp.time_since_epoch().count() < 0 && !SupportsNegativeTimes) + return false; + else if (tp == file_time_type::max() && !SupportsMaxTime) + return false; + else if (tp == file_time_type::min() && !SupportsMinTime) + return false; + return true; +} + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +// Create a sub-second duration using the smallest period the filesystem supports. +file_time_type::duration SubSec(long long val) { + using SubSecT = file_time_type::duration; + if (SupportsNanosecondRoundTrip) { + return duration_cast<SubSecT>(NanoSec(val)); + } else { + return duration_cast<SubSecT>(MicroSec(val)); + } +} + +TEST_SUITE(last_write_time_test_suite) + +TEST_CASE(signature_test) +{ + const file_time_type t; + const path p; ((void)p); + std::error_code ec; ((void)ec); + ASSERT_SAME_TYPE(decltype(last_write_time(p)), file_time_type); + ASSERT_SAME_TYPE(decltype(last_write_time(p, ec)), file_time_type); + ASSERT_SAME_TYPE(decltype(last_write_time(p, t)), void); + ASSERT_SAME_TYPE(decltype(last_write_time(p, t, ec)), void); + ASSERT_NOT_NOEXCEPT(last_write_time(p)); + ASSERT_NOT_NOEXCEPT(last_write_time(p, t)); + ASSERT_NOEXCEPT(last_write_time(p, ec)); + ASSERT_NOEXCEPT(last_write_time(p, t, ec)); +} + +TEST_CASE(read_last_write_time_static_env_test) +{ + using C = file_time_type::clock; + file_time_type min = file_time_type::min(); + { + file_time_type ret = last_write_time(StaticEnv::File); + TEST_CHECK(ret != min); + TEST_CHECK(ret < C::now()); + TEST_CHECK(CompareTime(ret, LastWriteTime(StaticEnv::File))); + + file_time_type ret2 = last_write_time(StaticEnv::SymlinkToFile); + TEST_CHECK(CompareTime(ret, ret2)); + TEST_CHECK(CompareTime(ret2, LastWriteTime(StaticEnv::SymlinkToFile))); + } + { + file_time_type ret = last_write_time(StaticEnv::Dir); + TEST_CHECK(ret != min); + TEST_CHECK(ret < C::now()); + TEST_CHECK(CompareTime(ret, LastWriteTime(StaticEnv::Dir))); + + file_time_type ret2 = last_write_time(StaticEnv::SymlinkToDir); + TEST_CHECK(CompareTime(ret, ret2)); + TEST_CHECK(CompareTime(ret2, LastWriteTime(StaticEnv::SymlinkToDir))); + } +} + +TEST_CASE(get_last_write_time_dynamic_env_test) +{ + using Clock = file_time_type::clock; + using Sec = std::chrono::seconds; + scoped_test_env env; + + const path file = env.create_file("file", 42); + const path dir = env.create_dir("dir"); + + const auto file_times = GetTimes(file); + const TimeSpec file_write_time = file_times.write; + const auto dir_times = GetTimes(dir); + const TimeSpec dir_write_time = dir_times.write; + + file_time_type ftime = last_write_time(file); + TEST_CHECK(Clock::to_time_t(ftime) == file_write_time.tv_sec); + TEST_CHECK(CompareTime(ftime, file_write_time)); + + file_time_type dtime = last_write_time(dir); + TEST_CHECK(Clock::to_time_t(dtime) == dir_write_time.tv_sec); + TEST_CHECK(CompareTime(dtime, dir_write_time)); + + SleepFor(Sec(2)); + + // update file and add a file to the directory. Make sure the times increase. + std::ofstream of(file, std::ofstream::app); + of << "hello"; + of.close(); + env.create_file("dir/file1", 1); + + file_time_type ftime2 = last_write_time(file); + file_time_type dtime2 = last_write_time(dir); + + TEST_CHECK(ftime2 > ftime); + TEST_CHECK(dtime2 > dtime); + TEST_CHECK(CompareTime(LastWriteTime(file), ftime2)); + TEST_CHECK(CompareTime(LastWriteTime(dir), dtime2)); +} + + +TEST_CASE(set_last_write_time_dynamic_env_test) +{ + using Clock = file_time_type::clock; + scoped_test_env env; + + const path file = env.create_file("file", 42); + const path dir = env.create_dir("dir"); + const auto now = Clock::now(); + const file_time_type epoch_time = now - now.time_since_epoch(); + + const file_time_type future_time = now + Hours(3) + Sec(42) + SubSec(17); + const file_time_type past_time = now - Minutes(3) - Sec(42) - SubSec(17); + const file_time_type before_epoch_time = + epoch_time - Minutes(3) - Sec(42) - SubSec(17); + // FreeBSD has a bug in their utimes implementation where the time is not update + // when the number of seconds is '-1'. +#if defined(__FreeBSD__) + const file_time_type just_before_epoch_time = + epoch_time - Sec(2) - SubSec(17); +#else + const file_time_type just_before_epoch_time = epoch_time - SubSec(17); +#endif + + struct TestCase { + const char * case_name; + path p; + file_time_type new_time; + } cases[] = { + {"file, epoch_time", file, epoch_time}, + {"dir, epoch_time", dir, epoch_time}, + {"file, future_time", file, future_time}, + {"dir, future_time", dir, future_time}, + {"file, past_time", file, past_time}, + {"dir, past_time", dir, past_time}, + {"file, before_epoch_time", file, before_epoch_time}, + {"dir, before_epoch_time", dir, before_epoch_time}, + {"file, just_before_epoch_time", file, just_before_epoch_time}, + {"dir, just_before_epoch_time", dir, just_before_epoch_time} + }; + for (const auto& TC : cases) { + std::cerr << "Test Case = " << TC.case_name << "\n"; + const auto old_times = GetTimes(TC.p); + file_time_type old_time; + TEST_REQUIRE(ConvertFromTimeSpec(old_time, old_times.write)); + + std::error_code ec = GetTestEC(); + last_write_time(TC.p, TC.new_time, ec); + TEST_CHECK(!ec); + + ec = GetTestEC(); + file_time_type got_time = last_write_time(TC.p, ec); + TEST_REQUIRE(!ec); + + if (TimeIsRepresentableByFilesystem(TC.new_time)) { + TEST_CHECK(got_time != old_time); + TEST_CHECK(CompareTime(got_time, TC.new_time)); + TEST_CHECK(CompareTime(LastAccessTime(TC.p), old_times.access)); + } + } +} + +TEST_CASE(last_write_time_symlink_test) +{ + using Clock = file_time_type::clock; + + scoped_test_env env; + + const path file = env.create_file("file", 42); + const path sym = env.create_symlink("file", "sym"); + + const file_time_type new_time = Clock::now() + Hours(3); + + const auto old_times = GetTimes(sym); + const auto old_sym_times = GetSymlinkTimes(sym); + + std::error_code ec = GetTestEC(); + last_write_time(sym, new_time, ec); + TEST_CHECK(!ec); + + file_time_type got_time = last_write_time(sym); + TEST_CHECK(!CompareTime(got_time, old_times.write)); + if (!WorkaroundStatTruncatesToSeconds) { + TEST_CHECK(got_time == new_time); + } else { + TEST_CHECK(CompareTime(got_time, new_time)); + } + + TEST_CHECK(CompareTime(LastWriteTime(file), new_time)); + TEST_CHECK(CompareTime(LastAccessTime(sym), old_times.access)); + std::pair<TimeSpec, TimeSpec> sym_times = GetSymlinkTimes(sym); + TEST_CHECK(CompareTime(sym_times.first, old_sym_times.first)); + TEST_CHECK(CompareTime(sym_times.second, old_sym_times.second)); +} + + +TEST_CASE(test_write_min_time) +{ + using Clock = file_time_type::clock; + scoped_test_env env; + const path p = env.create_file("file", 42); + const file_time_type old_time = last_write_time(p); + file_time_type new_time = file_time_type::min(); + + std::error_code ec = GetTestEC(); + last_write_time(p, new_time, ec); + file_time_type tt = last_write_time(p); + + if (TimeIsRepresentableByFilesystem(new_time)) { + TEST_CHECK(!ec); + TEST_CHECK(CompareTime(tt, new_time)); + + last_write_time(p, old_time); + new_time = file_time_type::min() + SubSec(1); + + ec = GetTestEC(); + last_write_time(p, new_time, ec); + tt = last_write_time(p); + + if (TimeIsRepresentableByFilesystem(new_time)) { + TEST_CHECK(!ec); + TEST_CHECK(CompareTime(tt, new_time)); + } else { + TEST_CHECK(ErrorIs(ec, std::errc::value_too_large)); + TEST_CHECK(tt == old_time); + } + } else { + TEST_CHECK(ErrorIs(ec, std::errc::value_too_large)); + TEST_CHECK(tt == old_time); + } +} + +TEST_CASE(test_write_max_time) { + using Clock = file_time_type::clock; + using Sec = std::chrono::seconds; + using Hours = std::chrono::hours; + + scoped_test_env env; + const path p = env.create_file("file", 42); + const file_time_type old_time = last_write_time(p); + file_time_type new_time = file_time_type::max(); + + std::error_code ec = GetTestEC(); + last_write_time(p, new_time, ec); + file_time_type tt = last_write_time(p); + + if (TimeIsRepresentableByFilesystem(new_time)) { + TEST_CHECK(!ec); + TEST_CHECK(CompareTime(tt, new_time)); + } else { + TEST_CHECK(ErrorIs(ec, std::errc::value_too_large)); + TEST_CHECK(tt == old_time); + } +} + +TEST_CASE(test_value_on_failure) +{ + const path p = StaticEnv::DNE; + std::error_code ec = GetTestEC(); + TEST_CHECK(last_write_time(p, ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); +} + +TEST_CASE(test_exists_fails) +{ + scoped_test_env env; + const path dir = env.create_dir("dir"); + const path file = env.create_file("dir/file", 42); + permissions(dir, perms::none); + + std::error_code ec = GetTestEC(); + TEST_CHECK(last_write_time(file, ec) == file_time_type::min()); + TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); + + ExceptionChecker Checker(file, std::errc::permission_denied, + "last_write_time"); + TEST_CHECK_THROW_RESULT(filesystem_error, Checker, last_write_time(file)); +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp index 794aeb992640d..cbe2b2d09fb39 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.permissions/permissions.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp @@ -9,20 +9,22 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> -// void permissions(const path& p, perms prms); +// void permissions(const path& p, perms prms, +// perm_options opts = perm_options::replace); // void permissions(const path& p, perms prms, std::error_code& ec) noexcept; +// void permissions(const path& p, perms prms, perm_options opts, std::error_code); -#include <experimental/filesystem> + +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; using PR = fs::perms; @@ -31,17 +33,19 @@ TEST_SUITE(filesystem_permissions_test_suite) TEST_CASE(test_signatures) { const path p; ((void)p); - const perms opts{}; ((void)opts); + const perms pr{}; ((void)pr); + const perm_options opts{}; ((void)opts); std::error_code ec; ((void)ec); - ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts)); - // Not noexcept because of narrow contract - LIBCPP_ONLY( - ASSERT_NOT_NOEXCEPT(fs::permissions(p, opts, ec))); + ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr)); + ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts)); + ASSERT_NOEXCEPT(fs::permissions(p, pr, ec)); + ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec)); } TEST_CASE(test_error_reporting) { - auto checkThrow = [](path const& f, fs::perms opts, const std::error_code& ec) + auto checkThrow = [](path const& f, fs::perms opts, + const std::error_code& ec) { #ifndef TEST_HAS_NO_EXCEPTIONS try { @@ -62,15 +66,17 @@ TEST_CASE(test_error_reporting) const path dne = env.make_env_path("dne"); const path dne_sym = env.create_symlink(dne, "dne_sym"); { // !exists - std::error_code ec; + std::error_code ec = GetTestEC(); fs::permissions(dne, fs::perms{}, ec); TEST_REQUIRE(ec); + TEST_CHECK(ec != GetTestEC()); TEST_CHECK(checkThrow(dne, fs::perms{}, ec)); } { - std::error_code ec; + std::error_code ec = GetTestEC(); fs::permissions(dne_sym, fs::perms{}, ec); TEST_REQUIRE(ec); + TEST_CHECK(ec != GetTestEC()); TEST_CHECK(checkThrow(dne_sym, fs::perms{}, ec)); } } @@ -82,42 +88,54 @@ TEST_CASE(basic_permissions_test) const path dir = env.create_dir("dir1"); const path file_for_sym = env.create_file("file2", 42); const path sym = env.create_symlink(file_for_sym, "sym"); - const perms AP = perms::add_perms; - const perms RP = perms::remove_perms; - const perms NF = perms::symlink_nofollow; + const perm_options AP = perm_options::add; + const perm_options RP = perm_options::remove; + const perm_options NF = perm_options::nofollow; struct TestCase { path p; perms set_perms; perms expected; + perm_options opts; + TestCase(path xp, perms xperms, perms xexpect, + perm_options xopts = perm_options::replace) + : p(xp), set_perms(xperms), expected(xexpect), opts(xopts) {} } cases[] = { // test file {file, perms::none, perms::none}, {file, perms::owner_all, perms::owner_all}, - {file, perms::group_all | AP, perms::owner_all | perms::group_all}, - {file, perms::group_all | RP, perms::owner_all}, + {file, perms::group_all, perms::owner_all | perms::group_all, AP}, + {file, perms::group_all, perms::owner_all, RP}, // test directory {dir, perms::none, perms::none}, {dir, perms::owner_all, perms::owner_all}, - {dir, perms::group_all | AP, perms::owner_all | perms::group_all}, - {dir, perms::group_all | RP, perms::owner_all}, + {dir, perms::group_all, perms::owner_all | perms::group_all, AP}, + {dir, perms::group_all, perms::owner_all, RP}, // test symlink without symlink_nofollow {sym, perms::none, perms::none}, {sym, perms::owner_all, perms::owner_all}, - {sym, perms::group_all | AP, perms::owner_all | perms::group_all}, - {sym, perms::group_all | RP , perms::owner_all}, + {sym, perms::group_all, perms::owner_all | perms::group_all, AP}, + {sym, perms::group_all, perms::owner_all, RP}, // test non-symlink with symlink_nofollow. The last test on file/dir // will have set their permissions to perms::owner_all - {file, perms::group_all | AP | NF, perms::owner_all | perms::group_all}, - {dir, perms::group_all | AP | NF, perms::owner_all | perms::group_all} + {file, perms::group_all, perms::owner_all | perms::group_all, AP | NF}, + {dir, perms::group_all, perms::owner_all | perms::group_all, AP | NF} }; for (auto const& TC : cases) { TEST_CHECK(status(TC.p).permissions() != TC.expected); - // Set the error code to ensure it's cleared. - std::error_code ec = std::make_error_code(std::errc::bad_address); - permissions(TC.p, TC.set_perms, ec); - TEST_CHECK(!ec); - auto pp = status(TC.p).permissions(); - TEST_CHECK(pp == TC.expected); + { + std::error_code ec = GetTestEC(); + permissions(TC.p, TC.set_perms, TC.opts, ec); + TEST_CHECK(!ec); + auto pp = status(TC.p).permissions(); + TEST_CHECK(pp == TC.expected); + } + if (TC.opts == perm_options::replace) { + std::error_code ec = GetTestEC(); + permissions(TC.p, TC.set_perms, ec); + TEST_CHECK(!ec); + auto pp = status(TC.p).permissions(); + TEST_CHECK(pp == TC.expected); + } } } @@ -131,10 +149,14 @@ TEST_CASE(test_no_resolve_symlink_on_symlink) struct TestCase { perms set_perms; perms expected; // only expected on platform that support symlink perms. + perm_options opts = perm_options::replace; + TestCase(perms xperms, perms xexpect, + perm_options xopts = perm_options::replace) + : set_perms(xperms), expected(xexpect), opts(xopts) {} } cases[] = { {perms::owner_all, perms::owner_all}, - {perms::group_all | perms::add_perms, perms::owner_all | perms::group_all}, - {perms::owner_all | perms::remove_perms, perms::group_all}, + {perms::group_all, perms::owner_all | perms::group_all, perm_options::add}, + {perms::owner_all, perms::group_all, perm_options::remove}, }; for (auto const& TC : cases) { #if defined(__APPLE__) || defined(__FreeBSD__) @@ -149,8 +171,8 @@ TEST_CASE(test_no_resolve_symlink_on_symlink) const auto expected_link_perms = symlink_status(sym).permissions(); std::error_code expected_ec = std::make_error_code(std::errc::operation_not_supported); #endif - std::error_code ec = std::make_error_code(std::errc::bad_address); - permissions(sym, TC.set_perms | perms::symlink_nofollow, ec); + std::error_code ec = GetTestEC(); + permissions(sym, TC.set_perms, TC.opts | perm_options::nofollow, ec); TEST_CHECK(ec == expected_ec); TEST_CHECK(status(file).permissions() == file_perms); TEST_CHECK(symlink_status(sym).permissions() == expected_link_perms); diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp new file mode 100644 index 0000000000000..5f7b30dd60b9d --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp @@ -0,0 +1,133 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// path proximate(const path& p, error_code &ec) +// path proximate(const path& p, const path& base = current_path()) +// path proximate(const path& p, const path& base, error_code& ec); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <vector> +#include <iostream> +#include <cassert> + +#include "test_macros.h" +#include "test_iterators.h" +#include "count_new.hpp" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + + +static int count_path_elems(const fs::path& p) { + int count = 0; + for (auto& elem : p) { + if (elem != "/" && elem != "") + ++count; + } + return count; +} + +TEST_SUITE(filesystem_proximate_path_test_suite) + + +TEST_CASE(signature_test) +{ + using fs::path; + const path p; ((void)p); + std::error_code ec; ((void)ec); + ASSERT_NOT_NOEXCEPT(proximate(p)); + ASSERT_NOT_NOEXCEPT(proximate(p, p)); + ASSERT_NOT_NOEXCEPT(proximate(p, ec)); + ASSERT_NOT_NOEXCEPT(proximate(p, p, ec)); +} + +TEST_CASE(basic_test) { + using fs::path; + const path cwd = fs::current_path(); + const path parent_cwd = cwd.parent_path(); + const path curdir = cwd.filename(); + TEST_REQUIRE(!cwd.native().empty()); + int cwd_depth = count_path_elems(cwd); + path dot_dot_to_root; + for (int i=0; i < cwd_depth; ++i) + dot_dot_to_root /= ".."; + path relative_cwd = cwd.native().substr(1); + // clang-format off + struct { + std::string input; + std::string base; + std::string expect; + } TestCases[] = { + {"", "", "."}, + {cwd, "a", ".."}, + {parent_cwd, "a", "../.."}, + {"a", cwd, "a"}, + {"a", parent_cwd, "fs.op.proximate/a"}, + {"/", "a", dot_dot_to_root / ".."}, + {"/", "a/b", dot_dot_to_root / "../.."}, + {"/", "a/b/", dot_dot_to_root / "../../.."}, + {"a", "/", relative_cwd / "a"}, + {"a/b", "/", relative_cwd / "a/b"}, + {"a", "/net", ".." / relative_cwd / "a"}, + {"//foo/", "//foo", "/foo/"}, + {"//foo", "//foo/", ".."}, + {"//foo", "//foo", "."}, + {"//foo/", "//foo/", "."}, + {"//base", "a", dot_dot_to_root / "../base"}, + {"a", "a", "."}, + {"a/b", "a/b", "."}, + {"a/b/c/", "a/b/c/", "."}, + {"//foo/a/b", "//foo/a/b", "."}, + {"/a/d", "/a/b/c", "../../d"}, + {"/a/b/c", "/a/d", "../b/c"}, + {"a/b/c", "a", "b/c"}, + {"a/b/c", "a/b/c/x/y", "../.."}, + {"a/b/c", "a/b/c", "."}, + {"a/b", "c/d", "../../a/b"} + }; + // clang-format on + int ID = 0; + for (auto& TC : TestCases) { + ++ID; + std::error_code ec = GetTestEC(); + fs::path p(TC.input); + const fs::path output = fs::proximate(p, TC.base, ec); + if (ec) { + TEST_CHECK(!ec); + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Base: '" << TC.base << "'\n"; + std::cerr << " Expected: '" << TC.expect << "'\n"; + + std::cerr << std::endl; + } else if (!PathEq(output, TC.expect)) { + TEST_CHECK(PathEq(output, TC.expect)); + + const path canon_input = fs::weakly_canonical(TC.input); + const path canon_base = fs::weakly_canonical(TC.base); + const path lexically_p = canon_input.lexically_proximate(canon_base); + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Base: '" << TC.base << "'\n"; + std::cerr << " Expected: '" << TC.expect << "'\n"; + std::cerr << " Output: '" << output.native() << "'\n"; + std::cerr << " Lex Prox: '" << lexically_p.native() << "'\n"; + std::cerr << " Canon Input: " << canon_input << "\n"; + std::cerr << " Canon Base: " << canon_base << "\n"; + + std::cerr << std::endl; + } + } +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp index d69e95ce5d5cf..43dfec8347ac7 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // path read_symlink(const path& p); // path read_symlink(const path& p, error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_read_symlink_test_suite) diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp new file mode 100644 index 0000000000000..e240c64967556 --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp @@ -0,0 +1,78 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// path proximate(const path& p, error_code &ec) +// path proximate(const path& p, const path& base = current_path()) +// path proximate(const path& p, const path& base, error_code& ec); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <vector> +#include <iostream> +#include <cassert> + +#include "test_macros.h" +#include "test_iterators.h" +#include "count_new.hpp" +#include "rapid-cxx-test.hpp" +#include "filesystem_test_helper.hpp" + + +TEST_SUITE(filesystem_proximate_path_test_suite) + +TEST_CASE(test_signature) { + +} +int main() { + // clang-format off + struct { + std::string input; + std::string expect; + } TestCases[] = { + {"", fs::current_path()}, + {".", fs::current_path()}, + {StaticEnv::File, StaticEnv::File}, + {StaticEnv::Dir, StaticEnv::Dir}, + {StaticEnv::SymlinkToDir, StaticEnv::Dir}, + {StaticEnv::SymlinkToDir / "dir2/.", StaticEnv::Dir / "dir2"}, + // FIXME? If the trailing separator occurs in a part of the path that exists, + // it is ommitted. Otherwise it is added to the end of the result. + {StaticEnv::SymlinkToDir / "dir2/./", StaticEnv::Dir / "dir2"}, + {StaticEnv::SymlinkToDir / "dir2/DNE/./", StaticEnv::Dir / "dir2/DNE/"}, + {StaticEnv::SymlinkToDir / "dir2", StaticEnv::Dir2}, + {StaticEnv::SymlinkToDir / "dir2/../dir2/DNE/..", StaticEnv::Dir2 / ""}, + {StaticEnv::SymlinkToDir / "dir2/dir3/../DNE/DNE2", StaticEnv::Dir2 / "DNE/DNE2"}, + {StaticEnv::Dir / "../dir1", StaticEnv::Dir}, + {StaticEnv::Dir / "./.", StaticEnv::Dir}, + {StaticEnv::Dir / "DNE/../foo", StaticEnv::Dir / "foo"} + }; + // clang-format on + int ID = 0; + bool Failed = false; + for (auto& TC : TestCases) { + ++ID; + fs::path p(TC.input); + const fs::path output = fs::weakly_canonical(p); + if (output != TC.expect) { + Failed = true; + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Expected: '" << TC.expect << "'\n"; + std::cerr << " Output: '" << output.native() << "'"; + std::cerr << std::endl; + } + } + return Failed; +} + +TEST_SUITE_END() diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp index f7ce8a30e64e5..37b47f1517b97 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove/remove.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool remove(const path& p); // bool remove(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_remove_test_suite) @@ -61,17 +60,29 @@ TEST_CASE(test_error_reporting) const path file_in_bad_dir = env.create_file(bad_perms_dir / "file", 42); permissions(bad_perms_dir, perms::none); const path testCases[] = { - "", - env.make_env_path("dne"), non_empty_dir, file_in_bad_dir, }; for (auto& p : testCases) { std::error_code ec; + TEST_CHECK(!fs::remove(p, ec)); TEST_CHECK(ec); TEST_CHECK(checkThrow(p, ec)); } + + // PR#35780 + const path testCasesNonexistant[] = { + "", + env.make_env_path("dne") + }; + + for (auto& p : testCasesNonexistant) { + std::error_code ec; + + TEST_CHECK(!fs::remove(p, ec)); + TEST_CHECK(!ec); + } } TEST_CASE(basic_remove_test) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp index b84c18c1da06a..0f015c387bf87 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // uintmax_t remove_all(const path& p); // uintmax_t remove_all(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_remove_all_test_suite) @@ -33,7 +32,7 @@ TEST_CASE(test_signatures) ASSERT_SAME_TYPE(decltype(fs::remove_all(p, ec)), std::uintmax_t); ASSERT_NOT_NOEXCEPT(fs::remove_all(p)); - ASSERT_NOEXCEPT(fs::remove_all(p, ec)); + ASSERT_NOT_NOEXCEPT(fs::remove_all(p, ec)); } TEST_CASE(test_error_reporting) @@ -64,16 +63,28 @@ TEST_CASE(test_error_reporting) permissions(bad_perms_file, perms::none); const path testCases[] = { - env.make_env_path("dne"), file_in_bad_dir }; const auto BadRet = static_cast<std::uintmax_t>(-1); for (auto& p : testCases) { std::error_code ec; + TEST_CHECK(fs::remove_all(p, ec) == BadRet); TEST_CHECK(ec); TEST_CHECK(checkThrow(p, ec)); } + + // PR#35780 + const path testCasesNonexistant[] = { + "", + env.make_env_path("dne") + }; + for (auto &p : testCasesNonexistant) { + std::error_code ec; + + TEST_CHECK(fs::remove_all(p, ec) == 0); + TEST_CHECK(!ec); + } } TEST_CASE(basic_remove_all_test) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp index e265c7af6b10c..e2ebdc61f650a 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.rename/rename.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void rename(const path& old_p, const path& new_p); // void rename(const path& old_p, const path& new_p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_rename_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp index f7c2ee14e83ae..1a2df47e68cbd 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.resize_file/resize_file.pass.cpp @@ -9,19 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // void resize_file(const path& p, uintmax_t new_size); // void resize_file(const path& p, uintmax_t new_size, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; -namespace fs = std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_resize_file_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp index 8f241810fc7d8..2c2e75af66a73 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.space/space.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp @@ -9,19 +9,19 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // space_info space(const path& p); // space_info space(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <sys/statvfs.h> #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; bool EqualDelta(std::uintmax_t x, std::uintmax_t y, std::uintmax_t delta) { if (x >= y) { diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp index fdc3d2b4a61ff..ab72f2e5dcd87 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status/status.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp @@ -9,18 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // file_status status(const path& p); // file_status status(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_status_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp index 169c5be9d9a86..d74ced643f3bf 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.status_known/status_known.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.status_known/status_known.pass.cpp @@ -9,11 +9,11 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // bool status_known(file_status s) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <type_traits> #include <cassert> @@ -21,7 +21,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(status_known_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp index 647504f6e1a44..fac630da1088b 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp @@ -9,18 +9,18 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // file_status symlink_status(const path& p); // file_status symlink_status(const path& p, error_code& ec) noexcept; -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include "test_macros.h" #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; TEST_SUITE(filesystem_symlink_status_test_suite) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp index 021dd7fc81608..523e429cf79f2 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp @@ -9,12 +9,12 @@ // UNSUPPORTED: c++98, c++03 -// <experimental/filesystem> +// <filesystem> // path temp_directory_path(); // path temp_directory_path(error_code& ec); -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <memory> #include <cstdlib> #include <cstring> @@ -24,7 +24,7 @@ #include "rapid-cxx-test.hpp" #include "filesystem_test_helper.hpp" -using namespace std::experimental::filesystem; +using namespace fs; void PutEnv(std::string var, std::string value) { assert(::setenv(var.c_str(), value.c_str(), /* overwrite */ 1) == 0); diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp new file mode 100644 index 0000000000000..0fe058ffdfffa --- /dev/null +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp @@ -0,0 +1,76 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <filesystem> + +// path weakly_canonical(const path& p); +// path weakly_canonical(const path& p, error_code& ec); + +#include "filesystem_include.hpp" +#include <type_traits> +#include <vector> +#include <iostream> +#include <cassert> + +#include "test_macros.h" +#include "test_iterators.h" +#include "count_new.hpp" +#include "filesystem_test_helper.hpp" + + +int main() { + // clang-format off + struct { + std::string input; + std::string expect; + } TestCases[] = { + {"", fs::current_path()}, + {".", fs::current_path()}, + {"/", "/"}, + {"/foo", "/foo"}, + {"/.", "/"}, + {"/./", "/"}, + {"a/b", fs::current_path() / "a/b"}, + {"a", fs::current_path() / "a"}, + {"a/b/", fs::current_path() / "a/b/"}, + {StaticEnv::File, StaticEnv::File}, + {StaticEnv::Dir, StaticEnv::Dir}, + {StaticEnv::SymlinkToDir, StaticEnv::Dir}, + {StaticEnv::SymlinkToDir / "dir2/.", StaticEnv::Dir / "dir2"}, + // FIXME? If the trailing separator occurs in a part of the path that exists, + // it is ommitted. Otherwise it is added to the end of the result. + {StaticEnv::SymlinkToDir / "dir2/./", StaticEnv::Dir / "dir2"}, + {StaticEnv::SymlinkToDir / "dir2/DNE/./", StaticEnv::Dir / "dir2/DNE/"}, + {StaticEnv::SymlinkToDir / "dir2", StaticEnv::Dir2}, + {StaticEnv::SymlinkToDir / "dir2/../dir2/DNE/..", StaticEnv::Dir2 / ""}, + {StaticEnv::SymlinkToDir / "dir2/dir3/../DNE/DNE2", StaticEnv::Dir2 / "DNE/DNE2"}, + {StaticEnv::Dir / "../dir1", StaticEnv::Dir}, + {StaticEnv::Dir / "./.", StaticEnv::Dir}, + {StaticEnv::Dir / "DNE/../foo", StaticEnv::Dir / "foo"} + }; + // clang-format on + int ID = 0; + bool Failed = false; + for (auto& TC : TestCases) { + ++ID; + fs::path p(TC.input); + const fs::path output = fs::weakly_canonical(p); + if (!PathEq(output, TC.expect)) { + Failed = true; + std::cerr << "TEST CASE #" << ID << " FAILED: \n"; + std::cerr << " Input: '" << TC.input << "'\n"; + std::cerr << " Expected: '" << TC.expect << "'\n"; + std::cerr << " Output: '" << output.native() << "'"; + std::cerr << std::endl; + } + } + return Failed; +} diff --git a/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp b/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp new file mode 100644 index 0000000000000..071fa800cf640 --- /dev/null +++ b/test/std/input.output/filesystems/fs.req.macros/feature_macro.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <filesystem> + +// #define __cpp_lib_filesystem 201703L + +#include <filesystem> +#include "test_macros.h" + +#if TEST_STD_VER >= 17 +#ifndef __cpp_lib_filesystem +#error Filesystem feature test macro is not defined (__cpp_lib_filesystem) +#elif __cpp_lib_filesystem != 201703L +#error Filesystem feature test macro has an incorrect value (__cpp_lib_filesystem) +#endif +#else // TEST_STD_VER < 17 +#ifdef __cpp_lib_filesystem +#error Filesystem feature test macro should not be defined before C++17 +#endif +#endif + +int main() { } diff --git a/test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp b/test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp new file mode 100644 index 0000000000000..c61bb2e12e8a1 --- /dev/null +++ b/test/std/input.output/filesystems/fs.req.namespace/namespace.fail.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// REQUIRES: c++98 || c++03 || c++11 || c++14 + +// <filesystem> + +// namespace std::filesystem + +#include <filesystem> +#include "test_macros.h" + +using namespace std::filesystem; + +#if TEST_STD_VER >= 11 +// expected-error@-3 {{no namespace named 'filesystem' in namespace 'std';}} +#else +// expected-error@-5 {{expected namespace name}} +#endif + +int main() { + +} diff --git a/test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp b/test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp index a95ac49ff4525..557de3488a728 100644 --- a/test/std/experimental/utilities/tuple/tuple_size_v_2.fail.cpp +++ b/test/std/input.output/filesystems/fs.req.namespace/namespace.pass.cpp @@ -7,19 +7,20 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03, c++11 +// UNSUPPORTED: c++98, c++03, c++11, c++14 -// <experimental/tuple> +// <filesystem> -// template <class T> constexpr size_t tuple_size_v = tuple_size<T>::value; +// namespace std::filesystem -// Test with non tuple type +#include <filesystem> +#include <type_traits> -#include <experimental/tuple> +using namespace std::filesystem; -namespace ex = std::experimental; - -int main() -{ - auto x = ex::tuple_size_v<int>; +int main() { + static_assert(std::is_same< + path, + std::filesystem::path + >::value, ""); } diff --git a/test/std/experimental/filesystem/lit.local.cfg b/test/std/input.output/filesystems/lit.local.cfg index 3d9360431f486..3d9360431f486 100644 --- a/test/std/experimental/filesystem/lit.local.cfg +++ b/test/std/input.output/filesystems/lit.local.cfg diff --git a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp index 6b6737a765da1..5afc56d8aaaa4 100644 --- a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp @@ -45,12 +45,12 @@ protected: { if (ch != base::traits_type::eof()) { - int n = str_.size(); + std::size_t n = str_.size(); str_.push_back(static_cast<CharT>(ch)); str_.resize(str_.capacity()); base::setp(const_cast<CharT*>(str_.data()), const_cast<CharT*>(str_.data() + str_.size())); - base::pbump(n+1); + base::pbump(static_cast<int>(n+1)); } return ch; } diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp index 1691a2d2de14f..a45802c571dd4 100644 --- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp @@ -7,6 +7,14 @@ // //===----------------------------------------------------------------------===// +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 +// XFAIL: with_system_cxx_lib=macosx10.8 +// XFAIL: with_system_cxx_lib=macosx10.7 + // <istream> // basic_istream<charT,traits>& get(char_type* s, streamsize n); @@ -14,6 +22,8 @@ #include <istream> #include <cassert> +#include "test_macros.h" + template <class CharT> struct testbuf : public std::basic_streambuf<CharT> @@ -67,7 +77,33 @@ int main() assert(!is.fail()); assert(std::string(s) == " "); assert(is.gcount() == 1); + // Check that even in error case the buffer is properly 0-terminated. + is.get(s, 5); + assert( is.eof()); + assert( is.fail()); + assert(std::string(s) == ""); + assert(is.gcount() == 0); + } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + testbuf<char> sb(" "); + std::istream is(&sb); + char s[5] = "test"; + is.exceptions(std::istream::eofbit | std::istream::badbit); + try + { + is.get(s, 5); + assert(false); + } + catch (std::ios_base::failure&) + { + } + assert( is.eof()); + assert( is.fail()); + assert(std::string(s) == " "); + assert(is.gcount() == 1); } +#endif { testbuf<wchar_t> sb(L" \n \n "); std::wistream is(&sb); @@ -95,5 +131,31 @@ int main() assert(!is.fail()); assert(std::wstring(s) == L" "); assert(is.gcount() == 1); + // Check that even in error case the buffer is properly 0-terminated. + is.get(s, 5); + assert( is.eof()); + assert( is.fail()); + assert(std::wstring(s) == L""); + assert(is.gcount() == 0); + } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + testbuf<wchar_t> sb(L" "); + std::wistream is(&sb); + wchar_t s[5] = L"test"; + is.exceptions(std::wistream::eofbit | std::wistream::badbit); + try + { + is.get(s, 5); + assert(false); + } + catch (std::ios_base::failure&) + { + } + assert( is.eof()); + assert( is.fail()); + assert(std::wstring(s) == L" "); + assert(is.gcount() == 1); } +#endif } diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp index c9389ec9dad55..437af84f9d612 100644 --- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp @@ -7,6 +7,14 @@ // //===----------------------------------------------------------------------===// +// XFAIL: with_system_cxx_lib=macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.10 +// XFAIL: with_system_cxx_lib=macosx10.9 +// XFAIL: with_system_cxx_lib=macosx10.8 +// XFAIL: with_system_cxx_lib=macosx10.7 + // <istream> // basic_istream<charT,traits>& get(char_type* s, streamsize n, char_type delim); @@ -14,6 +22,8 @@ #include <istream> #include <cassert> +#include "test_macros.h" + template <class CharT> struct testbuf : public std::basic_streambuf<CharT> @@ -67,7 +77,33 @@ int main() assert(!is.fail()); assert(std::string(s) == " "); assert(is.gcount() == 1); + // Check that even in error case the buffer is properly 0-terminated. + is.get(s, 5, '*'); + assert( is.eof()); + assert( is.fail()); + assert(std::string(s) == ""); + assert(is.gcount() == 0); + } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + testbuf<char> sb(" "); + std::istream is(&sb); + char s[5] = "test"; + is.exceptions(std::istream::eofbit | std::istream::badbit); + try + { + is.get(s, 5, '*'); + assert(false); + } + catch (std::ios_base::failure&) + { + } + assert( is.eof()); + assert( is.fail()); + assert(std::string(s) == " "); + assert(is.gcount() == 1); } +#endif { testbuf<wchar_t> sb(L" * * "); std::wistream is(&sb); @@ -95,5 +131,31 @@ int main() assert(!is.fail()); assert(std::wstring(s) == L" "); assert(is.gcount() == 1); + // Check that even in error case the buffer is properly 0-terminated. + is.get(s, 5, L'*'); + assert( is.eof()); + assert( is.fail()); + assert(std::wstring(s) == L""); + assert(is.gcount() == 0); + } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + testbuf<wchar_t> sb(L" "); + std::wistream is(&sb); + wchar_t s[5] = L"test"; + is.exceptions(std::wistream::eofbit | std::wistream::badbit); + try + { + is.get(s, 5, L'*'); + assert(false); + } + catch (std::ios_base::failure&) + { + } + assert( is.eof()); + assert( is.fail()); + assert(std::wstring(s) == L" "); + assert(is.gcount() == 1); } +#endif } diff --git a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp index 50f5fdad74420..44c55118d5afb 100644 --- a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp +++ b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_char_pointer_error_code.pass.cpp @@ -15,6 +15,7 @@ #include <ios> #include <string> +#include <system_error> #include <cassert> int main() @@ -25,7 +26,8 @@ int main() assert(se.code() == std::make_error_code(std::errc::is_a_directory)); std::string what_message(se.what()); assert(what_message.find(what_arg) != std::string::npos); - assert(what_message.find("Is a directory") != std::string::npos); + assert(what_message.find(std::generic_category().message(static_cast<int> + (std::errc::is_a_directory))) != std::string::npos); } { std::string what_arg("io test message"); diff --git a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp index a9c5f30f37ae1..5711b55c7e849 100644 --- a/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp +++ b/test/std/input.output/iostreams.base/ios.base/ios.types/ios_failure/ctor_string_error_code.pass.cpp @@ -15,6 +15,7 @@ #include <ios> #include <string> +#include <system_error> #include <cassert> int main() @@ -28,7 +29,8 @@ int main() assert(se.code() == std::make_error_code(std::errc::is_a_directory)); std::string what_message(se.what()); assert(what_message.find(what_arg) != std::string::npos); - assert(what_message.find("Is a directory") != std::string::npos); + assert(what_message.find(std::generic_category().message(static_cast<int> + (std::errc::is_a_directory))) != std::string::npos); } { std::string what_arg("io test message"); diff --git a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp index 4ede8a514f96e..23867e63fe254 100644 --- a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp +++ b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp @@ -48,7 +48,6 @@ struct test assert(t.pptr() == old_this.pptr()); assert(t.epptr() == old_this.epptr()); assert(t.getloc() == old_this.getloc()); - return *this; } void setg(CharT* gbeg, CharT* gnext, CharT* gend) @@ -66,12 +65,12 @@ int main() { test<char> t; test<char> t2; - swap(t2, t); + t2.swap(t); } { test<wchar_t> t; test<wchar_t> t2; - swap(t2, t); + t2.swap(t); } { char g1, g2, g3, p1, p3; @@ -79,7 +78,7 @@ int main() t.setg(&g1, &g2, &g3); t.setp(&p1, &p3); test<char> t2; - swap(t2, t); + t2.swap(t); } { wchar_t g1, g2, g3, p1, p3; @@ -87,17 +86,17 @@ int main() t.setg(&g1, &g2, &g3); t.setp(&p1, &p3); test<wchar_t> t2; - swap(t2, t); + t2.swap(t); } std::locale::global(std::locale(LOCALE_en_US_UTF_8)); { test<char> t; test<char> t2; - swap(t2, t); + t2.swap(t); } { test<wchar_t> t; test<wchar_t> t2; - swap(t2, t); + t2.swap(t); } } diff --git a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp index e7bdd897c745e..460e4c07ec9f3 100644 --- a/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp +++ b/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp @@ -32,12 +32,13 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { #endif - std::string str(2147483648, 'a'); - SB sb; - sb.str(str); - assert(sb.pubpbase() <= sb.pubpptr()); + std::string str(2147483648, 'a'); + SB sb; + sb.str(str); + assert(sb.pubpbase() <= sb.pubpptr()); #ifndef TEST_HAS_NO_EXCEPTIONS - } - catch (const std::bad_alloc &) {} + } + catch (const std::length_error &) {} // maybe the string can't take 2GB + catch (const std::bad_alloc &) {} // maybe we don't have enough RAM #endif } diff --git a/test/std/iterators/iterator.container/data.pass.cpp b/test/std/iterators/iterator.container/data.pass.cpp index 09b7c01349626..12ca9129526f8 100644 --- a/test/std/iterators/iterator.container/data.pass.cpp +++ b/test/std/iterators/iterator.container/data.pass.cpp @@ -23,6 +23,10 @@ #include "test_macros.h" +#if TEST_STD_VER > 14 +#include <string_view> +#endif + template<typename C> void test_const_container( const C& c ) { @@ -72,6 +76,12 @@ int main() test_const_container ( a ); test_const_container ( il ); +#if TEST_STD_VER > 14 + std::string_view sv{"ABC"}; + test_container ( sv ); + test_const_container ( sv ); +#endif + static constexpr int arrA [] { 1, 2, 3 }; test_const_array ( arrA ); } diff --git a/test/std/iterators/iterator.container/empty.pass.cpp b/test/std/iterators/iterator.container/empty.pass.cpp index cd000cc2fe763..f6fe2351d3c03 100644 --- a/test/std/iterators/iterator.container/empty.pass.cpp +++ b/test/std/iterators/iterator.container/empty.pass.cpp @@ -23,6 +23,10 @@ #include "test_macros.h" +#if TEST_STD_VER > 14 +#include <string_view> +#endif + template<typename C> void test_const_container( const C& c ) { @@ -74,6 +78,12 @@ int main() test_const_container ( a ); test_const_container ( il ); +#if TEST_STD_VER > 14 + std::string_view sv{"ABC"}; + test_container ( sv ); + test_const_container ( sv ); +#endif + static constexpr int arrA [] { 1, 2, 3 }; test_const_array ( arrA ); } diff --git a/test/std/iterators/iterator.container/size.pass.cpp b/test/std/iterators/iterator.container/size.pass.cpp index 7d443e6e123c5..6d3bc51289153 100644 --- a/test/std/iterators/iterator.container/size.pass.cpp +++ b/test/std/iterators/iterator.container/size.pass.cpp @@ -22,6 +22,11 @@ #include "test_macros.h" +#if TEST_STD_VER > 14 +#include <string_view> +#endif + + template<typename C> void test_const_container( const C& c ) { @@ -65,7 +70,6 @@ int main() std::list<int> l; l.push_back(2); std::array<int, 1> a; a[0] = 3; std::initializer_list<int> il = { 4 }; - test_container ( v ); test_container ( l ); test_container ( a ); @@ -76,6 +80,12 @@ int main() test_const_container ( a ); test_const_container ( il ); +#if TEST_STD_VER > 14 + std::string_view sv{"ABC"}; + test_container ( sv ); + test_const_container ( sv ); +#endif + static constexpr int arrA [] { 1, 2, 3 }; test_const_array ( arrA ); } diff --git a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp index 0baefb5ee766f..cc451c0a278d7 100644 --- a/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp +++ b/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp @@ -17,11 +17,13 @@ #include <sstream> #include <cassert> -#if defined(__clang__) +#include "test_macros.h" + +#if defined(TEST_COMPILER_CLANG) #pragma clang diagnostic ignored "-Wliteral-conversion" #endif -#ifdef _MSC_VER +#ifdef TEST_COMPILER_C1XX #pragma warning(disable: 4244) // conversion from 'X' to 'Y', possible loss of data #endif diff --git a/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp index 9d93bad370d07..64997d382dd9c 100644 --- a/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp +++ b/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp @@ -17,14 +17,27 @@ #include <sstream> #include <cassert> +template <typename Char, typename Traits = std::char_traits<Char> > +struct my_streambuf : public std::basic_streambuf<Char,Traits> { + typedef typename std::basic_streambuf<Char,Traits>::int_type int_type; + typedef typename std::basic_streambuf<Char,Traits>::char_type char_type; + + my_streambuf() {} + int_type sputc(char_type) { return Traits::eof(); } + }; + int main() { { - std::ostreambuf_iterator<char> i(nullptr); + my_streambuf<char> buf; + std::ostreambuf_iterator<char> i(&buf); + i = 'a'; assert(i.failed()); } { - std::ostreambuf_iterator<wchar_t> i(nullptr); + my_streambuf<wchar_t> buf; + std::ostreambuf_iterator<wchar_t> i(&buf); + i = L'a'; assert(i.failed()); } } diff --git a/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp b/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp new file mode 100644 index 0000000000000..f146dace65ee2 --- /dev/null +++ b/test/std/language.support/cmp/cmp.common/common_comparison_category.pass.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// template <class ...Ts> struct common_comparison_category +// template <class ...Ts> using common_comparison_category_t + + +#include <compare> +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +const volatile void* volatile sink; + +template <class Expect, class ...Args> +void test_cat() { + using Cat = std::common_comparison_category<Args...>; + using CatT = typename Cat::type; + static_assert(std::is_same<CatT, std::common_comparison_category_t<Args...>>::value, ""); + static_assert(std::is_same<CatT, Expect>::value, "expected different category"); +}; + + +// [class.spaceship]p4: The 'common comparison type' U of a possibly-empty list +// of 'n' types T0, T1, ..., TN, is defined as follows: +int main() { + using WE = std::weak_equality; + using SE = std::strong_equality; + using PO = std::partial_ordering; + using WO = std::weak_ordering; + using SO = std::strong_ordering; + + // [class.spaceship]p4.1: If any Ti is not a comparison category tpe, U is void. + { + test_cat<void, void>(); + test_cat<void, int*>(); + test_cat<void, SO&>(); + test_cat<void, SO const>(); + test_cat<void, SO*>(); + test_cat<void, SO, void, SO>(); + } + + // [class.spaceship]p4.2: Otherwise, if at least on Ti is + // std::weak_equality, or at least one Ti is std::strong_equality and at least + // one Tj is std::partial_ordering or std::weak_ordering, U is std::weak_equality + { + test_cat<WE, WE>(); + test_cat<WE, SO, WE, SO>(); + test_cat<WE, SE, SO, PO>(); + test_cat<WE, WO, SO, SE>(); + } + + // [class.spaceship]p4.3: Otherwise, if at least one Ti is std::strong_equality, + // U is std::strong_equality + { + test_cat<SE, SE>(); + test_cat<SE, SO, SE, SO>(); + } + + // [class.spaceship]p4.4: Otherwise, if at least one Ti is std::partial_ordering, + // U is std::partial_ordering + { + test_cat<PO, PO>(); + test_cat<PO, SO, PO, SO>(); + test_cat<PO, WO, PO, SO>(); + } + + // [class.spaceship]p4.5: Otherwise, if at least one Ti is std::weak_ordering, + // U is std::weak_ordering + { + test_cat<WO, WO>(); + test_cat<WO, SO, WO, SO>(); + } + + // [class.spaceship]p4.6: Otherwise, U is std::strong_ordering. [Note: in + // particular this is the result when n is 0. -- end note] + { + test_cat<SO>(); // empty type list + test_cat<SO, SO>(); + test_cat<SO, SO, SO>(); + } +} diff --git a/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp b/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp new file mode 100644 index 0000000000000..a80477151ef25 --- /dev/null +++ b/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp @@ -0,0 +1,164 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// class partial_ordering + + +#include <compare> +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +const volatile void* volatile sink; + +void test_static_members() { + DoNotOptimize(&std::partial_ordering::less); + DoNotOptimize(&std::partial_ordering::equivalent); + DoNotOptimize(&std::partial_ordering::greater); + DoNotOptimize(&std::partial_ordering::unordered); +} + +void test_signatures() { + auto& Eq = std::partial_ordering::equivalent; + + ASSERT_NOEXCEPT(Eq == 0); + ASSERT_NOEXCEPT(0 == Eq); + ASSERT_NOEXCEPT(Eq != 0); + ASSERT_NOEXCEPT(0 != Eq); + ASSERT_NOEXCEPT(0 < Eq); + ASSERT_NOEXCEPT(Eq < 0); + ASSERT_NOEXCEPT(0 <= Eq); + ASSERT_NOEXCEPT(Eq <= 0); + ASSERT_NOEXCEPT(0 > Eq); + ASSERT_NOEXCEPT(Eq > 0); + ASSERT_NOEXCEPT(0 >= Eq); + ASSERT_NOEXCEPT(Eq >= 0); +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + ASSERT_NOEXCEPT(0 <=> Eq); + ASSERT_NOEXCEPT(Eq <=> 0); + ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::partial_ordering); + ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::partial_ordering); +#endif +} + +constexpr bool test_conversion() { + static_assert(std::is_convertible<const std::partial_ordering, std::weak_equality>::value, ""); + { // value == 0 + auto V = std::partial_ordering::equivalent; + std::weak_equality WV = V; + assert(WV == 0); + } + std::partial_ordering TestCases[] = { + std::partial_ordering::less, + std::partial_ordering::greater, + std::partial_ordering::unordered + }; + for (auto V : TestCases) + { // value != 0 + std::weak_equality WV = V; + assert(WV != 0); + } + return true; +} + +constexpr bool test_constexpr() { + auto& Eq = std::partial_ordering::equivalent; + auto& Less = std::partial_ordering::less; + auto& Greater = std::partial_ordering::greater; + auto& Unord = std::partial_ordering::unordered; + struct { + std::partial_ordering Value; + bool ExpectEq; + bool ExpectNeq; + bool ExpectLess; + bool ExpectGreater; + } TestCases[] = { + {Eq, true, false, false, false}, + {Less, false, true, true, false}, + {Greater, false, true, false, true}, + {Unord, false, true, false, false} + }; + for (auto TC : TestCases) { + auto V = TC.Value; + assert((V == 0) == TC.ExpectEq); + assert((0 == V) == TC.ExpectEq); + assert((V != 0) == TC.ExpectNeq); + assert((0 != V) == TC.ExpectNeq); + + assert((V < 0) == TC.ExpectLess); + assert((V > 0) == TC.ExpectGreater); + assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq)); + assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq)); + + assert((0 < V) == TC.ExpectGreater); + assert((0 > V) == TC.ExpectLess); + assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq)); + assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq)); + } +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + { + std::partial_ordering res = (Eq <=> 0); + ((void)res); + res = (0 <=> Eq); + ((void)res); + } + enum ExpectRes { + ER_Greater, + ER_Less, + ER_Equiv, + ER_Unord + }; + struct { + std::partial_ordering Value; + ExpectRes Expect; + } SpaceshipTestCases[] = { + {std::partial_ordering::equivalent, ER_Equiv}, + {std::partial_ordering::less, ER_Less}, + {std::partial_ordering::greater, ER_Greater}, + {std::partial_ordering::unordered, ER_Unord} + }; + for (auto TC : SpaceshipTestCases) + { + std::partial_ordering Res = (0 <=> TC.Value); + switch (TC.Expect) { + case ER_Equiv: + assert(Res == 0); + assert(0 == Res); + break; + case ER_Less: + assert(Res < 0); + break; + case ER_Greater: + assert(Res > 0); + break; + case ER_Unord: + assert(Res != 0); + assert(0 != Res); + assert((Res < 0) == false); + assert((Res > 0) == false); + assert((Res == 0) == false); + break; + } + } +#endif + + return true; +} + +int main() { + test_static_members(); + test_signatures(); + static_assert(test_conversion(), "conversion test failed"); + static_assert(test_constexpr(), "constexpr test failed"); +} diff --git a/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp b/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp new file mode 100644 index 0000000000000..07fc26eed5b18 --- /dev/null +++ b/test/std/language.support/cmp/cmp.strongeq/cmp.strongeq.pass.cpp @@ -0,0 +1,96 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// class strong_equality + + +#include <compare> +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +const volatile void* volatile sink; + +void test_static_members() { + DoNotOptimize(&std::strong_equality::equal); + DoNotOptimize(&std::strong_equality::nonequal); + DoNotOptimize(&std::strong_equality::equivalent); + DoNotOptimize(&std::strong_equality::nonequivalent); +} + +void test_signatures() { + auto& Eq = std::strong_equality::equivalent; + + ASSERT_NOEXCEPT(Eq == 0); + ASSERT_NOEXCEPT(0 == Eq); + ASSERT_NOEXCEPT(Eq != 0); + ASSERT_NOEXCEPT(0 != Eq); +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + ASSERT_NOEXCEPT(0 <=> Eq); + ASSERT_NOEXCEPT(Eq <=> 0); + ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_equality); + ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_equality); +#endif +} + +void test_conversion() { + constexpr std::weak_equality res = std::strong_equality::equivalent; + static_assert(res == 0, ""); + static_assert(std::is_convertible<const std::strong_equality&, + std::weak_equality>::value, ""); + static_assert(res == 0, "expected equal"); + + constexpr std::weak_equality neq_res = std::strong_equality::nonequivalent; + static_assert(neq_res != 0, "expected not equal"); +} + +constexpr bool test_constexpr() { + auto& Eq = std::strong_equality::equal; + auto& NEq = std::strong_equality::nonequal; + auto& Equiv = std::strong_equality::equivalent; + auto& NEquiv = std::strong_equality::nonequivalent; + assert((Eq == 0) == true); + assert((0 == Eq) == true); + assert((Equiv == 0) == true); + assert((0 == Equiv) == true); + assert((NEq == 0) == false); + assert((0 == NEq) == false); + assert((NEquiv == 0) == false); + assert((0 == NEquiv) == false); + + assert((Eq != 0) == false); + assert((0 != Eq) == false); + assert((Equiv != 0) == false); + assert((0 != Equiv) == false); + assert((NEq != 0) == true); + assert((0 != NEq) == true); + assert((NEquiv != 0) == true); + assert((0 != NEquiv) == true); + +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + std::strong_equality res = (Eq <=> 0); + ((void)res); + res = (0 <=> Eq); + ((void)res); +#endif + + return true; +} + +int main() { + test_static_members(); + test_signatures(); + test_conversion(); + static_assert(test_constexpr(), "constexpr test failed"); +} diff --git a/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp b/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp new file mode 100644 index 0000000000000..0bdd68679b441 --- /dev/null +++ b/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp @@ -0,0 +1,212 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// class strong_ordering + + +#include <compare> +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +const volatile void* volatile sink; + +void test_static_members() { + DoNotOptimize(&std::strong_ordering::less); + DoNotOptimize(&std::strong_ordering::equal); + DoNotOptimize(&std::strong_ordering::equivalent); + DoNotOptimize(&std::strong_ordering::greater); +} + +void test_signatures() { + auto& Eq = std::strong_ordering::equivalent; + + ASSERT_NOEXCEPT(Eq == 0); + ASSERT_NOEXCEPT(0 == Eq); + ASSERT_NOEXCEPT(Eq != 0); + ASSERT_NOEXCEPT(0 != Eq); + ASSERT_NOEXCEPT(0 < Eq); + ASSERT_NOEXCEPT(Eq < 0); + ASSERT_NOEXCEPT(0 <= Eq); + ASSERT_NOEXCEPT(Eq <= 0); + ASSERT_NOEXCEPT(0 > Eq); + ASSERT_NOEXCEPT(Eq > 0); + ASSERT_NOEXCEPT(0 >= Eq); + ASSERT_NOEXCEPT(Eq >= 0); +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + ASSERT_NOEXCEPT(0 <=> Eq); + ASSERT_NOEXCEPT(Eq <=> 0); + ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::strong_ordering); + ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::strong_ordering); +#endif +} + +constexpr bool test_conversion() { + static_assert(std::is_convertible<const std::strong_ordering&, + std::weak_equality>::value, ""); + { // value == 0 + auto V = std::strong_ordering::equivalent; + std::weak_equality WV = V; + assert(WV == 0); + } + std::strong_ordering WeakTestCases[] = { + std::strong_ordering::less, + std::strong_ordering::greater, + }; + for (auto V : WeakTestCases) + { // value != 0 + std::weak_equality WV = V; + assert(WV != 0); + } + static_assert(std::is_convertible<const std::strong_ordering&, + std::strong_equality>::value, ""); + { // value == 0 + auto V = std::strong_ordering::equivalent; + std::strong_equality WV = V; + assert(WV == 0); + } + { // value == 0 + auto V = std::strong_ordering::equal; + std::strong_equality WV = V; + assert(WV == 0); + } + std::strong_ordering StrongTestCases[] = { + std::strong_ordering::less, + std::strong_ordering::greater, + }; + for (auto V : StrongTestCases) + { // value != 0 + std::strong_equality WV = V; + assert(WV != 0); + } + + static_assert(std::is_convertible<const std::strong_ordering&, + std::partial_ordering>::value, ""); + { // value == 0 + auto V = std::strong_ordering::equivalent; + std::partial_ordering WV = V; + assert(WV == 0); + } + { // value < 0 + auto V = std::strong_ordering::less; + std::partial_ordering WV = V; + assert(WV < 0); + } + { // value > 0 + auto V = std::strong_ordering::greater; + std::partial_ordering WV = V; + assert(WV > 0); + } + + static_assert(std::is_convertible<const std::strong_ordering&, + std::weak_ordering>::value, ""); + { // value == 0 + auto V = std::strong_ordering::equivalent; + std::weak_ordering WV = V; + assert(WV == 0); + } + { // value < 0 + auto V = std::strong_ordering::less; + std::weak_ordering WV = V; + assert(WV < 0); + } + { // value > 0 + auto V = std::strong_ordering::greater; + std::weak_ordering WV = V; + assert(WV > 0); + } + return true; +} + +constexpr bool test_constexpr() { + auto& Eq = std::strong_ordering::equal; + auto& Equiv = std::strong_ordering::equivalent; + auto& Less = std::strong_ordering::less; + auto& Greater = std::strong_ordering::greater; + struct { + std::strong_ordering Value; + bool ExpectEq; + bool ExpectNeq; + bool ExpectLess; + bool ExpectGreater; + } TestCases[] = { + {Eq, true, false, false, false}, + {Equiv, true, false, false, false}, + {Less, false, true, true, false}, + {Greater, false, true, false, true}, + }; + for (auto TC : TestCases) { + auto V = TC.Value; + assert((V == 0) == TC.ExpectEq); + assert((0 == V) == TC.ExpectEq); + assert((V != 0) == TC.ExpectNeq); + assert((0 != V) == TC.ExpectNeq); + + assert((V < 0) == TC.ExpectLess); + assert((V > 0) == TC.ExpectGreater); + assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq)); + assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq)); + + assert((0 < V) == TC.ExpectGreater); + assert((0 > V) == TC.ExpectLess); + assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq)); + assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq)); + } +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + { + std::strong_ordering res = (Eq <=> 0); + ((void)res); + res = (0 <=> Eq); + ((void)res); + } + enum ExpectRes { + ER_Greater, + ER_Less, + ER_Equiv + }; + struct { + std::strong_ordering Value; + ExpectRes Expect; + } SpaceshipTestCases[] = { + {std::strong_ordering::equivalent, ER_Equiv}, + {std::strong_ordering::less, ER_Less}, + {std::strong_ordering::greater, ER_Greater}, + }; + for (auto TC : SpaceshipTestCases) + { + std::strong_ordering Res = (0 <=> TC.Value); + switch (TC.Expect) { + case ER_Equiv: + assert(Res == 0); + assert(0 == Res); + break; + case ER_Less: + assert(Res < 0); + break; + case ER_Greater: + assert(Res > 0); + break; + } + } +#endif + + return true; +} + +int main() { + test_static_members(); + test_signatures(); + static_assert(test_conversion(), "conversion test failed"); + static_assert(test_constexpr(), "constexpr test failed"); +} diff --git a/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp b/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp new file mode 100644 index 0000000000000..375cff460cdea --- /dev/null +++ b/test/std/language.support/cmp/cmp.weakeq/cmp.weakeq.pass.cpp @@ -0,0 +1,70 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// class weak_equality + + +#include <compare> +#include <cassert> +#include "test_macros.h" + +const volatile void* volatile sink; + +void test_static_members() { + DoNotOptimize(&std::weak_equality::equivalent); + DoNotOptimize(&std::weak_equality::nonequivalent); +} + +void test_signatures() { + auto& Eq = std::weak_equality::equivalent; + + ASSERT_NOEXCEPT(Eq == 0); + ASSERT_NOEXCEPT(0 == Eq); + ASSERT_NOEXCEPT(Eq != 0); + ASSERT_NOEXCEPT(0 != Eq); +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + ASSERT_NOEXCEPT(0 <=> Eq); + ASSERT_NOEXCEPT(Eq <=> 0); + ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_equality); + ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_equality); +#endif +} + +constexpr bool test_constexpr() { + auto& Eq = std::weak_equality::equivalent; + auto& NEq = std::weak_equality::nonequivalent; + assert((Eq == 0) == true); + assert((0 == Eq) == true); + assert((NEq == 0) == false); + assert((0 == NEq) == false); + + assert((Eq != 0) == false); + assert((0 != Eq) == false); + assert((NEq != 0) == true); + assert((0 != NEq) == true); + +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + std::weak_equality res = (Eq <=> 0); + ((void)res); + res = (0 <=> Eq); + ((void)res); +#endif + + return true; +} + +int main() { + test_static_members(); + test_signatures(); + static_assert(test_constexpr(), "constexpr test failed"); +} diff --git a/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp b/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp new file mode 100644 index 0000000000000..0a52680323b2a --- /dev/null +++ b/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp @@ -0,0 +1,169 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// <compare> + +// class weak_ordering + + +#include <compare> +#include <type_traits> +#include <cassert> + +#include "test_macros.h" + +const volatile void* volatile sink; + +void test_static_members() { + DoNotOptimize(&std::weak_ordering::less); + DoNotOptimize(&std::weak_ordering::equivalent); + DoNotOptimize(&std::weak_ordering::greater); +} + +void test_signatures() { + auto& Eq = std::weak_ordering::equivalent; + + ASSERT_NOEXCEPT(Eq == 0); + ASSERT_NOEXCEPT(0 == Eq); + ASSERT_NOEXCEPT(Eq != 0); + ASSERT_NOEXCEPT(0 != Eq); + ASSERT_NOEXCEPT(0 < Eq); + ASSERT_NOEXCEPT(Eq < 0); + ASSERT_NOEXCEPT(0 <= Eq); + ASSERT_NOEXCEPT(Eq <= 0); + ASSERT_NOEXCEPT(0 > Eq); + ASSERT_NOEXCEPT(Eq > 0); + ASSERT_NOEXCEPT(0 >= Eq); + ASSERT_NOEXCEPT(Eq >= 0); +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + ASSERT_NOEXCEPT(0 <=> Eq); + ASSERT_NOEXCEPT(Eq <=> 0); + ASSERT_SAME_TYPE(decltype(Eq <=> 0), std::weak_ordering); + ASSERT_SAME_TYPE(decltype(0 <=> Eq), std::weak_ordering); +#endif +} + +constexpr bool test_conversion() { + static_assert(std::is_convertible<const std::weak_ordering&, + std::weak_equality>::value, ""); + { // value == 0 + auto V = std::weak_ordering::equivalent; + std::weak_equality WV = V; + assert(WV == 0); + } + std::weak_ordering WeakTestCases[] = { + std::weak_ordering::less, + std::weak_ordering::greater, + }; + for (auto V : WeakTestCases) + { // value != 0 + std::weak_equality WV = V; + assert(WV != 0); + } + static_assert(std::is_convertible<const std::weak_ordering&, + std::partial_ordering>::value, ""); + { // value == 0 + auto V = std::weak_ordering::equivalent; + std::partial_ordering WV = V; + assert(WV == 0); + } + { // value < 0 + auto V = std::weak_ordering::less; + std::partial_ordering WV = V; + assert(WV < 0); + } + { // value > 0 + auto V = std::weak_ordering::greater; + std::partial_ordering WV = V; + assert(WV > 0); + } + return true; +} + +constexpr bool test_constexpr() { + auto& Eq = std::weak_ordering::equivalent; + auto& Less = std::weak_ordering::less; + auto& Greater = std::weak_ordering::greater; + struct { + std::weak_ordering Value; + bool ExpectEq; + bool ExpectNeq; + bool ExpectLess; + bool ExpectGreater; + } TestCases[] = { + {Eq, true, false, false, false}, + {Less, false, true, true, false}, + {Greater, false, true, false, true}, + }; + for (auto TC : TestCases) { + auto V = TC.Value; + assert((V == 0) == TC.ExpectEq); + assert((0 == V) == TC.ExpectEq); + assert((V != 0) == TC.ExpectNeq); + assert((0 != V) == TC.ExpectNeq); + + assert((V < 0) == TC.ExpectLess); + assert((V > 0) == TC.ExpectGreater); + assert((V <= 0) == (TC.ExpectLess || TC.ExpectEq)); + assert((V >= 0) == (TC.ExpectGreater || TC.ExpectEq)); + + assert((0 < V) == TC.ExpectGreater); + assert((0 > V) == TC.ExpectLess); + assert((0 <= V) == (TC.ExpectGreater || TC.ExpectEq)); + assert((0 >= V) == (TC.ExpectLess || TC.ExpectEq)); + } +#ifndef TEST_HAS_NO_SPACESHIP_OPERATOR + { + std::weak_ordering res = (Eq <=> 0); + ((void)res); + res = (0 <=> Eq); + ((void)res); + } + enum ExpectRes { + ER_Greater, + ER_Less, + ER_Equiv + }; + struct { + std::weak_ordering Value; + ExpectRes Expect; + } SpaceshipTestCases[] = { + {std::weak_ordering::equivalent, ER_Equiv}, + {std::weak_ordering::less, ER_Less}, + {std::weak_ordering::greater, ER_Greater}, + }; + for (auto TC : SpaceshipTestCases) + { + std::weak_ordering Res = (0 <=> TC.Value); + switch (TC.Expect) { + case ER_Equiv: + assert(Res == 0); + assert(0 == Res); + break; + case ER_Less: + assert(Res < 0); + break; + case ER_Greater: + assert(Res > 0); + break; + } + } +#endif + + return true; +} + +int main() { + test_static_members(); + test_signatures(); + static_assert(test_conversion(), "conversion test failed"); + static_assert(test_constexpr(), "constexpr test failed"); +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp index 828feabd21277..2175e29a040dc 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp @@ -69,31 +69,32 @@ void operator delete [] (void* p, std::align_val_t) TEST_NOEXCEPT struct alignas(OverAligned) A {}; struct alignas(std::max_align_t) B {}; -B* volatile b; // Escape the memory -A* volatile a; - int main() { reset(); { - b = new B[2]; + B *b = new B[2]; + DoNotOptimize(b); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); delete [] b; + DoNotOptimize(b); assert(1 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); } reset(); { - a = new A[2]; + A *a = new A[2]; + DoNotOptimize(a); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); delete [] a; + DoNotOptimize(a); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(1 == aligned_delete_called); diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp index 82dc77efe89ee..d8e08a3a0bdbf 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp @@ -53,7 +53,9 @@ void* operator new[](std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad assert(s <= sizeof(DummyData)); assert(static_cast<std::size_t>(a) == OverAligned); ++new_called; - return DummyData; + void *Ret = DummyData; + DoNotOptimize(Ret); + return Ret; } void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT @@ -61,6 +63,7 @@ void operator delete[](void* p, std::align_val_t) TEST_NOEXCEPT assert(new_called == 1); --new_called; assert(p == DummyData); + DoNotOptimize(p); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp index 5aecc2da0847d..58ff728e6332f 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp @@ -41,8 +41,8 @@ int main() std::set_new_handler(my_new_handler); try { - void* volatile vp = operator new[] (std::numeric_limits<std::size_t>::max()); - ((void)vp); + void* vp = operator new[] (std::numeric_limits<std::size_t>::max()); + DoNotOptimize(vp); assert(false); } catch (std::bad_alloc&) @@ -55,8 +55,10 @@ int main() } #endif A* ap = new A[3]; + DoNotOptimize(ap); assert(ap); assert(A_constructed == 3); delete [] ap; + DoNotOptimize(ap); assert(A_constructed == 0); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp index c1606b27da79f..f29f0c09e4f3e 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp @@ -42,7 +42,8 @@ int main() try #endif { - void*volatile vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow); + void* vp = operator new [] (std::numeric_limits<std::size_t>::max(), std::nothrow); + DoNotOptimize(vp); assert(new_handler_called == 1); assert(vp == 0); } @@ -53,8 +54,10 @@ int main() } #endif A* ap = new(std::nothrow) A[3]; + DoNotOptimize(ap); assert(ap); assert(A_constructed == 3); delete [] ap; + DoNotOptimize(ap); assert(A_constructed == 0); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp index ba3f930c5f14a..3d8467faa3e8b 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp @@ -36,7 +36,7 @@ void operator delete(void* p) TEST_NOEXCEPT std::free(p); } -volatile int A_constructed = 0; +int A_constructed = 0; struct A { @@ -44,15 +44,15 @@ struct A ~A() {--A_constructed;} }; -A* volatile ap; - int main() { - ap = new (std::nothrow) A[3]; + A *ap = new (std::nothrow) A[3]; + DoNotOptimize(ap); assert(ap); assert(A_constructed == 3); assert(new_called); delete [] ap; + DoNotOptimize(ap); assert(A_constructed == 0); assert(!new_called); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp index 3f8122745cc4f..ad4d9f469d42a 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp @@ -21,7 +21,7 @@ #include "test_macros.h" -volatile int new_called = 0; +int new_called = 0; void* operator new(std::size_t s) TEST_THROW_SPEC(std::bad_alloc) { @@ -45,15 +45,15 @@ struct A ~A() {--A_constructed;} }; -A* volatile ap; - int main() { - ap = new A[3]; + A *ap = new A[3]; + DoNotOptimize(ap); assert(ap); assert(A_constructed == 3); assert(new_called == 1); delete [] ap; + DoNotOptimize(ap); assert(A_constructed == 0); assert(new_called == 0); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp index 862318d0be7b0..ef9ec2db9d199 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp @@ -12,7 +12,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17 +// UNSUPPORTED: c++14, c++17, c++2a // UNSUPPORTED: sanitizer-new-delete #include <new> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp index 3925f2f5c3136..a988b803d2d5c 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_calls_unsized_delete_array.pass.cpp @@ -46,15 +46,15 @@ void operator delete[](void* p, const std::nothrow_t&) TEST_NOEXCEPT // selected. struct A { ~A() {} }; -A *volatile x; - int main() { - x = new A[3]; + A *x = new A[3]; + DoNotOptimize(x); assert(0 == delete_called); assert(0 == delete_nothrow_called); delete [] x; + DoNotOptimize(x); assert(1 == delete_called); assert(0 == delete_nothrow_called); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp index 83d5e80e87e42..61172fb5abe6f 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp @@ -21,6 +21,6 @@ int main () { - char buffer[100]; + char buffer[100]; ::operator new[](4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp index 9d3892cb0a81e..def8839c46d92 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp @@ -21,6 +21,6 @@ int main () { - char buffer[100]; + char buffer[100]; ::operator new(4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp index d64a633007e76..6f1c7511243ee 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp @@ -68,31 +68,32 @@ void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT struct alignas(OverAligned) A {}; struct alignas(std::max_align_t) B {}; -B* volatile bp; -A* volatile ap; - int main() { reset(); { - bp = new B; + B *bp = new B; + DoNotOptimize(bp); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); delete bp; + DoNotOptimize(bp); assert(1 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); } reset(); { - ap = new A; + A *ap = new A; + DoNotOptimize(ap); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == aligned_delete_called); delete ap; + DoNotOptimize(ap); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(1 == aligned_delete_called); diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp index bace5c036e0c5..2dd4631e7f6dd 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp @@ -53,7 +53,9 @@ void* operator new(std::size_t s, std::align_val_t a) TEST_THROW_SPEC(std::bad_a assert(s <= sizeof(DummyData)); assert(static_cast<std::size_t>(a) == OverAligned); ++new_called; - return DummyData; + void *Ret = DummyData; + DoNotOptimize(Ret); + return Ret; } void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT @@ -61,6 +63,7 @@ void operator delete(void* p, std::align_val_t) TEST_NOEXCEPT assert(new_called == 1); --new_called; assert(p == DummyData); + DoNotOptimize(DummyData); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp index 31e1901511fa0..a0e3eda5765e0 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp @@ -44,15 +44,15 @@ struct A ~A() {A_constructed = false;} }; -A* volatile ap; - int main() { - ap = new (std::nothrow) A; + A *ap = new (std::nothrow) A; + DoNotOptimize(ap); assert(ap); assert(A_constructed); assert(new_called); delete ap; + DoNotOptimize(ap); assert(!A_constructed); assert(!new_called); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp index ea6c9367b9034..aa00fee56e10e 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp @@ -43,15 +43,15 @@ struct A ~A() {A_constructed = false;} }; -A *volatile ap; - int main() { - ap = new A; + A *ap = new A; + DoNotOptimize(ap); assert(ap); assert(A_constructed); assert(new_called); delete ap; + DoNotOptimize(ap); assert(!A_constructed); assert(!new_called); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp index 945bf779a893a..d9e0f5ca364d0 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp @@ -12,7 +12,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17 +// UNSUPPORTED: c++14, c++17, c++2a // UNSUPPORTED: sanitizer-new-delete #include <new> @@ -44,16 +44,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT std::free(p); } -int *volatile x; - int main() { - x = new int(42); + int *x = new int(42); + DoNotOptimize(x); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == sized_delete_called); delete x; + DoNotOptimize(x); assert(1 == unsized_delete_called); assert(0 == sized_delete_called); assert(0 == unsized_delete_nothrow_called); diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp index 7a76725a9751f..5b08eb4b85694 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp @@ -49,16 +49,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT std::free(p); } -int *volatile x; - int main() { - x = new int(42); + int *x = new int(42); + DoNotOptimize(x); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); assert(0 == sized_delete_called); delete x; + DoNotOptimize(x); assert(0 == unsized_delete_called); assert(1 == sized_delete_called); assert(0 == unsized_delete_nothrow_called); diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp index cb093f3637ce2..178e26db174a1 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_calls_unsized_delete.pass.cpp @@ -35,15 +35,15 @@ void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT std::free(p); } -int* volatile x; - int main() { - x = new int(42); + int *x = new int(42); + DoNotOptimize(x); assert(0 == delete_called); assert(0 == delete_nothrow_called); delete x; + DoNotOptimize(x); assert(1 == delete_called); assert(0 == delete_nothrow_called); } diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp index 40de3a09800c7..d5b610f718027 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp @@ -62,16 +62,16 @@ void operator delete(void* p, std::size_t) TEST_NOEXCEPT std::free(p); } -int* volatile x; - int main() { - x = new int(42); + int *x = new int(42); + DoNotOptimize(x); assert(0 == sized_delete_called); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); delete x; + DoNotOptimize(x); assert(1 == sized_delete_called); assert(0 == unsized_delete_called); assert(0 == unsized_delete_nothrow_called); diff --git a/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp index 1aa462957c8b8..457696a42ade6 100644 --- a/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp +++ b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp @@ -22,14 +22,14 @@ constexpr int gi = 5; constexpr float gf = 8.f; int main() { - static_assert(std::launder(&gi) == &gi, "" ); - static_assert(std::launder(&gf) == &gf, "" ); + static_assert(std::launder(&gi) == &gi, "" ); + static_assert(std::launder(&gf) == &gf, "" ); - const int *i = &gi; - const float *f = &gf; + const int *i = &gi; + const float *f = &gf; static_assert(std::is_same<decltype(i), decltype(std::launder(i))>::value, ""); static_assert(std::is_same<decltype(f), decltype(std::launder(f))>::value, ""); - assert(std::launder(i) == i); - assert(std::launder(f) == f); + assert(std::launder(i) == i); + assert(std::launder(f) == f); } diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp index e35e7afa322ac..d030d12d26300 100644 --- a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp +++ b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp @@ -15,40 +15,48 @@ // XFAIL: availability=macosx10.9 // XFAIL: availability=macosx10.10 // XFAIL: availability=macosx10.11 +// XFAIL: with_system_cxx_lib=macosx10.12 +// XFAIL: with_system_cxx_lib=macosx10.13 // test uncaught_exceptions #include <exception> #include <cassert> -struct A -{ - ~A() - { - assert(std::uncaught_exceptions() > 0); +struct Uncaught { + Uncaught(int depth) : d_(depth) {} + ~Uncaught() { assert(std::uncaught_exceptions() == d_); } + int d_; + }; + +struct Outer { + Outer(int depth) : d_(depth) {} + ~Outer() { + try { + assert(std::uncaught_exceptions() == d_); + Uncaught u(d_+1); + throw 2; + } + catch (int) {} } + int d_; }; -struct B -{ - B() +int main () { + assert(std::uncaught_exceptions() == 0); { - // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475 - assert(std::uncaught_exceptions() == 0); + Outer o(0); } -}; -int main() -{ - try + assert(std::uncaught_exceptions() == 0); { - A a; + try { + Outer o(1); + throw 1; + } + catch (int) { assert(std::uncaught_exceptions() == 0); - throw B(); - } - catch (...) - { - assert(std::uncaught_exception() == 0); + } } assert(std::uncaught_exceptions() == 0); } diff --git a/test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp b/test/std/language.support/support.limits/version.pass.cpp index b58f5c55b643a..c41f492bbed40 100644 --- a/test/std/experimental/optional/optional.defs/tested_elsewhere.pass.cpp +++ b/test/std/language.support/support.limits/version.pass.cpp @@ -7,6 +7,11 @@ // //===----------------------------------------------------------------------===// +// <version> +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +#include <version> + int main() { } diff --git a/test/std/language.support/support.types/byte.pass.cpp b/test/std/language.support/support.types/byte.pass.cpp index 66b2a553186d8..a1abefa842828 100644 --- a/test/std/language.support/support.types/byte.pass.cpp +++ b/test/std/language.support/support.types/byte.pass.cpp @@ -9,14 +9,18 @@ #include <cstddef> #include <type_traits> -#include <test_macros.h> +#include "test_macros.h" // XFAIL: c++98, c++03, c++11, c++14 // std::byte is not an integer type, nor a character type. // It is a distinct type for accessing the bits that ultimately make up object storage. +#if TEST_STD_VER > 17 +static_assert( std::is_trivial<std::byte>::value, "" ); // P0767 +#else static_assert( std::is_pod<std::byte>::value, "" ); +#endif static_assert(!std::is_arithmetic<std::byte>::value, "" ); static_assert(!std::is_integral<std::byte>::value, "" ); diff --git a/test/std/language.support/support.types/max_align_t.pass.cpp b/test/std/language.support/support.types/max_align_t.pass.cpp index 08a6c28a4c19a..b7fe0ac647e06 100644 --- a/test/std/language.support/support.types/max_align_t.pass.cpp +++ b/test/std/language.support/support.types/max_align_t.pass.cpp @@ -10,15 +10,25 @@ #include <cstddef> #include <type_traits> -// max_align_t is a POD type whose alignment requirement is at least as -// great as that of every scalar type +// max_align_t is a trivial standard-layout type whose alignment requirement +// is at least as great as that of every scalar type #include <stdio.h> +#include "test_macros.h" int main() { + +#if TEST_STD_VER > 17 +// P0767 + static_assert(std::is_trivial<std::max_align_t>::value, + "std::is_trivial<std::max_align_t>::value"); + static_assert(std::is_standard_layout<std::max_align_t>::value, + "std::is_standard_layout<std::max_align_t>::value"); +#else static_assert(std::is_pod<std::max_align_t>::value, "std::is_pod<std::max_align_t>::value"); +#endif static_assert((std::alignment_of<std::max_align_t>::value >= std::alignment_of<long long>::value), "std::alignment_of<std::max_align_t>::value >= " diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp index 8f51d12d7c758..1070fa613e536 100644 --- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp +++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp @@ -55,7 +55,7 @@ int main() assert(f.widen('.') == L'.'); assert(f.widen('a') == L'a'); assert(f.widen('1') == L'1'); -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) assert(f.widen(char(-5)) == L'\u00fb'); #else assert(f.widen(char(-5)) == wchar_t(-1)); diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp index 7a382c4dfa2cd..9b841b28ba07c 100644 --- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp +++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp @@ -61,7 +61,7 @@ int main() assert(v[3] == L'.'); assert(v[4] == L'a'); assert(v[5] == L'1'); -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) assert(v[6] == L'\x85'); #else assert(v[6] == wchar_t(-1)); diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp index 5656f73ee9d2f..bebc1f27bb34b 100644 --- a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp @@ -25,6 +25,7 @@ #include "test_iterators.h" #include "platform_support.h" // locale name macros +#include "test_macros.h" typedef std::money_get<char, input_iterator<const char*> > Fn; @@ -46,6 +47,33 @@ public: : Fw(refs) {} }; + +// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep. +// this function converts the spaces in string inputs to that character if need +// be. +static std::wstring convert_thousands_sep(std::wstring const& in) { +#ifndef TEST_GLIBC_PREREQ +#define TEST_GLIBC_PREREQ(x, y) 0 +#endif +#if TEST_GLIBC_PREREQ(2,27) + std::wstring out; + unsigned I = 0; + bool seen_decimal = false; + for (; I < in.size(); ++I) { + if (seen_decimal || in[I] != L' ') { + seen_decimal |= in[I] == L','; + out.push_back(in[I]); + continue; + } + assert(in[I] == L' '); + out.push_back(L'\u202F'); + } + return out; +#else + return in; +#endif +} + int main() { std::ios ios(0); @@ -417,7 +445,7 @@ int main() assert(ex == -1); } { // positive - std::wstring v = L"1 234 567,89 "; + std::wstring v = convert_thousands_sep(L"1 234 567,89 "); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -428,7 +456,7 @@ int main() assert(ex == 123456789); } { // negative - std::wstring v = L"-1 234 567,89"; + std::wstring v = convert_thousands_sep(L"-1 234 567,89"); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -497,7 +525,7 @@ int main() assert(ex == -1); } { // positive, showbase - std::wstring v = L"1 234 567,89 \u20ac"; // EURO SIGN + std::wstring v = convert_thousands_sep(L"1 234 567,89 \u20ac"); // EURO SIGN typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -508,7 +536,7 @@ int main() assert(ex == 123456789); } { // positive, showbase - std::wstring v = L"1 234 567,89 \u20ac"; // EURO SIGN + std::wstring v = convert_thousands_sep(L"1 234 567,89 \u20ac"); // EURO SIGN showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -521,7 +549,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"-1 234 567,89 \u20ac"; // EURO SIGN + std::wstring v = convert_thousands_sep(L"-1 234 567,89 \u20ac"); // EURO SIGN showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -534,7 +562,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"1 234 567,89 EUR -"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR -"); showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -546,7 +574,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"1 234 567,89 EUR -"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR -"); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -583,7 +611,7 @@ int main() assert(ex == -1); } { // positive - std::wstring v = L"1 234 567,89 "; + std::wstring v = convert_thousands_sep(L"1 234 567,89 "); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -594,7 +622,7 @@ int main() assert(ex == 123456789); } { // negative - std::wstring v = L"-1 234 567,89"; + std::wstring v = convert_thousands_sep(L"-1 234 567,89"); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -663,7 +691,7 @@ int main() assert(ex == -1); } { // positive, showbase - std::wstring v = L"1 234 567,89 EUR"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR"); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; @@ -674,7 +702,7 @@ int main() assert(ex == 123456789); } { // positive, showbase - std::wstring v = L"1 234 567,89 EUR"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 EUR"); showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -687,7 +715,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"-1 234 567,89 EUR"; + std::wstring v = convert_thousands_sep(L"-1 234 567,89 EUR"); showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -700,7 +728,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"1 234 567,89 Eu-"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 Eu-"); showbase(ios); typedef input_iterator<const wchar_t*> I; long double ex; @@ -712,7 +740,7 @@ int main() noshowbase(ios); } { // negative, showbase - std::wstring v = L"1 234 567,89 Eu-"; + std::wstring v = convert_thousands_sep(L"1 234 567,89 Eu-"); typedef input_iterator<const wchar_t*> I; long double ex; std::ios_base::iostate err = std::ios_base::goodbit; diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp index 8b620bca376d6..2b431dc529d84 100644 --- a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp @@ -25,6 +25,7 @@ #include "test_iterators.h" #include "platform_support.h" // locale name macros +#include "test_macros.h" typedef std::money_put<char, output_iterator<char*> > Fn; @@ -46,6 +47,35 @@ public: : Fw(refs) {} }; + +// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep. +// this function converts the spaces in string inputs to that character if need +// be. +static std::wstring convert_thousands_sep(std::wstring const& in) { +#ifndef TEST_GLIBC_PREREQ +#define TEST_GLIBC_PREREQ(x, y) 0 +#endif +#if TEST_GLIBC_PREREQ(2,27) + std::wstring out; + unsigned I = 0; + bool seen_num_start = false; + bool seen_decimal = false; + for (; I < in.size(); ++I) { + seen_decimal |= in[I] == L','; + seen_num_start |= in[I] == '-' || std::iswdigit(in[I]); + if (seen_decimal || !seen_num_start || in[I] != L' ') { + out.push_back(in[I]); + continue; + } + assert(in[I] == L' '); + out.push_back(L'\u202F'); + } + return out; +#else + return in; +#endif +} + int main() { std::ios ios(0); @@ -301,7 +331,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"1 234 567,89"); + assert(ex == convert_thousands_sep(L"1 234 567,89")); } { // negative long double v = -123456789; @@ -309,7 +339,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89"); + assert(ex == convert_thousands_sep(L"-1 234 567,89")); } { // zero, showbase long double v = 0; @@ -336,7 +366,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"1 234 567,89 \u20ac"); + assert(ex == convert_thousands_sep(L"1 234 567,89 \u20ac")); } { // negative, showbase long double v = -123456789; @@ -345,7 +375,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 \u20ac"); + assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac")); } { // negative, showbase, left long double v = -123456789; @@ -356,7 +386,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 \u20ac "); + assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac ")); assert(ios.width() == 0); } { // negative, showbase, internal @@ -368,7 +398,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 \u20ac"); + assert(ex == convert_thousands_sep(L"-1 234 567,89 \u20ac")); assert(ios.width() == 0); } { // negative, showbase, right @@ -380,7 +410,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), false, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L" -1 234 567,89 \u20ac"); + assert(ex == convert_thousands_sep(L" -1 234 567,89 \u20ac")); assert(ios.width() == 0); } @@ -409,7 +439,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"1 234 567,89"); + assert(ex == convert_thousands_sep(L"1 234 567,89")); } { // negative long double v = -123456789; @@ -417,7 +447,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89"); + assert(ex == convert_thousands_sep(L"-1 234 567,89")); } { // zero, showbase long double v = 0; @@ -444,7 +474,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"1 234 567,89 EUR"); + assert(ex == convert_thousands_sep(L"1 234 567,89 EUR")); } { // negative, showbase long double v = -123456789; @@ -453,7 +483,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, '*', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 EUR"); + assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR")); } { // negative, showbase, left long double v = -123456789; @@ -464,7 +494,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 EUR "); + assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR ")); assert(ios.width() == 0); } { // negative, showbase, internal @@ -476,7 +506,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L"-1 234 567,89 EUR"); + assert(ex == convert_thousands_sep(L"-1 234 567,89 EUR")); assert(ios.width() == 0); } { // negative, showbase, right @@ -488,7 +518,7 @@ int main() output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str), true, ios, ' ', v); std::wstring ex(str, iter.base()); - assert(ex == L" -1 234 567,89 EUR"); + assert(ex == convert_thousands_sep(L" -1 234 567,89 EUR")); assert(ios.width() == 0); } } diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp index 4051d451fcb67..e1c616c55233a 100644 --- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp +++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp @@ -110,7 +110,11 @@ int main() assert(f.decimal_point() == L','); } // GLIBC 2.23 uses '.' as the decimal point while other C libraries use ',' -#ifndef TEST_HAS_GLIBC +// GLIBC 2.27 corrects this +#ifndef TEST_GLIBC_PREREQ +#define TEST_GLIBC_PREREQ(x, y) 0 +#endif +#if !defined(TEST_HAS_GLIBC) || TEST_GLIBC_PREREQ(2, 27) const char sep = ','; const wchar_t wsep = L','; #else diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp index aa585a436e6ed..ca8abf09b8309 100644 --- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -92,7 +92,6 @@ int main() Fwt f(LOCALE_en_US_UTF_8, 1); assert(f.thousands_sep() == L','); } - { Fnf f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); @@ -101,13 +100,22 @@ int main() Fnt f(LOCALE_fr_FR_UTF_8, 1); assert(f.thousands_sep() == ' '); } +// The below tests work around GLIBC's use of U202F as mon_thousands_sep. +#ifndef TEST_GLIBC_PREREQ +#define TEST_GLIBC_PREREQ(x, y) 0 +#endif +#if defined(TEST_HAS_GLIBC) && TEST_GLIBC_PREREQ(2, 27) + const wchar_t fr_sep = L'\u202F'; +#else + const wchar_t fr_sep = L' '; +#endif { Fwf f(LOCALE_fr_FR_UTF_8, 1); - assert(f.thousands_sep() == L' '); + assert(f.thousands_sep() == fr_sep); } { Fwt f(LOCALE_fr_FR_UTF_8, 1); - assert(f.thousands_sep() == L' '); + assert(f.thousands_sep() == fr_sep); } // The below tests work around GLIBC's use of U00A0 as mon_thousands_sep // and U002E as mon_decimal_point. @@ -116,6 +124,11 @@ int main() #ifndef TEST_HAS_GLIBC const char sep = ' '; const wchar_t wsep = L' '; +#elif TEST_GLIBC_PREREQ(2, 27) + // FIXME libc++ specifically works around \u00A0 by translating it into + // a regular space. + const char sep = ' '; + const wchar_t wsep = L'\u202F'; #else // FIXME libc++ specifically works around \u00A0 by translating it into // a regular space. diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp index 6ba5a89e61e47..e2218fffb3968 100644 --- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp +++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_min_max.pass.cpp @@ -15,9 +15,17 @@ using namespace std; +template <class T> +bool check_stream_failed(std::string const& val) { + istringstream ss(val); + T result; + return !(ss >> result); +} + template<typename T> void check_limits() { + const bool is_unsigned = std::is_unsigned<T>::value; T minv = numeric_limits<T>::min(); T maxv = numeric_limits<T>::max(); @@ -36,17 +44,12 @@ void check_limits() assert(new_minv == minv); assert(new_maxv == maxv); - if(mins == "0") - mins = "-1"; - else - mins[mins.size() - 1]++; - maxs[maxs.size() - 1]++; - - istringstream maxoss2(maxs), minoss2(mins); - - assert(! (maxoss2 >> new_maxv)); - assert(! (minoss2 >> new_minv)); + assert(check_stream_failed<T>(maxs)); + if (!is_unsigned) { + mins[mins.size() - 1]++; + assert(check_stream_failed<T>(mins)); + } } int main(void) diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp new file mode 100644 index 0000000000000..bd9b3f05de7a2 --- /dev/null +++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp @@ -0,0 +1,164 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <locale> + +// class num_get<charT, InputIterator> + +// iter_type get(iter_type in, iter_type end, ios_base&, +// ios_base::iostate& err, unsigned int& v) const; + +#include <locale> +#include <ios> +#include <cassert> +#include <streambuf> +#include <sstream> +#include <iostream> +#include "test_iterators.h" +#include "test_macros.h" + +#ifdef TEST_COMPILER_C1XX +#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned +#endif + +typedef std::num_get<char, input_iterator<const char*> > F; + +class my_facet + : public F +{ +public: + explicit my_facet(std::size_t refs = 0) + : F(refs) {} +}; + +template <class T> +std::string make_neg_string(T value) { + std::ostringstream ss; + assert(ss << value); + std::string res = ss.str(); + return '-' + res; +} + +template <class T> +void test_neg_one() { + const my_facet f(1); + std::ios ios(0); + T v = static_cast<T>(42); + { + const char str[] = "-1"; + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+sizeof(str)), + ios, err, v); + assert(iter.base() == str+sizeof(str)-1); + assert(err == ios.goodbit); + assert(v == T(-1)); + } + v = 42; + { + const char str[] = "-"; + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+sizeof(str)), + ios, err, v); + assert(iter.base() == str+sizeof(str)-1); + assert(err == ios.failbit); + assert(v == 0); + } +} + +template <class T> +void test_negate() { + typedef typename std::make_signed<T>::type SignedT; + const my_facet f(1); + std::ios ios(0); + T v = 42; + { + T value = std::numeric_limits<SignedT>::max(); + ++value; + std::string std_str = make_neg_string(value); + const char* str = std_str.data(); + size_t size = std_str.size(); + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+size+1), + ios, err, v); + assert(iter.base() == str+size); + assert(err == ios.goodbit); + T expected = -value; + assert(v == expected); + } + v = 42; + { + T value = std::numeric_limits<SignedT>::max(); + ++value; + ++value; + std::string std_str = make_neg_string(value); + const char* str = std_str.data(); + size_t size = std_str.size(); + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+size+1), + ios, err, v); + assert(iter.base() == str+size); + assert(err == ios.goodbit); + T expected = -value; + assert(v == expected); + } + v = 42; + { + T value = std::numeric_limits<T>::max(); + std::string std_str = make_neg_string(value); + const char* str = std_str.data(); + size_t size = std_str.size(); + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+size+1), + ios, err, v); + assert(iter.base() == str+size); + assert(err == ios.goodbit); + T expected = -value; + assert(v == expected); + } + v = 42; + { + std::string std_str = make_neg_string(std::numeric_limits<T>::max()); + std_str.back()++; + const char* str = std_str.data(); + size_t size = std_str.size(); + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+size+1), + ios, err, v); + assert(iter.base() == str+size); + assert(err == ios.failbit); + assert(v == T(-1)); + } +} + +int main(void) +{ + test_neg_one<long>(); + test_neg_one<long long>(); + test_neg_one<unsigned short>(); + test_neg_one<unsigned int>(); + test_neg_one<unsigned long>(); + test_neg_one<unsigned long long>(); + + test_negate<unsigned short>(); + test_negate<unsigned int>(); + test_negate<unsigned long>(); + test_negate<unsigned long long>(); +} diff --git a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp index 38cbcfda4f055..0dedf78c9e81f 100644 --- a/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp +++ b/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp @@ -19,6 +19,7 @@ #include <locale> #include <cassert> +#include <iostream> // FIXME: for debugging purposes only #include "test_macros.h" #include "platform_support.h" // locale name macros @@ -55,7 +56,12 @@ int main() std::locale l(LOCALE_fr_FR_UTF_8); #if defined(TEST_HAS_GLIBC) const char sep = ' '; +// The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep. +# if TEST_GLIBC_PREREQ(2, 27) + const wchar_t wsep = L'\u202f'; +# else const wchar_t wsep = L' '; +# endif #else const char sep = ','; const wchar_t wsep = L','; @@ -63,6 +69,11 @@ int main() { typedef char C; const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l); + if (np.thousands_sep() != sep) { + std::cout << "np.thousands_sep() = '" << np.thousands_sep() << "'\n"; + std::cout << "sep = '" << sep << "'\n"; + std::cout << std::endl; + } assert(np.thousands_sep() == sep); } { diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp index 70204c2fb99aa..6d3947fed7fc1 100644 --- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp +++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp @@ -33,7 +33,7 @@ int main() Myconv myconv; try { - myconv.to_bytes(L"\xDA83"); + TEST_IGNORE_NODISCARD myconv.to_bytes(L"\xDA83"); assert(false); } catch (const std::range_error&) @@ -41,7 +41,7 @@ int main() } try { - myconv.from_bytes('\xA5'); + TEST_IGNORE_NODISCARD myconv.from_bytes('\xA5'); assert(false); } catch (const std::range_error&) @@ -56,7 +56,7 @@ int main() #ifndef TEST_HAS_NO_EXCEPTIONS try { - myconv.from_bytes('\xA5'); + TEST_IGNORE_NODISCARD myconv.from_bytes('\xA5'); assert(false); } catch (const std::range_error&) diff --git a/test/std/numerics/c.math/cmath.pass.cpp b/test/std/numerics/c.math/cmath.pass.cpp index b5f586492bde2..cc535e3743962 100644 --- a/test/std/numerics/c.math/cmath.pass.cpp +++ b/test/std/numerics/c.math/cmath.pass.cpp @@ -661,11 +661,12 @@ void test_isinf() static_assert((std::is_same<decltype(std::isinf((float)0)), bool>::value), ""); typedef decltype(std::isinf((double)0)) DoubleRetType; -#ifndef __linux__ +#if !defined(__linux__) || defined(__clang__) static_assert((std::is_same<DoubleRetType, bool>::value), ""); #else - // GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in - // all C++ dialects. The test should tolerate this. + // GLIBC < 2.23 defines 'isinf(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this when libc++ can't work + // around it. // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 static_assert((std::is_same<DoubleRetType, bool>::value || std::is_same<DoubleRetType, int>::value), ""); @@ -746,11 +747,12 @@ void test_isnan() static_assert((std::is_same<decltype(std::isnan((float)0)), bool>::value), ""); typedef decltype(std::isnan((double)0)) DoubleRetType; -#ifndef __linux__ +#if !defined(__linux__) || defined(__clang__) static_assert((std::is_same<DoubleRetType, bool>::value), ""); #else - // GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in - // all C++ dialects. The test should tolerate this. + // GLIBC < 2.23 defines 'isinf(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this when libc++ can't work + // around it. // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 static_assert((std::is_same<DoubleRetType, bool>::value || std::is_same<DoubleRetType, int>::value), ""); diff --git a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp index deb056d67dec0..5258bdc3a0f02 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp @@ -54,6 +54,15 @@ void test_edges() assert(r.imag() == 0); assert(std::signbit(r.imag()) == std::signbit(testcases[i].imag())); } + else if (testcases[i].real() == -1 && testcases[i].imag() == 0) + { + assert(r.real() == 0); + assert(!std::signbit(r.real())); + if (std::signbit(testcases[i].imag())) + is_about(r.imag(), -pi); + else + is_about(r.imag(), pi); + } else if (std::isfinite(testcases[i].real()) && std::isinf(testcases[i].imag())) { assert(std::isinf(r.real())); diff --git a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp index 3da56c32f1987..cb9188d935a25 100644 --- a/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp +++ b/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp @@ -44,6 +44,15 @@ void test_edges() assert(std::signbit(r.real()) == std::signbit(testcases[i].real())); assert(std::signbit(r.imag()) == std::signbit(testcases[i].imag())); } + else if (testcases[i].real() == 0 && std::abs(testcases[i].imag()) == 1) + { + assert(r.real() == 0); + assert(std::signbit(testcases[i].imag()) == std::signbit(r.imag())); + if (std::signbit(testcases[i].imag())) + is_about(r.imag(), -pi/2); + else + is_about(r.imag(), pi/2); + } else if (std::isfinite(testcases[i].real()) && std::isinf(testcases[i].imag())) { assert(std::isinf(r.real())); diff --git a/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp b/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp index 5e6cb0d523c25..69463ded2b405 100644 --- a/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp +++ b/test/std/numerics/complex.number/complex.value.ops/polar.pass.cpp @@ -11,7 +11,7 @@ // template<class T> // complex<T> -// polar(const T& rho, const T& theta = 0); +// polar(const T& rho, const T& theta = T()); // changed from '0' by LWG#2870 #include <complex> #include <cassert> diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp index 3803489c30380..da1225ae059e3 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp @@ -17,6 +17,21 @@ #include <cassert> #include <cstddef> +struct S +{ + S() : x_(0) { default_ctor_called = true; } + S(int x) : x_(x) {} + int x_; + static bool default_ctor_called; +}; + +bool S::default_ctor_called = false; + +bool operator==(const S& lhs, const S& rhs) +{ + return lhs.x_ == rhs.x_; +} + int main() { { @@ -56,4 +71,16 @@ int main() assert(v2[i][j] == v[i][j]); } } + { + typedef S T; + T a[] = {T(1), T(2), T(3), T(4), T(5)}; + const unsigned N = sizeof(a)/sizeof(a[0]); + std::valarray<T> v(a, N); + std::valarray<T> v2; + v2 = v; + assert(v2.size() == v.size()); + for (std::size_t i = 0; i < v2.size(); ++i) + assert(v2[i] == v[i]); + assert(!S::default_ctor_called); + } } diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp index 5122f44c3d80e..7923b104b2549 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp @@ -19,6 +19,21 @@ #include <cassert> #include <cstddef> +struct S +{ + S() : x_(0) { default_ctor_called = true; } + S(int x) : x_(x) {} + int x_; + static bool default_ctor_called; +}; + +bool S::default_ctor_called = false; + +bool operator==(const S& lhs, const S& rhs) +{ + return lhs.x_ == rhs.x_; +} + int main() { { @@ -55,4 +70,15 @@ int main() assert(v2[i][j] == a[i][j]); } } + { + typedef S T; + T a[] = {T(1), T(2), T(3), T(4), T(5)}; + const unsigned N = sizeof(a)/sizeof(a[0]); + std::valarray<T> v2; + v2 = {T(1), T(2), T(3), T(4), T(5)}; + assert(v2.size() == N); + for (std::size_t i = 0; i < v2.size(); ++i) + assert(v2[i] == a[i]); + assert(!S::default_ctor_called); + } } diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp index f46e0bf28cf83..9933322de96a1 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp @@ -16,6 +16,13 @@ #include <valarray> #include <cassert> +struct S { + S() { ctor_called = true; } + static bool ctor_called; +}; + +bool S::ctor_called = false; + int main() { { @@ -34,4 +41,9 @@ int main() std::valarray<std::valarray<double> > v; assert(v.size() == 0); } + { + std::valarray<S> v; + assert(v.size() == 0); + assert(!S::ctor_called); + } } diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp index 359073eb3ae90..221187c4e1247 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp @@ -16,6 +16,15 @@ #include <valarray> #include <cassert> +struct S { + S() : x(1) {} + ~S() { ++cnt_dtor; } + int x; + static size_t cnt_dtor; +}; + +size_t S::cnt_dtor = 0; + int main() { { @@ -36,4 +45,11 @@ int main() for (int i = 0; i < 100; ++i) assert(v[i].size() == 0); } + { + std::valarray<S> v(100); + assert(v.size() == 100); + for (int i = 0; i < 100; ++i) + assert(v[i].x == 1); + } + assert(S::cnt_dtor == 100); } diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp index 34181f508e2ad..7026b73c692df 100644 --- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp +++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp @@ -16,8 +16,11 @@ // #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -52,31 +55,31 @@ test() test(Iter(ia), Iter(ia + i), 0, pRes, pRes + i); } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); - std::exclusive_scan(v.begin(), v.end(), v.begin(), 50); + std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 50 + (int) i * 3); + assert(v[i] == 50 + i * 3); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); - std::exclusive_scan(v.begin(), v.end(), v.begin(), 30); + std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}); for (size_t i = 0; i < v.size(); ++i) assert(v[i] == 30 + triangle(i-1)); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); - std::exclusive_scan(v.begin(), v.end(), v.begin(), 40); + std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}); for (size_t i = 0; i < v.size(); ++i) assert(v[i] == 40 + triangle(i)); } diff --git a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp index c15cb1661e254..4fd5e236e51e6 100644 --- a/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp +++ b/test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp @@ -17,8 +17,11 @@ // T init, BinaryOperation binary_op); // C++17 #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -70,12 +73,12 @@ int main() // Make sure that the calculations are done using the init typedef { std::vector<unsigned char> v(10); - std::iota(v.begin(), v.end(), 1); - std::vector<int> res; + std::iota(v.begin(), v.end(), static_cast<unsigned char>(1)); + std::vector<size_t> res; std::exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 1, std::multiplies<>()); assert(res.size() == 10); - int j = 1; + size_t j = 1; assert(res[0] == 1); for (size_t i = 1; i < v.size(); ++i) { diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp index 5c422300e343b..2058b8e3d94f5 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp @@ -16,8 +16,11 @@ // #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -52,21 +55,21 @@ test() test(Iter(ia), Iter(ia + i), pRes, pRes + i); } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); std::inclusive_scan(v.begin(), v.end(), v.begin()); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == (int)(i+1) * 3); + assert(v[i] == (i+1) * 3); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); std::inclusive_scan(v.begin(), v.end(), v.begin()); for (size_t i = 0; i < v.size(); ++i) @@ -74,7 +77,7 @@ void basic_tests() } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); std::inclusive_scan(v.begin(), v.end(), v.begin()); for (size_t i = 0; i < v.size(); ++i) @@ -82,7 +85,7 @@ void basic_tests() } { - std::vector<int> v, res; + std::vector<size_t> v, res; std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res)); assert(res.empty()); } diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp index 2c6eacc1682fa..ca4da984121ed 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp @@ -17,9 +17,12 @@ // BinaryOperation binary_op); // C++17 #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> #include <iostream> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -58,21 +61,21 @@ test() } } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>()); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == (int)(i+1) * 3); + assert(v[i] == (i+1) * 3); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>()); for (size_t i = 0; i < v.size(); ++i) @@ -80,7 +83,7 @@ void basic_tests() } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>()); for (size_t i = 0; i < v.size(); ++i) @@ -88,7 +91,7 @@ void basic_tests() } { - std::vector<int> v, res; + std::vector<size_t> v, res; std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>()); assert(res.empty()); } diff --git a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp index 653578055c695..c3b0feb34a8ca 100644 --- a/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp +++ b/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp @@ -17,8 +17,11 @@ // BinaryOperation binary_op, T init); // C++17 #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" @@ -57,50 +60,50 @@ test() } } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); - std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 50); + std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{50}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 50 + (int)(i+1) * 3); + assert(v[i] == 50 + (i+1) * 3); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); - std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 40); + std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{40}); for (size_t i = 0; i < v.size(); ++i) assert(v[i] == 40 + triangle(i)); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); - std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), 30); + std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{30}); for (size_t i = 0; i < v.size(); ++i) assert(v[i] == 30 + triangle(i + 1)); } { - std::vector<int> v, res; - std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), 40); + std::vector<size_t> v, res; + std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), size_t{40}); assert(res.empty()); } // Make sure that the calculations are done using the init typedef { std::vector<unsigned char> v(10); - std::iota(v.begin(), v.end(), 1); - std::vector<int> res; - std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), 1); + std::iota(v.begin(), v.end(), static_cast<unsigned char>(1)); + std::vector<size_t> res; + std::inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), size_t{1}); assert(res.size() == 10); - int j = 1; + size_t j = 1; assert(res[0] == 1); for (size_t i = 1; i < v.size(); ++i) { diff --git a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp index 4964e8e884bdc..ff0cb29f4a20f 100644 --- a/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp @@ -19,26 +19,20 @@ #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> #include <iostream> +#include <iterator> +#include <vector> #include "test_iterators.h" -template <class T = void> -struct identity : std::unary_function<T, T> -{ - constexpr const T& operator()(const T& x) const { return x;} -}; - -template <> -struct identity<void> -{ - template <class T> - constexpr auto operator()(T&& x) const - _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) - -> decltype (_VSTD::forward<T>(x)) - { return _VSTD::forward<T>(x); } +struct add_one { + template <typename T> + constexpr auto operator()(T x) const noexcept { + return static_cast<T>(x + 1); + } }; template <class Iter1, class BOp, class UOp, class T, class Iter2> @@ -62,15 +56,15 @@ template <class Iter> void test() { - int ia[] = { 1, 3, 5, 7, 9}; - const int pResI0[] = { 0, 1, 4, 9, 16}; // with identity - const int mResI0[] = { 0, 0, 0, 0, 0}; - const int pResN0[] = { 0, -1, -4, -9, -16}; // with negate - const int mResN0[] = { 0, 0, 0, 0, 0}; - const int pResI2[] = { 2, 3, 6, 11, 18}; // with identity - const int mResI2[] = { 2, 2, 6, 30, 210}; - const int pResN2[] = { 2, 1, -2, -7, -14}; // with negate - const int mResN2[] = { 2, -2, 6, -30, 210}; + int ia[] = { 1, 3, 5, 7, 9 }; + const int pResI0[] = { 0, 2, 6, 12, 20 }; // with add_one + const int mResI0[] = { 0, 0, 0, 0, 0 }; + const int pResN0[] = { 0, -1, -4, -9, -16 }; // with negate + const int mResN0[] = { 0, 0, 0, 0, 0 }; + const int pResI2[] = { 2, 4, 8, 14, 22 }; // with add_one + const int mResI2[] = { 2, 4, 16, 96, 768 }; + const int pResN2[] = { 2, 1, -2, -7, -14 }; // with negate + const int mResN2[] = { 2, -2, 6, -30, 210 }; const unsigned sa = sizeof(ia) / sizeof(ia[0]); static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure @@ -82,65 +76,65 @@ test() static_assert(sa == sizeof(mResN2) / sizeof(mResN2[0])); // just to be sure for (unsigned int i = 0; i < sa; ++i ) { - test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 0, pResI0, pResI0 + i); - test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 0, mResI0, mResI0 + i); + test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 0, pResI0, pResI0 + i); + test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 0, mResI0, mResI0 + i); test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 0, pResN0, pResN0 + i); test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 0, mResN0, mResN0 + i); - test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 2, pResI2, pResI2 + i); - test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 2, mResI2, mResI2 + i); + test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 2, pResI2, pResI2 + i); + test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 2, mResI2, mResI2 + i); test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 2, pResN2, pResN2 + i); test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 2, mResN2, mResN2 + i); } } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); - std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 50, std::plus<>(), identity<>()); + std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}, std::plus<>(), add_one{}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 50 + (int) i * 3); + assert(v[i] == 50 + i * 4); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); - std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 30, std::plus<>(), identity<>()); + std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}, std::plus<>(), add_one{}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 30 + triangle(i-1)); + assert(v[i] == 30 + triangle(i - 1) + i); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); - std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 40, std::plus<>(), identity<>()); + std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}, std::plus<>(), add_one{}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 40 + triangle(i)); + assert(v[i] == 40 + triangle(i) + i); } { - std::vector<int> v, res; - std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 40, std::plus<>(), identity<>()); + std::vector<size_t> v, res; + std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), size_t{40}, std::plus<>(), add_one{}); assert(res.empty()); } // Make sure that the calculations are done using the init typedef { std::vector<unsigned char> v(10); - std::iota(v.begin(), v.end(), 1); - std::vector<int> res; - std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 1, std::multiplies<>(), identity<>()); + std::iota(v.begin(), v.end(), static_cast<unsigned char>(1)); + std::vector<size_t> res; + std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), size_t{1}, std::multiplies<>(), add_one{}); assert(res.size() == 10); - int j = 1; + size_t j = 1; assert(res[0] == 1); for (size_t i = 1; i < res.size(); ++i) { - j *= i; + j *= i + 1; assert(res[i] == j); } } diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp index d15defc2cabc1..48aeadb879dc3 100644 --- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp @@ -20,26 +20,20 @@ #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> #include <iostream> +#include <iterator> +#include <vector> #include "test_iterators.h" -template <class T = void> -struct identity : std::unary_function<T, T> -{ - constexpr const T& operator()(const T& x) const { return x;} -}; - -template <> -struct identity<void> -{ - template <class T> - constexpr auto operator()(T&& x) const - _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) - -> decltype (_VSTD::forward<T>(x)) - { return _VSTD::forward<T>(x); } +struct add_one { + template <typename T> + constexpr auto operator()(T x) const noexcept { + return static_cast<T>(x + 1); + } }; template <class Iter1, class BOp, class UOp, class Iter2> @@ -63,59 +57,59 @@ template <class Iter> void test() { - int ia[] = { 1, 3, 5, 7, 9}; - const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity - const int mResI0[] = { 1, 3, 15, 105, 945}; - const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate - const int mResN0[] = { -1, 3, -15, 105, -945}; - const unsigned sa = sizeof(ia) / sizeof(ia[0]); + int ia[] = { 1, 3, 5, 7, 9 }; + const int pResI0[] = { 2, 6, 12, 20, 30 }; // with add_one + const int mResI0[] = { 2, 8, 48, 384, 3840 }; + const int pResN0[] = { -1, -4, -9, -16, -25 }; // with negate + const int mResN0[] = { -1, 3, -15, 105, -945 }; + const unsigned sa = sizeof(ia) / sizeof(ia[0] ); static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure static_assert(sa == sizeof(pResN0) / sizeof(pResN0[0])); // just to be sure static_assert(sa == sizeof(mResN0) / sizeof(mResN0[0])); // just to be sure for (unsigned int i = 0; i < sa; ++i ) { - test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), pResI0, pResI0 + i); - test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), mResI0, mResI0 + i); + test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, pResI0, pResI0 + i); + test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, mResI0, mResI0 + i); test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), pResN0, pResN0 + i); test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), mResN0, mResN0 + i); } } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>()); - std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " ")); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}); + std::copy(v.begin(), v.end(), std::ostream_iterator<size_t>(std::cout, " ")); std::cout << std::endl; for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == (int)(i+1) * 3); + assert(v[i] == (i+1) * 4); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>()); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == triangle(i)); + assert(v[i] == triangle(i) + i + 1); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>()); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == triangle(i + 1)); + assert(v[i] == triangle(i + 1) + i + 1); } { - std::vector<int> v, res; - std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>()); + std::vector<size_t> v, res; + std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{}); assert(res.empty()); } } diff --git a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp index b38b9a5afedf9..00c4aafdf0013 100644 --- a/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp @@ -20,25 +20,19 @@ #include <numeric> -#include <vector> +#include <algorithm> #include <cassert> +#include <functional> +#include <iterator> +#include <vector> #include "test_iterators.h" -template <class T = void> -struct identity : std::unary_function<T, T> -{ - constexpr const T& operator()(const T& x) const { return x;} -}; - -template <> -struct identity<void> -{ - template <class T> - constexpr auto operator()(T&& x) const - _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) - -> decltype (_VSTD::forward<T>(x)) - { return _VSTD::forward<T>(x); } +struct add_one { + template <typename T> + constexpr auto operator()(T x) const noexcept { + return static_cast<T>(x + 1); + } }; template <class Iter1, class BOp, class UOp, class T, class Iter2> @@ -62,15 +56,15 @@ template <class Iter> void test() { - int ia[] = { 1, 3, 5, 7, 9}; - const int pResI0[] = { 1, 4, 9, 16, 25}; // with identity - const int mResI0[] = { 0, 0, 0, 0, 0}; - const int pResN0[] = { -1, -4, -9, -16, -25}; // with negate - const int mResN0[] = { 0, 0, 0, 0, 0}; - const int pResI2[] = { 3, 6, 11, 18, 27}; // with identity - const int mResI2[] = { 2, 6, 30, 210, 1890}; - const int pResN2[] = { 1, -2, -7, -14, -23}; // with negate - const int mResN2[] = { -2, 6, -30, 210, -1890}; + int ia[] = { 1, 3, 5, 7, 9 }; + const int pResI0[] = { 2, 6, 12, 20, 30 }; // with add_one + const int mResI0[] = { 0, 0, 0, 0, 0 }; + const int pResN0[] = { -1, -4, -9, -16, -25 }; // with negate + const int mResN0[] = { 0, 0, 0, 0, 0 }; + const int pResI2[] = { 4, 8, 14, 22, 32 }; // with add_one + const int mResI2[] = { 4, 16, 96, 768, 7680 }; + const int pResN2[] = { 1, -2, -7, -14, -23 }; // with negate + const int mResN2[] = { -2, 6, -30, 210, -1890 }; const unsigned sa = sizeof(ia) / sizeof(ia[0]); static_assert(sa == sizeof(pResI0) / sizeof(pResI0[0])); // just to be sure static_assert(sa == sizeof(mResI0) / sizeof(mResI0[0])); // just to be sure @@ -82,65 +76,65 @@ test() static_assert(sa == sizeof(mResN2) / sizeof(mResN2[0])); // just to be sure for (unsigned int i = 0; i < sa; ++i ) { - test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 0, pResI0, pResI0 + i); - test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 0, mResI0, mResI0 + i); + test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 0, pResI0, pResI0 + i); + test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 0, mResI0, mResI0 + i); test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 0, pResN0, pResN0 + i); test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 0, mResN0, mResN0 + i); - test(Iter(ia), Iter(ia + i), std::plus<>(), identity<>(), 2, pResI2, pResI2 + i); - test(Iter(ia), Iter(ia + i), std::multiplies<>(), identity<>(), 2, mResI2, mResI2 + i); + test(Iter(ia), Iter(ia + i), std::plus<>(), add_one{}, 2, pResI2, pResI2 + i); + test(Iter(ia), Iter(ia + i), std::multiplies<>(), add_one{}, 2, mResI2, mResI2 + i); test(Iter(ia), Iter(ia + i), std::plus<>(), std::negate<>(), 2, pResN2, pResN2 + i); test(Iter(ia), Iter(ia + i), std::multiplies<>(), std::negate<>(), 2, mResN2, mResN2 + i); } } -int triangle(int n) { return n*(n+1)/2; } +size_t triangle(size_t n) { return n*(n+1)/2; } // Basic sanity void basic_tests() { { - std::vector<int> v(10); + std::vector<size_t> v(10); std::fill(v.begin(), v.end(), 3); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 50); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 50 + (int) (i + 1) * 3); + assert(v[i] == 50 + (i + 1) * 4); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 0); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 30); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 30 + triangle(i)); + assert(v[i] == 30 + triangle(i) + i + 1); } { - std::vector<int> v(10); + std::vector<size_t> v(10); std::iota(v.begin(), v.end(), 1); - std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), identity<>(), 40); + std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40}); for (size_t i = 0; i < v.size(); ++i) - assert(v[i] == 40 + triangle(i + 1)); + assert(v[i] == 40 + triangle(i + 1) + i + 1); } { - std::vector<int> v, res; - std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), identity<>(), 1); + std::vector<size_t> v, res; + std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{}, size_t{1}); assert(res.empty()); } // Make sure that the calculations are done using the init typedef { std::vector<unsigned char> v(10); - std::iota(v.begin(), v.end(), 1); - std::vector<int> res; - std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), identity<>(), 1); + std::iota(v.begin(), v.end(), static_cast<unsigned char>(1)); + std::vector<size_t> res; + std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), add_one{}, size_t{1}); assert(res.size() == 10); - int j = 1; - assert(res[0] == 1); + size_t j = 2; + assert(res[0] == 2); for (size_t i = 1; i < res.size(); ++i) { - j *= i + 1; + j *= i + 2; assert(res[i] == j); } } diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp index 418c57f7cfca8..c5bcaf148eae3 100644 --- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_init_bop_uop.pass.cpp @@ -18,40 +18,26 @@ #include <numeric> #include <cassert> +#include <utility> +#include <iterator> +#include "MoveOnly.h" #include "test_iterators.h" -template <class T = void> -struct identity : std::unary_function<T, T> -{ - constexpr const T& operator()(const T& x) const { return x;} -}; - -template <> -struct identity<void> +struct identity { template <class T> - constexpr auto operator()(T&& x) const - _NOEXCEPT_(noexcept(_VSTD::forward<T>(x))) - -> decltype (_VSTD::forward<T>(x)) - { return _VSTD::forward<T>(x); } + constexpr decltype(auto) operator()(T&& x) const { + return std::forward<T>(x); + } }; - -template <class T = void> struct twice { - constexpr const T operator()(const T& x) const noexcept { return 2 * x; } -}; - -template <> -struct twice<void> -{ template <class T> - constexpr auto operator()(const T& x) const - _NOEXCEPT_(noexcept(2 * x)) - -> decltype (2 * x) - { return 2 * x; } + constexpr auto operator()(const T& x) const { + return 2 * x; + } }; template <class Iter1, class T, class BOp, class UOp> @@ -70,23 +56,23 @@ test() int ia[] = {1, 2, 3, 4, 5, 6}; unsigned sa = sizeof(ia) / sizeof(ia[0]); - test(Iter(ia), Iter(ia), 0, std::plus<>(), identity<>(), 0); - test(Iter(ia), Iter(ia), 1, std::multiplies<>(), identity<>(), 1); - test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), identity<>(), 0); - test(Iter(ia), Iter(ia+1), 2, std::plus<>(), identity<>(), 3); - test(Iter(ia), Iter(ia+2), 0, std::plus<>(), identity<>(), 3); - test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), identity<>(), 6); - test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), identity<>(), 2880); - test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), identity<>(), 25); - - test(Iter(ia), Iter(ia), 0, std::plus<>(), twice<>(), 0); - test(Iter(ia), Iter(ia), 1, std::multiplies<>(), twice<>(), 1); - test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), twice<>(), 0); - test(Iter(ia), Iter(ia+1), 2, std::plus<>(), twice<>(), 4); - test(Iter(ia), Iter(ia+2), 0, std::plus<>(), twice<>(), 6); - test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), twice<>(), 24); - test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), twice<>(), 184320); // 64 * 2880 - test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), twice<>(), 46); + test(Iter(ia), Iter(ia), 0, std::plus<>(), identity(), 0); + test(Iter(ia), Iter(ia), 1, std::multiplies<>(), identity(), 1); + test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), identity(), 0); + test(Iter(ia), Iter(ia+1), 2, std::plus<>(), identity(), 3); + test(Iter(ia), Iter(ia+2), 0, std::plus<>(), identity(), 3); + test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), identity(), 6); + test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), identity(), 2880); + test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), identity(), 25); + + test(Iter(ia), Iter(ia), 0, std::plus<>(), twice(), 0); + test(Iter(ia), Iter(ia), 1, std::multiplies<>(), twice(), 1); + test(Iter(ia), Iter(ia+1), 0, std::multiplies<>(), twice(), 0); + test(Iter(ia), Iter(ia+1), 2, std::plus<>(), twice(), 4); + test(Iter(ia), Iter(ia+2), 0, std::plus<>(), twice(), 6); + test(Iter(ia), Iter(ia+2), 3, std::multiplies<>(), twice(), 24); + test(Iter(ia), Iter(ia+sa), 4, std::multiplies<>(), twice(), 184320); // 64 * 2880 + test(Iter(ia), Iter(ia+sa), 4, std::plus<>(), twice(), 46); } template <typename T, typename Init> @@ -94,7 +80,16 @@ void test_return_type() { T *p = nullptr; static_assert( std::is_same_v<Init, - decltype(std::transform_reduce(p, p, Init{}, std::plus<>(), identity<>()))> ); + decltype(std::transform_reduce(p, p, Init{}, std::plus<>(), identity()))> ); +} + +void test_move_only_types() +{ + MoveOnly ia[] = {{1}, {2}, {3}}; + assert(60 == + std::transform_reduce(std::begin(ia), std::end(ia), MoveOnly{0}, + [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() + rhs.get()}; }, + [](const MoveOnly& target) { return MoveOnly{target.get() * 10}; }).get()); } int main() @@ -118,7 +113,9 @@ int main() // Make sure the math is done using the correct type { auto v = {1, 2, 3, 4, 5, 6}; - unsigned res = std::transform_reduce(v.begin(), v.end(), 1U, std::multiplies<>(), twice<>()); + unsigned res = std::transform_reduce(v.begin(), v.end(), 1U, std::multiplies<>(), twice()); assert(res == 46080); // 6! * 64 will not fit into a char } + + test_move_only_types(); } diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp index 4f8142afe84a6..a79b4e98f03f6 100644 --- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init.pass.cpp @@ -17,7 +17,9 @@ #include <numeric> #include <cassert> +#include <iterator> +#include "MoveOnly.h" #include "test_iterators.h" template <class Iter1, class Iter2, class T> @@ -56,6 +58,14 @@ void test_return_type() decltype(std::transform_reduce(p, p, p, Init{}))> ); } +void test_move_only_types() +{ + MoveOnly ia[] = {{1}, {2}, {3}}; + MoveOnly ib[] = {{1}, {2}, {3}}; + assert(14 == + std::transform_reduce(std::begin(ia), std::end(ia), std::begin(ib), MoveOnly{0}).get()); +} + int main() { test_return_type<char, int>(); @@ -92,4 +102,6 @@ int main() test<const int*, unsigned int *>(); test< int*, const unsigned int *>(); test< int*, unsigned int *>(); + + test_move_only_types(); } diff --git a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp index 41ea3b38a7f69..f60a0f149bccd 100644 --- a/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp +++ b/test/std/numerics/numeric.ops/transform.reduce/transform_reduce_iter_iter_iter_init_op_op.pass.cpp @@ -19,7 +19,9 @@ #include <numeric> #include <cassert> +#include <iterator> +#include "MoveOnly.h" #include "test_iterators.h" template <class Iter1, class Iter2, class T, class Op1, class Op2> @@ -58,6 +60,16 @@ void test_return_type() decltype(std::transform_reduce(p, p, p, Init{}, std::plus<>(), std::multiplies<>()))> ); } +void test_move_only_types() +{ + MoveOnly ia[] = {{1}, {2}, {3}}; + MoveOnly ib[] = {{1}, {2}, {3}}; + assert(14 == + std::transform_reduce(std::begin(ia), std::end(ia), std::begin(ib), MoveOnly{0}, + [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() + rhs.get()}; }, + [](const MoveOnly& lhs, const MoveOnly& rhs) { return MoveOnly{lhs.get() * rhs.get()}; }).get()); +} + int main() { test_return_type<char, int>(); @@ -94,4 +106,6 @@ int main() test<const int*, unsigned int *>(); test< int*, const unsigned int *>(); test< int*, unsigned int *>(); + + test_move_only_types(); } diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp index 56690316c129f..e5a2a32ee2610 100644 --- a/test/std/numerics/rand/rand.device/eval.pass.cpp +++ b/test/std/numerics/rand/rand.device/eval.pass.cpp @@ -23,6 +23,7 @@ #include <random> #include <cassert> +#include <system_error> #include "test_macros.h" diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp index d96ccf9de7f57..1c3a0c14a6d09 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/assign.pass.cpp @@ -25,7 +25,7 @@ test1() E e1; E e2; assert(e1 == e2); - e1(); + (void)e1(); e2 = e1; assert(e1 == e2); } diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp index b38e8f583f232..641e5f479afb8 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/copy.pass.cpp @@ -25,8 +25,8 @@ test1() E e1; E e2 = e1; assert(e1 == e2); - e1(); - e2(); + (void)e1(); + (void)e2(); assert(e1 == e2); } diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp index 734b4209984ad..83ad55725ad6d 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/default.pass.cpp @@ -22,7 +22,6 @@ void test1() { typedef std::linear_congruential_engine<T, a, c, m> LCE; - typedef typename LCE::result_type result_type; LCE e1; LCE e2; e2.seed(); diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index 72d5854b76551..2c2abe6e94d6a 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -45,10 +45,10 @@ test1() assert((LCE::min() == (c == 0u ? 1u: 0u))); #endif -#ifdef _MSC_VER +#ifdef TEST_COMPILER_C1XX #pragma warning(push) #pragma warning(disable: 4310) // cast truncates constant value -#endif // _MSC_VER +#endif // TEST_COMPILER_C1XX #if TEST_STD_VER >= 11 static_assert((LCE::max() == result_type(m - 1u)), ""); @@ -56,9 +56,9 @@ test1() assert((LCE::max() == result_type(m - 1u))); #endif -#ifdef _MSC_VER +#ifdef TEST_COMPILER_C1XX #pragma warning(pop) -#endif // _MSC_VER +#endif // TEST_COMPILER_C1XX static_assert((LCE::default_seed == 1), ""); where(LCE::multiplier); diff --git a/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp b/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp new file mode 100644 index 0000000000000..aa70258dbfae4 --- /dev/null +++ b/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: libcpp-no-exceptions +// <regex> + +// template <class charT, class traits = regex_traits<charT>> class basic_regex; + +// template <class ST, class SA> +// basic_regex(const basic_string<charT, ST, SA>& s); + +#include <regex> +#include <cassert> +#include "test_macros.h" + +static bool error_ctype_thrown(const char *pat) +{ + bool result = false; + try { + std::regex re(pat); + } catch (const std::regex_error &ex) { + result = (ex.code() == std::regex_constants::error_ctype); + } + return result; +} + +int main() +{ + assert(error_ctype_thrown("[[::]]")); + assert(error_ctype_thrown("[[:error:]]")); +} diff --git a/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp new file mode 100644 index 0000000000000..d4dc9e54fc52c --- /dev/null +++ b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp @@ -0,0 +1,45 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <regex> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// vector(InputIterator, InputIterator, Allocator = Allocator()) +// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>; +// + + +#include <regex> +#include <string> +#include <iterator> +#include <cassert> +#include <cstddef> + + +int main() +{ +// Test the explicit deduction guides + { +// basic_regex(ForwardIterator, ForwardIterator) +// <int> is not an iterator + std::basic_regex re(23, 34); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}} + } + + { +// basic_regex(ForwardIterator, ForwardIterator, flag_type) +// <double> is not an iterator + std::basic_regex re(23.0, 34.0, std::regex_constants::basic); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}} + } + +// Test the implicit deduction guides + +} diff --git a/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp b/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp new file mode 100644 index 0000000000000..31f047c71950a --- /dev/null +++ b/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp @@ -0,0 +1,137 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <regex> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: libcpp-no-deduction-guides + + +// template<class ForwardIterator> +// basic_regex(ForwardIterator, ForwardIterator, +// regex_constants::syntax_option_type = regex_constants::ECMAScript) +// -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>; + + +#include <regex> +#include <string> +#include <iterator> +#include <cassert> +#include <cstddef> + +#include "test_macros.h" +#include "test_iterators.h" +#include "test_allocator.h" + +using namespace std::literals; + +struct A {}; + +int main() +{ + +// Test the explicit deduction guides + { +// basic_regex(ForwardIterator, ForwardIterator) + std::string s1("\\(a\\)"); + std::basic_regex re(s1.begin(), s1.end()); + + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == std::regex_constants::ECMAScript); + assert(re.mark_count() == 0); + } + + { + std::wstring s1(L"\\(a\\)"); + std::basic_regex re(s1.begin(), s1.end(), std::regex_constants::basic); + + static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, ""); + assert(re.flags() == std::regex_constants::basic); + assert(re.mark_count() == 1); + } + +// Test the implicit deduction guides + { +// basic_regex(string); + std::basic_regex re("(a([bc]))"s); + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == std::regex_constants::ECMAScript); + assert(re.mark_count() == 2); + } + + { +// basic_regex(string, flag_type); + std::basic_regex re(L"(a([bc]))"s, std::regex_constants::awk); + static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, ""); + assert(re.flags() == std::regex_constants::awk); + assert(re.mark_count() == 2); + } + + { +// basic_regex(const charT*); + std::basic_regex re("ABCDE"); + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == std::regex_constants::ECMAScript); + assert(re.mark_count() == 0); + } + + { +// basic_regex(const charT*, flag_type); + std::basic_regex re(L"ABCDE", std::regex_constants::grep); + static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, ""); + assert(re.flags() == std::regex_constants::grep); + assert(re.mark_count() == 0); + } + + { +// basic_regex(const charT*, size_t); + std::basic_regex re("ABCDEDEF", 7); + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == std::regex_constants::ECMAScript); + assert(re.mark_count() == 0); + } + + { +// basic_regex(const charT*, size_t, flag_type); + std::basic_regex re(L"ABCDEDEF", 8, std::regex_constants::awk); + static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, ""); + assert(re.flags() == std::regex_constants::awk); + assert(re.mark_count() == 0); + } + + { +// basic_regex(const basic_regex &); + std::basic_regex<char> source; + std::basic_regex re(source); + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == source.flags()); + assert(re.mark_count() == source.mark_count()); + } + + { +// template<class ST, class SA> +// explicit basic_regex(const basic_string<charT, ST, SA>& p, +// flag_type f = regex_constants::ECMAScript); + } + + { +// basic_regex(initializer_list); + std::basic_regex re({'A', 'B', 'F', 'E', 'D'}); + static_assert(std::is_same_v<decltype(re), std::basic_regex<char>>, ""); + assert(re.flags() == std::regex_constants::ECMAScript); + assert(re.mark_count() == 0); + } + + { +// basic_regex(initializer_list, flag_type); + std::basic_regex re({L'A', L'B', L'F', L'E', L'D'}, std::regex_constants::grep); + static_assert(std::is_same_v<decltype(re), std::basic_regex<wchar_t>>, ""); + assert(re.flags() == std::regex_constants::grep); + assert(re.mark_count() == 0); + } +} diff --git a/test/std/strings/basic.string/char.bad.fail.cpp b/test/std/strings/basic.string/char.bad.fail.cpp new file mode 100644 index 0000000000000..1878cd02ca38e --- /dev/null +++ b/test/std/strings/basic.string/char.bad.fail.cpp @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// ... manipulating sequences of any non-array trivial standard-layout types. + +#include <string> +#include "test_traits.h" + +struct NotTrivial { + NotTrivial() : value(3) {} + int value; +}; + +struct NotStandardLayout { +public: + NotStandardLayout() : one(1), two(2) {} + int sum() const { return one + two; } // silences "unused field 'two' warning" + int one; +private: + int two; +}; + +int main() +{ + { +// array + typedef char C[3]; + static_assert(std::is_array<C>::value, ""); + std::basic_string<C, test_traits<C> > s; +// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must not be an array"}} + } + + { +// not trivial + static_assert(!std::is_trivial<NotTrivial>::value, ""); + std::basic_string<NotTrivial, test_traits<NotTrivial> > s; +// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must be trivial"}} + } + + { +// not standard layout + static_assert(!std::is_standard_layout<NotStandardLayout>::value, ""); + std::basic_string<NotStandardLayout, test_traits<NotStandardLayout> > s; +// expected-error-re@string:* {{static_assert failed{{.*}} "Character type of basic_string must be standard-layout"}} + } +} diff --git a/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp b/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp index b1e9108e90ba2..34d5f306a7394 100644 --- a/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp +++ b/test/std/strings/basic.string/string.cons/copy_assignment.pass.cpp @@ -68,4 +68,13 @@ int main() S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz")); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s; + s = {"abc", 1}; + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp index 87698ec551031..a995a51eed48b 100644 --- a/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.cons/default_noexcept.pass.cpp @@ -22,13 +22,6 @@ #include "test_macros.h" #include "test_allocator.h" -template <class T> -struct some_alloc -{ - typedef T value_type; - some_alloc(const some_alloc&); -}; - int main() { { @@ -40,7 +33,7 @@ int main() static_assert(std::is_nothrow_default_constructible<C>::value, ""); } { - typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C; + typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C; static_assert(!std::is_nothrow_default_constructible<C>::value, ""); } } diff --git a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp index f4ff0645afcf6..a4de566a4dc0d 100644 --- a/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp @@ -20,11 +20,12 @@ #include "test_allocator.h" template <class T> -struct some_alloc +struct throwing_alloc { typedef T value_type; - some_alloc(const some_alloc&); - ~some_alloc() noexcept(false); + throwing_alloc(const throwing_alloc&); + T *allocate(size_t); + ~throwing_alloc() noexcept(false); }; // Test that it's possible to take the address of basic_string's destructors @@ -44,7 +45,7 @@ int main() } #if defined(_LIBCPP_VERSION) { - typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C; + typedef std::basic_string<char, std::char_traits<char>, throwing_alloc<char>> C; static_assert(!std::is_nothrow_destructible<C>::value, ""); } #endif // _LIBCPP_VERSION diff --git a/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp index 0fbd663db4bcd..3665e23a727bd 100644 --- a/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp +++ b/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp @@ -36,7 +36,7 @@ using BStr = std::basic_string<T, std::char_traits<T>, Alloc>; // (2) basic_string(A const&) - BROKEN // (3) basic_string(size_type, CharT, const A& = A()) // (4) basic_string(BS const&, size_type, A const& = A()) -// (5) basic_string(BS const&, size_type, size_type, A const& = A()) - PARTIALLY BROKEN +// (5) basic_string(BS const&, size_type, size_type, A const& = A()) // (6) basic_string(const CharT*, size_type, A const& = A()) // (7) basic_string(const CharT*, A const& = A()) // (8) basic_string(InputIt, InputIt, A const& = A()) - BROKEN @@ -46,7 +46,7 @@ using BStr = std::basic_string<T, std::char_traits<T>, Alloc>; // (12) basic_string(BS&&, A const&) // (13) basic_string(initializer_list<CharT>, A const& = A()) // (14) basic_string(BSV, A const& = A()) -// (15) basic_string(const T&, size_type, size_type, A const& = A()) - BROKEN +// (15) basic_string(const T&, size_type, size_type, A const& = A()) int main() { using TestSizeT = test_allocator<char>::size_type; @@ -106,7 +106,6 @@ int main() assert(w == L"def"); } { // Testing (5) w/o allocator -#if 0 // FIXME: This doesn't work const std::string sin("abc"); std::basic_string s(sin, (size_t)1, (size_t)3); ASSERT_SAME_TYPE(decltype(s), std::string); @@ -119,7 +118,6 @@ int main() std::basic_string w(win, (TestSizeT)2, (TestSizeT)3); ASSERT_SAME_TYPE(decltype(w), WStr); assert(w == L"cde"); -#endif } { // Testing (5) w/ allocator const std::string sin("abc"); @@ -178,20 +176,19 @@ int main() assert(w == L"abcdef"); } { // (8) w/o allocator - // This overload isn't compatible with implicit deduction guides as - // specified in the standard. - // FIXME: Propose adding an explicit guide to the standard? - } - { // (8) w/ allocator - // This overload isn't compatible with implicit deduction guides as - // specified in the standard. - // FIXME: Propose adding an explicit guide to the standard? -#if 0 using It = input_iterator<const char*>; const char* input = "abcdef"; std::basic_string s(It(input), It(input + 3), std::allocator<char>{}); ASSERT_SAME_TYPE(decltype(s), std::string); -#endif + assert(s == "abc"); + } + { // (8) w/ allocator + using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>; + using It = input_iterator<const wchar_t*>; + const wchar_t* input = L"abcdef"; + std::basic_string s(It(input), It(input + 3), test_allocator<wchar_t>{}); + ASSERT_SAME_TYPE(decltype(s), ExpectW); + assert(s == L"abc"); } { // Testing (9) const std::string sin("abc"); @@ -293,8 +290,28 @@ int main() ASSERT_SAME_TYPE(decltype(w), ExpectW); assert(w == L"abcdef"); } - { // Testing (15) - // This overload isn't compatible with implicit deduction guides as - // specified in the standard. + { // Testing (15) w/o allocator + std::string s0("abc"); + std::basic_string s(s0, 1, 1); + ASSERT_SAME_TYPE(decltype(s), std::string); + assert(s == "b"); + + std::wstring w0(L"abcdef"); + std::basic_string w(w0, 2, 2); + ASSERT_SAME_TYPE(decltype(w), std::wstring); + assert(w == L"cd"); + } + { // Testing (15) w/ allocator + using ExpectS = std::basic_string<char, std::char_traits<char>, test_allocator<char>>; + ExpectS s0("abc"); + std::basic_string s(s0, 1, 1, test_allocator<char>{4}); + ASSERT_SAME_TYPE(decltype(s), ExpectS); + assert(s == "b"); + + using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>; + ExpectW w0(L"abcdef"); + std::basic_string w(w0, 2, 2, test_allocator<wchar_t>{6}); + ASSERT_SAME_TYPE(decltype(w), ExpectW); + assert(w == L"cd"); } } diff --git a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp index 1f83696891c4d..e7fefacc068f1 100644 --- a/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp +++ b/test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp @@ -13,6 +13,7 @@ // basic_string(InputIterator begin, InputIterator end, // const Allocator& a = Allocator()); + #include <string> #include <iterator> #include <cassert> diff --git a/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp new file mode 100644 index 0000000000000..9c2a3201f8af2 --- /dev/null +++ b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp @@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8, clang-3.9, clang-4.0 +// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9 + +// template<class InputIterator, +// class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// basic_string(InputIterator, InputIterator, Allocator = Allocator()) +// -> basic_string<typename iterator_traits<InputIterator>::value_type, +// char_traits<typename iterator_traits<InputIterator>::value_type>, +// Allocator>; +// +// The deduction guide shall not participate in overload resolution if InputIterator +// is a type that does not qualify as an input iterator, or if Allocator is a type +// that does not qualify as an allocator. + + +#include <string> +#include <iterator> +#include <cassert> +#include <cstddef> + +#include "test_macros.h" + +class NotAnItertor {}; + +template <typename T> +struct NotAnAllocator { typedef T value_type; }; + +int main() +{ + { // Not an iterator at all + std::basic_string s1{NotAnItertor{}, NotAnItertor{}, std::allocator<char>{}}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}} + } + { // Not an input iterator + const char16_t* s = u"12345678901234"; + std::basic_string<char16_t> s0; + std::basic_string s1{std::back_insert_iterator(s0), // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}} + std::back_insert_iterator(s0), + std::allocator<char16_t>{}}; + } + { // Not an allocator + const wchar_t* s = L"12345678901234"; + std::basic_string s1{s, s+10, NotAnAllocator<wchar_t>{}}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}} + } + +} diff --git a/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp new file mode 100644 index 0000000000000..815b5600dd472 --- /dev/null +++ b/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + +// template<class InputIterator> +// basic_string(InputIterator begin, InputIterator end, +// const Allocator& a = Allocator()); + +// template<class InputIterator, +// class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +// basic_string(InputIterator, InputIterator, Allocator = Allocator()) +// -> basic_string<typename iterator_traits<InputIterator>::value_type, +// char_traits<typename iterator_traits<InputIterator>::value_type>, +// Allocator>; +// +// The deduction guide shall not participate in overload resolution if InputIterator +// is a type that does not qualify as an input iterator, or if Allocator is a type +// that does not qualify as an allocator. + + +#include <string> +#include <iterator> +#include <cassert> +#include <cstddef> + +#include "test_macros.h" +#include "test_allocator.h" +#include "../input_iterator.h" +#include "min_allocator.h" + +int main() +{ + { + const char* s = "12345678901234"; + std::basic_string s1(s, s+10); // Can't use {} here + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } + + { + const char* s = "12345678901234"; + std::basic_string s1{s, s+10, std::allocator<char>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } + { + const wchar_t* s = L"12345678901234"; + std::basic_string s1{s, s+10, test_allocator<wchar_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, wchar_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } + { + const char16_t* s = u"12345678901234"; + std::basic_string s1{s, s+10, min_allocator<char16_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char16_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } + { + const char32_t* s = U"12345678901234"; + std::basic_string s1{s, s+10, explicit_allocator<char32_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char32_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } +} diff --git a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp index 0720543420a88..ad9ed36d3f806 100644 --- a/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.cons/move_assign_noexcept.pass.cpp @@ -32,6 +32,7 @@ struct some_alloc { typedef T value_type; some_alloc(const some_alloc&); + T *allocate(size_t); }; template <class T> @@ -41,6 +42,7 @@ struct some_alloc2 some_alloc2() {} some_alloc2(const some_alloc2&); + T *allocate(size_t); void deallocate(void*, unsigned) {} typedef std::false_type propagate_on_container_move_assignment; @@ -54,6 +56,7 @@ struct some_alloc3 some_alloc3() {} some_alloc3(const some_alloc3&); + T *allocate(size_t); void deallocate(void*, unsigned) {} typedef std::false_type propagate_on_container_move_assignment; diff --git a/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp b/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp index 9a7c65ca2cf52..e0e4a4ff31bd8 100644 --- a/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.cons/move_noexcept.pass.cpp @@ -22,13 +22,6 @@ #include "test_macros.h" #include "test_allocator.h" -template <class T> -struct some_alloc -{ - typedef T value_type; - some_alloc(const some_alloc&); -}; - int main() { { @@ -40,7 +33,7 @@ int main() static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { - typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C; + typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C; #if TEST_STD_VER <= 14 static_assert(!std::is_nothrow_move_constructible<C>::value, ""); #else diff --git a/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp index 3c75a700eaed9..6d660fd10e8e5 100644 --- a/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp +++ b/test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp @@ -83,4 +83,12 @@ int main() test("123456798012345679801234567980123456798012345679801234567980", 60, A()); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s({"abc", 1}); + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp new file mode 100644 index 0000000000000..b2fece8da8c25 --- /dev/null +++ b/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp @@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + +// template<class InputIterator> +// basic_string(InputIterator begin, InputIterator end, +// const Allocator& a = Allocator()); + +// template<class charT, +// class traits, +// class Allocator = allocator<charT> +// > +// basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator()) +// -> basic_string<charT, traits, Allocator>; +// +// The deduction guide shall not participate in overload resolution if Allocator +// is a type that does not qualify as an allocator. + + +#include <string> +#include <string_view> +#include <iterator> +#include <cassert> +#include <cstddef> + +int main() +{ + { + std::string_view sv = "12345678901234"; + std::basic_string s1{sv, 23}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}} + } +} diff --git a/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp new file mode 100644 index 0000000000000..df1e99e0147ff --- /dev/null +++ b/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp @@ -0,0 +1,95 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + +// template<class InputIterator> +// basic_string(InputIterator begin, InputIterator end, +// const Allocator& a = Allocator()); + +// template<class charT, +// class traits, +// class Allocator = allocator<charT> +// > +// basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator()) +// -> basic_string<charT, traits, Allocator>; +// +// The deduction guide shall not participate in overload resolution if Allocator +// is a type that does not qualify as an allocator. + + +#include <string> +#include <string_view> +#include <iterator> +#include <memory> +#include <type_traits> +#include <cassert> +#include <cstddef> + +#include "test_macros.h" +#include "test_allocator.h" +#include "../input_iterator.h" +#include "min_allocator.h" + +int main() +{ + { + std::string_view sv = "12345678901234"; + std::basic_string s1(sv); + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == sv.size()); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + + { + std::string_view sv = "12345678901234"; + std::basic_string s1{sv, std::allocator<char>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == sv.size()); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::wstring_view sv = L"12345678901234"; + std::basic_string s1{sv, test_allocator<wchar_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, wchar_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, ""); + assert(s1.size() == sv.size()); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::u16string_view sv = u"12345678901234"; + std::basic_string s1{sv, min_allocator<char16_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char16_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, ""); + assert(s1.size() == sv.size()); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::u32string_view sv = U"12345678901234"; + std::basic_string s1{sv, explicit_allocator<char32_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char32_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, ""); + assert(s1.size() == sv.size()); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } +} diff --git a/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp new file mode 100644 index 0000000000000..f79e43f6a6b09 --- /dev/null +++ b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp @@ -0,0 +1,47 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + +// template<class InputIterator> +// basic_string(InputIterator begin, InputIterator end, +// const Allocator& a = Allocator()); + +// template<class charT, +// class traits, +// class Allocator = allocator<charT> +// > +// basic_string(basic_string_view<charT, traits>, +// typename see below::size_type, +// typename see below::size_type, +// const Allocator& = Allocator()) +// -> basic_string<charT, traits, Allocator>; +// +// A size_type parameter type in a basic_string deduction guide refers to the size_type +// member type of the type deduced by the deduction guide. +// +// The deduction guide shall not participate in overload resolution if Allocator +// is a type that does not qualify as an allocator. + + +#include <string> +#include <string_view> +#include <iterator> +#include <cassert> +#include <cstddef> + +int main() +{ + { + std::string_view sv = "12345678901234"; + std::basic_string s1{sv, 0, 4, 23}; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_string'}} + } +} diff --git a/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp new file mode 100644 index 0000000000000..d9561d22b8826 --- /dev/null +++ b/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp @@ -0,0 +1,99 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: libcpp-no-deduction-guides + +// template<class InputIterator> +// basic_string(InputIterator begin, InputIterator end, +// const Allocator& a = Allocator()); + +// template<class charT, +// class traits, +// class Allocator = allocator<charT> +// > +// basic_string(basic_string_view<charT, traits>, +// typename see below::size_type, +// typename see below::size_type, +// const Allocator& = Allocator()) +// -> basic_string<charT, traits, Allocator>; +// +// A size_type parameter type in a basic_string deduction guide refers to the size_type +// member type of the type deduced by the deduction guide. +// +// The deduction guide shall not participate in overload resolution if Allocator +// is a type that does not qualify as an allocator. + + +#include <string> +#include <string_view> +#include <iterator> +#include <cassert> +#include <cstddef> + +#include "test_macros.h" +#include "test_allocator.h" +#include "../input_iterator.h" +#include "min_allocator.h" + +int main() +{ + { + std::string_view sv = "12345678901234"; + std::basic_string s1{sv, 0, 4}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == 4); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + + { + std::string_view sv = "12345678901234"; + std::basic_string s1{sv, 0, 4, std::allocator<char>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char>>, ""); + static_assert(std::is_same_v<S::allocator_type, std::allocator<char>>, ""); + assert(s1.size() == 4); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::wstring_view sv = L"12345678901234"; + std::basic_string s1{sv, 0, 4, test_allocator<wchar_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, wchar_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<wchar_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, test_allocator<wchar_t>>, ""); + assert(s1.size() == 4); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::u16string_view sv = u"12345678901234"; + std::basic_string s1{sv, 0, 4, min_allocator<char16_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char16_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char16_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, min_allocator<char16_t>>, ""); + assert(s1.size() == 4); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } + { + std::u32string_view sv = U"12345678901234"; + std::basic_string s1{sv, 0, 4, explicit_allocator<char32_t>{}}; + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v<S::value_type, char32_t>, ""); + static_assert(std::is_same_v<S::traits_type, std::char_traits<char32_t>>, ""); + static_assert(std::is_same_v<S::allocator_type, explicit_allocator<char32_t>>, ""); + assert(s1.size() == 4); + assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0); + } +} diff --git a/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp index 5ca5aaf8629c4..38b68aa690429 100644 --- a/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp @@ -48,14 +48,13 @@ int main() test(S("12345678901234567890"), 'a', S("12345678901234567890a")); } #endif -#if 0 + { // https://bugs.llvm.org/show_bug.cgi?id=31454 std::basic_string<veryLarge> s; - veryLarge vl; + veryLarge vl = {}; s.push_back(vl); s.push_back(vl); s.push_back(vl); } -#endif } diff --git a/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp index b58ed632893e1..b3704268a4b6d 100644 --- a/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_append/string.pass.cpp @@ -77,4 +77,13 @@ int main() S("1234567890123456789012345678901234567890")); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s; + s.append({"abc", 1}); + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp index e7c5ecdc9c1ba..4c3a87248c728 100644 --- a/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_insert/size_string.pass.cpp @@ -218,4 +218,13 @@ int main() test(S("abcdefghijklmnopqrst"), 21, S("12345678901234567890"), S("can't happen")); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s; + s.insert(0, {"abc", 1}); + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp index 1064855c1506c..bbe3850153313 100644 --- a/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_op_plus_equal/string.pass.cpp @@ -77,4 +77,13 @@ int main() S("1234567890123456789012345678901234567890")); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s; + s += {"abc", 1}; + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp index 190e10d5c8303..f5f31254eb100 100644 --- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string.pass.cpp @@ -281,4 +281,13 @@ int main() test2<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " "; + s.replace(s.cbegin(), s.cend(), {"abc", 1}); + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp index 612e1e200c909..88982e09804f7 100644 --- a/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_replace/size_size_string.pass.cpp @@ -379,4 +379,13 @@ int main() test2<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " "; + s.replace(0, 1, {"abc", 1}); + assert(s.size() == 1); + assert(s == "a"); + } +#endif } diff --git a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp index 73727198f28e0..c8b784c2465fe 100644 --- a/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp @@ -35,8 +35,8 @@ struct some_alloc some_alloc() {} some_alloc(const some_alloc&); + T *allocate(size_t); void deallocate(void*, unsigned) {} - typedef std::true_type propagate_on_container_swap; }; @@ -47,6 +47,7 @@ struct some_alloc2 some_alloc2() {} some_alloc2(const some_alloc2&); + T *allocate(size_t); void deallocate(void*, unsigned) {} typedef std::false_type propagate_on_container_swap; diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp index 0ddbf2e2f99f2..be730cbc12421 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp @@ -15,9 +15,8 @@ #include <stdexcept> #include <cassert> -#include "min_allocator.h" - #include "test_macros.h" +#include "min_allocator.h" int sign(int x) { @@ -378,4 +377,11 @@ int main() test2<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.compare(0, 1, {"abc", 1}) < 0); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp index 3f6c169d223ae..80d579e300c35 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/string.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" int sign(int x) @@ -74,4 +75,11 @@ int main() test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), 0); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.compare({"abc", 1}) < 0); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp index b7df3461792be..4ce343351a9e0 100644 --- a/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.find_first_not_of({"abc", 1}) == 0); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp index 765d1603af8c4..105c2a6db1756 100644 --- a/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_find.first.of/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.find_first_of({"abc", 1}) == std::string::npos); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp index f3377596ab3de..57fab60e78a70 100644 --- a/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.find_last_not_of({"abc", 1}) == s.size() - 1); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp index 5cb2df7c6c7fd..b6b5b8f1217e7 100644 --- a/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.find_last_of({"abc", 1}) == std::string::npos); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp index e519a7943ba9d..769b51c8dc108 100644 --- a/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.find({"abc", 1}) == std::string::npos); + } +#endif } diff --git a/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp index ef571c284b812..d7908ad8583b6 100644 --- a/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_rfind/string_size.pass.cpp @@ -14,6 +14,7 @@ #include <string> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> @@ -154,4 +155,11 @@ int main() test1<S>(); } #endif + +#if TEST_STD_VER > 3 + { // LWG 2946 + std::string s = " !"; + assert(s.rfind({"abc", 1}) == std::string::npos); + } +#endif } diff --git a/test/std/strings/string.view/char.bad.fail.cpp b/test/std/strings/string.view/char.bad.fail.cpp new file mode 100644 index 0000000000000..cbd2b47b91382 --- /dev/null +++ b/test/std/strings/string.view/char.bad.fail.cpp @@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <string_view> +// ... manipulating sequences of any non-array trivial standard-layout types. + +#include <string> +#include "../basic.string/test_traits.h" + +struct NotTrivial { + NotTrivial() : value(3) {} + int value; +}; + +struct NotStandardLayout { +public: + NotStandardLayout() : one(1), two(2) {} + int sum() const { return one + two; } // silences "unused field 'two' warning" + int one; +private: + int two; +}; + +int main() +{ + { +// array + typedef char C[3]; + static_assert(std::is_array<C>::value, ""); + std::basic_string_view<C, test_traits<C> > sv; +// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must not be an array"}} + } + + { +// not trivial + static_assert(!std::is_trivial<NotTrivial>::value, ""); + std::basic_string_view<NotTrivial, test_traits<NotTrivial> > sv; +// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must be trivial"}} + } + + { +// not standard layout + static_assert(!std::is_standard_layout<NotStandardLayout>::value, ""); + std::basic_string_view<NotStandardLayout, test_traits<NotStandardLayout> > sv; +// expected-error-re@string_view:* {{static_assert failed{{.*}} "Character type of basic_string_view must be standard-layout"}} + } +} diff --git a/test/std/strings/string.view/string.view.access/data.pass.cpp b/test/std/strings/string.view/string.view.access/data.pass.cpp index 7b2350923bb6c..a179cfa1c4a13 100644 --- a/test/std/strings/string.view/string.view.access/data.pass.cpp +++ b/test/std/strings/string.view/string.view.access/data.pass.cpp @@ -22,6 +22,10 @@ void test ( const CharT *s, size_t len ) { std::basic_string_view<CharT> sv ( s, len ); assert ( sv.length() == len ); assert ( sv.data() == s ); +#if TEST_STD_VER > 14 +// make sure we pick up std::data, too! + assert ( sv.data() == std::data(sv)); +#endif } int main () { diff --git a/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp index bb733c4fb13d9..b21ba0422fdb4 100644 --- a/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp +++ b/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp @@ -55,6 +55,11 @@ void test2 ( const CharT *s, size_t len ) { assert ( sv1.empty() == (len == 0)); assert ( sv1.size() == sv1.length()); assert ( sv1.max_size() > sv1.size()); +#if TEST_STD_VER > 14 +// make sure we pick up std::size, too! + assert ( sv1.size() == std::size(sv1)); + assert ( sv1.empty() == std::empty(sv1)); +#endif } } diff --git a/test/std/strings/string.view/string.view.cons/assign.pass.cpp b/test/std/strings/string.view/string.view.cons/assign.pass.cpp index b7348ea226cfa..3307aa61d99f3 100644 --- a/test/std/strings/string.view/string.view.cons/assign.pass.cpp +++ b/test/std/strings/string.view/string.view.cons/assign.pass.cpp @@ -33,15 +33,17 @@ bool test (T sv0) int main () { assert( test<std::string_view> ( "1234")); -#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS +#if TEST_STD_VER >= 11 +#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS assert( test<std::u16string_view> (u"1234")); assert( test<std::u32string_view> (U"1234")); #endif +#endif assert( test<std::wstring_view> (L"1234")); #if TEST_STD_VER > 11 static_assert( test<std::string_view> ({ "abc", 3}), ""); -#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS +#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS static_assert( test<std::u16string_view> ({u"abc", 3}), ""); static_assert( test<std::u32string_view> ({U"abc", 3}), ""); #endif diff --git a/test/std/strings/string.view/types.pass.cpp b/test/std/strings/string.view/types.pass.cpp index 68bbc29b9aa09..4c29959f09514 100644 --- a/test/std/strings/string.view/types.pass.cpp +++ b/test/std/strings/string.view/types.pass.cpp @@ -15,20 +15,20 @@ // { // public: // // types: -// using traits_type = traits; -// using value_type = charT; -// using pointer = value_type*; -// using const_pointer = const value_type*; -// using reference = value_type&; -// using const_reference = const value_type&; -// using const_iterator = implementation-defined ; // see 24.4.2.2 -// using iterator = const_iterator; -// using const_reverse_iterator = reverse_iterator<const_iterator>; -// using iterator = const_reverse_iterator; -// using size_type = size_t; -// using difference_type = ptrdiff_t; -// static constexpr size_type npos = size_type(-1); -// +// using traits_type = traits; +// using value_type = charT; +// using pointer = value_type*; +// using const_pointer = const value_type*; +// using reference = value_type&; +// using const_reference = const value_type&; +// using const_iterator = implementation-defined ; // see 24.4.2.2 +// using iterator = const_iterator; +// using const_reverse_iterator = reverse_iterator<const_iterator>; +// using iterator = const_reverse_iterator; +// using size_type = size_t; +// using difference_type = ptrdiff_t; +// static constexpr size_type npos = size_type(-1); +// // }; #include <string_view> diff --git a/test/std/thread/futures/futures.async/async.fail.cpp b/test/std/thread/futures/futures.async/async.fail.cpp index 594c67f526992..e20f1a0a5091c 100644 --- a/test/std/thread/futures/futures.async/async.fail.cpp +++ b/test/std/thread/futures/futures.async/async.fail.cpp @@ -33,6 +33,6 @@ int foo (int x) { return x; } int main () { - std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} - std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} -}
\ No newline at end of file + std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} + std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp index 37618f7aafc79..68de5e3d13689 100644 --- a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp +++ b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp @@ -102,7 +102,7 @@ void test_copy_assign_self() { // empty { any a; - a = a; + a = (any &)a; assertEmpty(a); assert(globalMemCounter.checkOutstandingNewEq(0)); } @@ -112,7 +112,7 @@ void test_copy_assign_self() { any a((small(1))); assert(small::count == 1); - a = a; + a = (any &)a; assert(small::count == 1); assertContains<small>(a, 1); @@ -125,7 +125,7 @@ void test_copy_assign_self() { any a(large(1)); assert(large::count == 1); - a = a; + a = (any &)a; assert(large::count == 1); assertContains<large>(a, 1); diff --git a/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp b/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp new file mode 100644 index 0000000000000..abb80d06d755a --- /dev/null +++ b/test/std/utilities/function.objects/comparisons/constexpr_init.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// XFAIL: gcc-7 + +// <functional> + +// equal_to, not_equal_to, less, et al. + +// Test that these types can be constructed w/o an initializer in a constexpr +// context. This is specifically testing gcc.gnu.org/PR83921 + + +#include <functional> +#include "test_macros.h" + +template <class T> +constexpr bool test_constexpr_context() { + std::equal_to<T> eq; + ((void)eq); + std::not_equal_to<T> neq; + ((void)neq); + std::less<T> l; + ((void)l); + std::less_equal<T> le; + ((void)le); + std::greater<T> g; + ((void)g); + std::greater_equal<T> ge; + ((void)ge); + return true; +} + +static_assert(test_constexpr_context<int>(), ""); +static_assert(test_constexpr_context<void>(), ""); + + +int main() { + +} diff --git a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp index 7601ff9d147de..f33b4157721a6 100644 --- a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp +++ b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp @@ -305,15 +305,17 @@ void constructor_tests() using RetT = decltype(std::not_fn(value)); static_assert(std::is_move_constructible<RetT>::value, ""); static_assert(std::is_copy_constructible<RetT>::value, ""); - static_assert(std::is_move_assignable<RetT>::value, ""); - static_assert(std::is_copy_assignable<RetT>::value, ""); + LIBCPP_STATIC_ASSERT(std::is_move_assignable<RetT>::value, ""); + LIBCPP_STATIC_ASSERT(std::is_copy_assignable<RetT>::value, ""); auto ret = std::not_fn(value); assert(ret() == false); auto ret2 = std::not_fn(value2); assert(ret2() == true); +#if defined(_LIBCPP_VERSION) ret = ret2; assert(ret() == true); assert(ret2() == true); +#endif // _LIBCPP_VERSION } { using T = MoveAssignableWrapper; @@ -322,14 +324,16 @@ void constructor_tests() using RetT = decltype(std::not_fn(std::move(value))); static_assert(std::is_move_constructible<RetT>::value, ""); static_assert(!std::is_copy_constructible<RetT>::value, ""); - static_assert(std::is_move_assignable<RetT>::value, ""); + LIBCPP_STATIC_ASSERT(std::is_move_assignable<RetT>::value, ""); static_assert(!std::is_copy_assignable<RetT>::value, ""); auto ret = std::not_fn(std::move(value)); assert(ret() == false); auto ret2 = std::not_fn(std::move(value2)); assert(ret2() == true); +#if defined(_LIBCPP_VERSION) ret = std::move(ret2); assert(ret() == true); +#endif // _LIBCPP_VERSION } } @@ -426,7 +430,7 @@ void throws_in_constructor_test() { ThrowsOnCopy cp; try { - std::not_fn(cp); + (void)std::not_fn(cp); assert(false); } catch (int const& value) { assert(value == 42); diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp new file mode 100644 index 0000000000000..c328b4a4e7a21 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp @@ -0,0 +1,129 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_searcher { +// public: +// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { + std::boyer_moore_searcher<Iter2> s{b2, e2}; + assert(result == std::search(b1, e1, s)); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp new file mode 100644 index 0000000000000..2555cedb212a0 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp @@ -0,0 +1,125 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_searcher { +// public: +// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename T> struct MyHash { + size_t operator () (T t) const { return static_cast<size_t>(t); } +}; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) { + std::boyer_moore_searcher<Iter2, + MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>> + s{b2, e2}; + assert(result == std::search(b1, e1, s)); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp new file mode 100644 index 0000000000000..f7b8e4983e543 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp @@ -0,0 +1,143 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_searcher { +// public: +// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename T> struct MyHash { + size_t operator () (T t) const { return static_cast<size_t>(t); } +}; + +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) const + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::boyer_moore_searcher<Iter2, + MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, + count_equal> + s{b2, e2}; + count_equal::count = 0; + assert(result == std::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); + +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp new file mode 100644 index 0000000000000..17121d2809aa8 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp @@ -0,0 +1,134 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_searcher { +// public: +// boyer_moore_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) const + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::boyer_moore_searcher<Iter2, + typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; + count_equal::count = 0; + assert(result == std::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp new file mode 100644 index 0000000000000..ec65a4b9b69fb --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp @@ -0,0 +1,129 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore_horspool searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_horspool_searcher { +// public: +// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { + std::boyer_moore_horspool_searcher<Iter2> s{b2, e2}; + assert(result == std::search(b1, e1, s)); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + char ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + char ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp new file mode 100644 index 0000000000000..dfa587dccfb15 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp @@ -0,0 +1,124 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore_horspool searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_horspool_searcher { +// public: +// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename T> struct MyHash { + size_t operator () (T t) const { return static_cast<size_t>(t); } +}; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned /*max_count*/) { + std::boyer_moore_horspool_searcher<Iter2, + MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>> + s{b2, e2}; + assert(result == std::search(b1, e1, s)); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp new file mode 100644 index 0000000000000..083065ca8a919 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp @@ -0,0 +1,137 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore_horspool searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_horspool_searcher { +// public: +// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename T> struct MyHash { + size_t operator () (T t) const { return static_cast<size_t>(t); } +}; + +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) const + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::boyer_moore_horspool_searcher<Iter2, + MyHash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, + count_equal> + s{b2, e2}; + count_equal::count = 0; + assert(result == std::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp new file mode 100644 index 0000000000000..865dd89ce18a6 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp @@ -0,0 +1,131 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// XFAIL: c++17, c++2a + +// <functional> + +// boyer_moore_horspool searcher +// template<class RandomAccessIterator1, +// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>, +// class BinaryPredicate = equal_to<>> +// class boyer_moore_horspool_searcher { +// public: +// boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first, RandomAccessIterator1 pat_last, +// Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); +// +// template<class RandomAccessIterator2> +// pair<RandomAccessIterator2, RandomAccessIterator2> +// operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; +// +// private: +// RandomAccessIterator1 pat_first_; // exposition only +// RandomAccessIterator1 pat_last_; // exposition only +// Hash hash_; // exposition only +// BinaryPredicate pred_; // exposition only +// }; + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) const + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::boyer_moore_horspool_searcher<Iter2, + typename std::hash<typename std::remove_cv<typename std::iterator_traits<Iter2>::value_type>::type>, count_equal> s{b2, e2}; + count_equal::count = 0; + assert(result == std::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +template <class Iter1, class Iter2> +void +test2() +{ + char ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + char ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + char ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + char id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + char ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + char ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + char ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + char ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); + test2<random_access_iterator<const char*>, random_access_iterator<const char*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp new file mode 100644 index 0000000000000..e498cfd960a3e --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.default/default.pass.cpp @@ -0,0 +1,96 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// <functional> + +// default searcher +// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> +// class default_searcher { +// public: +// default_searcher(_ForwardIterator __f, _ForwardIterator __l, +// _BinaryPredicate __p = _BinaryPredicate()) +// : __first_(__f), __last_(__l), __pred_(__p) {} +// +// template <typename _ForwardIterator2> +// pair<_ForwardIterator2, _ForwardIterator2> +// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// return std::search(__f, __l, __first_, __last_, __pred_); +// } +// +// private: +// _ForwardIterator __first_; +// _ForwardIterator __last_; +// _BinaryPredicate __pred_; +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { + std::default_searcher<Iter2> s{b2, e2}; + assert(result == std::search(b1, e1, s)); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +int main() { + test<forward_iterator<const int*>, forward_iterator<const int*> >(); + test<forward_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<forward_iterator<const int*>, random_access_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, forward_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >(); + test<random_access_iterator<const int*>, forward_iterator<const int*> >(); + test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); +} diff --git a/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp b/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp new file mode 100644 index 0000000000000..025565f8eb134 --- /dev/null +++ b/test/std/utilities/function.objects/func.search/func.search.default/default.pred.pass.cpp @@ -0,0 +1,103 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// default searcher +// template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> +// class default_searcher { +// public: +// default_searcher(_ForwardIterator __f, _ForwardIterator __l, +// _BinaryPredicate __p = _BinaryPredicate()) +// : __first_(__f), __last_(__l), __pred_(__p) {} +// +// template <typename _ForwardIterator2> +// pair<_ForwardIterator2, _ForwardIterator2> +// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// return std::search(__f, __l, __first_, __last_, __pred_); +// } +// +// private: +// _ForwardIterator __first_; +// _ForwardIterator __last_; +// _BinaryPredicate __pred_; +// }; + + +#include <algorithm> +#include <functional> +#include <cassert> + +#include "test_iterators.h" + +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) const + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template <typename Iter1, typename Iter2> +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::default_searcher<Iter2, count_equal> s{b2, e2}; + count_equal::count = 0; + assert(result == std::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template <class Iter1, class Iter2> +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test<forward_iterator<const int*>, forward_iterator<const int*> >(); + test<forward_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<forward_iterator<const int*>, random_access_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, forward_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >(); + test<random_access_iterator<const int*>, forward_iterator<const int*> >(); + test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >(); + test<random_access_iterator<const int*>, random_access_iterator<const int*> >(); +} diff --git a/test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp b/test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp index 9a59227abdd98..9a59227abdd98 100644 --- a/test/std/experimental/utilities/ratio/nothing_to_do.pass.cpp +++ b/test/std/utilities/function.objects/func.search/nothing_to_do.pass.cpp diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp index 9b83ddecb9742..1c2be02c6212e 100644 --- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp @@ -92,28 +92,28 @@ int main() { { typedef std::function<int()> Func; Func f = g0; - Func& fr = (f = f); + Func& fr = (f = (Func &)f); assert(&fr == &f); assert(*f.target<int(*)()>() == g0); } { typedef std::function<int(int)> Func; Func f = g; - Func& fr = (f = f); + Func& fr = (f = (Func &)f); assert(&fr == &f); assert(*f.target<int(*)(int)>() == g); } { typedef std::function<int(int, int)> Func; Func f = g2; - Func& fr = (f = f); + Func& fr = (f = (Func &)f); assert(&fr == &f); assert(*f.target<int(*)(int, int)>() == g2); } { typedef std::function<int(int, int, int)> Func; Func f = g3; - Func& fr = (f = f); + Func& fr = (f = (Func &)f); assert(&fr == &f); assert(*f.target<int(*)(int, int, int)>() == g3); } diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp new file mode 100644 index 0000000000000..0813c48f322e1 --- /dev/null +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// class function<R(ArgTypes...)> + +// function& operator=(function &&); + +#include <functional> +#include <cassert> + +#include "test_macros.h" + +struct A +{ + static std::function<void()> global; + static bool cancel; + + ~A() { + DoNotOptimize(cancel); + if (cancel) + global = std::function<void()>(nullptr); + } + void operator()() {} +}; + +std::function<void()> A::global; +bool A::cancel = false; + +int main() +{ + A::global = A(); + assert(A::global.target<A>()); + + // Check that we don't recurse in A::~A(). + A::cancel = true; + A::global = std::function<void()>(nullptr); + assert(!A::global.target<A>()); +} diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp new file mode 100644 index 0000000000000..eeb181928eaf3 --- /dev/null +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// class function<R(ArgTypes...)> + +// function& operator=(nullptr_t); + +#include <functional> +#include <cassert> + +#include "test_macros.h" + +struct A +{ + static std::function<void()> global; + static bool cancel; + + ~A() { + DoNotOptimize(cancel); + if (cancel) + global = nullptr; + } + void operator()() {} +}; + +std::function<void()> A::global; +bool A::cancel = false; + +int main() +{ + A::global = A(); + assert(A::global.target<A>()); + + // Check that we don't recurse in A::~A(). + A::cancel = true; + A::global = nullptr; + assert(!A::global.target<A>()); +} diff --git a/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp new file mode 100644 index 0000000000000..0afab685f913f --- /dev/null +++ b/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp @@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <memory> +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// +// template <class T> +// class allocator +// { +// public: // All of these are constexpr after C++17 +// constexpr allocator() noexcept; +// constexpr allocator(const allocator&) noexcept; +// template<class U> constexpr allocator(const allocator<U>&) noexcept; +// ... +// }; + +#include <memory> +#include <cstddef> + +#include "test_macros.h" + + +int main() +{ + { + typedef std::allocator<char> AC; + typedef std::allocator<long> AL; + + constexpr AC a1; + constexpr AC a2{a1}; + constexpr AL a3{a2}; + (void) a3; + } + { + typedef std::allocator<const char> AC; + typedef std::allocator<const long> AL; + + constexpr AC a1; + constexpr AC a2{a1}; + constexpr AL a3{a2}; + (void) a3; + } + +} diff --git a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp index f2cf9f2d41878..70c5e46965a0b 100644 --- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp +++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp @@ -14,40 +14,98 @@ #include <memory> #include <cassert> +#include <iostream> +#include "test_macros.h" #include "count_new.hpp" -int A_constructed = 0; -struct A -{ - int data; - A() {++A_constructed;} - A(const A&) {++A_constructed;} - ~A() {--A_constructed;} +#ifdef TEST_HAS_NO_ALIGNED_ALLOCATION +static const bool UsingAlignedNew = false; +#else +static const bool UsingAlignedNew = true; +#endif + +#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__ +static const size_t MaxAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__; +#else +static const size_t MaxAligned = std::alignment_of<std::max_align_t>::value; +#endif + +static const size_t OverAligned = MaxAligned * 2; + + +template <size_t Align> +struct TEST_ALIGNAS(Align) AlignedType { + char data; + static int constructed; + AlignedType() { ++constructed; } + AlignedType(AlignedType const&) { ++constructed; } + ~AlignedType() { --constructed; } }; +template <size_t Align> +int AlignedType<Align>::constructed = 0; -int main() -{ - globalMemCounter.reset(); - std::allocator<A> a; + +template <size_t Align> +void test_aligned() { + typedef AlignedType<Align> T; + T::constructed = 0; + globalMemCounter.reset(); + std::allocator<T> a; + const bool IsOverAlignedType = Align > MaxAligned; + const bool ExpectAligned = IsOverAlignedType && UsingAlignedNew; + { assert(globalMemCounter.checkOutstandingNewEq(0)); - assert(A_constructed == 0); + assert(T::constructed == 0); globalMemCounter.last_new_size = 0; - A* volatile ap = a.allocate(3); + globalMemCounter.last_new_align = 0; + T* ap = a.allocate(3); + DoNotOptimize(ap); assert(globalMemCounter.checkOutstandingNewEq(1)); - assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); - assert(A_constructed == 0); + assert(globalMemCounter.checkNewCalledEq(1)); + assert(globalMemCounter.checkAlignedNewCalledEq(ExpectAligned)); + assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(T))); + assert(globalMemCounter.checkLastNewAlignEq(ExpectAligned ? Align : 0)); + assert(T::constructed == 0); + globalMemCounter.last_delete_align = 0; a.deallocate(ap, 3); assert(globalMemCounter.checkOutstandingNewEq(0)); - assert(A_constructed == 0); - + assert(globalMemCounter.checkDeleteCalledEq(1)); + assert(globalMemCounter.checkAlignedDeleteCalledEq(ExpectAligned)); + assert(globalMemCounter.checkLastDeleteAlignEq(ExpectAligned ? Align : 0)); + assert(T::constructed == 0); + } + globalMemCounter.reset(); + { globalMemCounter.last_new_size = 0; - A* volatile ap2 = a.allocate(3, (const void*)5); + globalMemCounter.last_new_align = 0; + T* volatile ap2 = a.allocate(11, (const void*)5); + DoNotOptimize(ap2); assert(globalMemCounter.checkOutstandingNewEq(1)); - assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); - assert(A_constructed == 0); - a.deallocate(ap2, 3); + assert(globalMemCounter.checkNewCalledEq(1)); + assert(globalMemCounter.checkAlignedNewCalledEq(ExpectAligned)); + assert(globalMemCounter.checkLastNewSizeEq(11 * sizeof(T))); + assert(globalMemCounter.checkLastNewAlignEq(ExpectAligned ? Align : 0)); + assert(T::constructed == 0); + globalMemCounter.last_delete_align = 0; + a.deallocate(ap2, 11); + DoNotOptimize(ap2); assert(globalMemCounter.checkOutstandingNewEq(0)); - assert(A_constructed == 0); + assert(globalMemCounter.checkDeleteCalledEq(1)); + assert(globalMemCounter.checkAlignedDeleteCalledEq(ExpectAligned)); + assert(globalMemCounter.checkLastDeleteAlignEq(ExpectAligned ? Align : 0)); + assert(T::constructed == 0); + } +} + +int main() { + test_aligned<1>(); + test_aligned<2>(); + test_aligned<4>(); + test_aligned<8>(); + test_aligned<16>(); + test_aligned<MaxAligned>(); + test_aligned<OverAligned>(); + test_aligned<OverAligned * 2>(); } diff --git a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp index 28dadd831514f..9ba9874406f64 100644 --- a/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp +++ b/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp @@ -63,6 +63,7 @@ int main() globalMemCounter.last_new_size = 0; A* ap = a.allocate(3); + DoNotOptimize(ap); assert(globalMemCounter.checkOutstandingNewEq(1)); assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); assert(A_constructed == 0); @@ -100,6 +101,7 @@ int main() assert(A_constructed == 0); a.deallocate(ap, 3); + DoNotOptimize(ap); assert(globalMemCounter.checkOutstandingNewEq(0)); assert(A_constructed == 0); } @@ -111,6 +113,7 @@ int main() globalMemCounter.last_new_size = 0; move_only* ap = a.allocate(3); + DoNotOptimize(ap); assert(globalMemCounter.checkOutstandingNewEq(1)); assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); assert(move_only_constructed == 0); @@ -132,6 +135,7 @@ int main() assert(move_only_constructed == 0); a.deallocate(ap, 3); + DoNotOptimize(ap); assert(globalMemCounter.checkOutstandingNewEq(0)); assert(move_only_constructed == 0); } diff --git a/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp b/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp new file mode 100644 index 0000000000000..52aca8192cbb0 --- /dev/null +++ b/test/std/utilities/memory/temporary.buffer/overaligned.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// <memory> + +// template <class T> +// pair<T*, ptrdiff_t> +// get_temporary_buffer(ptrdiff_t n); +// +// template <class T> +// void +// return_temporary_buffer(T* p); + +#include <memory> +#include <cassert> + +struct alignas(32) A { + int field; +}; + +int main() +{ + std::pair<A*, std::ptrdiff_t> ip = std::get_temporary_buffer<A>(5); + assert(!(ip.first == nullptr) ^ (ip.second == 0)); + assert(reinterpret_cast<uintptr_t>(ip.first) % alignof(A) == 0); + std::return_temporary_buffer(ip.first); +} diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp index 48c90f7b9661d..54c85e94338c2 100644 --- a/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp +++ b/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp @@ -24,11 +24,12 @@ #include <sstream> #include <cassert> -class A {}; +#include "min_allocator.h" +#include "deleter_types.h" int main() { - std::unique_ptr<A> p(new A); + std::unique_ptr<int, PointerDeleter<int>> p; std::ostringstream os; - os << p; + os << p; // expected-error {{invalid operands to binary expression}} } diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp index 079661d0c1749..d7e35a62f8f0e 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp @@ -10,6 +10,9 @@ // type_traits // aligned_storage +// +// Issue 3034 added: +// The member typedef type shall be a trivial standard-layout type. #include <type_traits> #include <cstddef> // for std::max_align_t @@ -20,144 +23,231 @@ int main() { typedef std::aligned_storage<10, 1 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 1, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 2 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } { typedef std::aligned_storage<10, 4 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 12, ""); } { typedef std::aligned_storage<10, 8 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 16 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<10, 32 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<20, 32 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 32, ""); static_assert(sizeof(T1) == 32, ""); } { typedef std::aligned_storage<40, 32 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 32, ""); static_assert(sizeof(T1) == 64, ""); } { typedef std::aligned_storage<12, 16 >::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 16, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<1>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 1, ""); static_assert(sizeof(T1) == 1, ""); } { typedef std::aligned_storage<2>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 2, ""); } { typedef std::aligned_storage<3>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<4>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } { typedef std::aligned_storage<5>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<7>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<7>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<7>, T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<8>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 8, ""); } { typedef std::aligned_storage<9>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, ""); #endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); +#endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } { typedef std::aligned_storage<15>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, ""); +#endif +#if TEST_STD_VER <= 17 + static_assert(std::is_pod<T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } @@ -170,8 +260,10 @@ int main() { typedef std::aligned_storage<16>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<16>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<16>, T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t), ""); static_assert(sizeof(T1) == 16, ""); @@ -179,8 +271,10 @@ int main() { typedef std::aligned_storage<17>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<17>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<17>, T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == alignof(std::max_align_t), ""); static_assert(sizeof(T1) == 16 + alignof(std::max_align_t), ""); @@ -188,8 +282,10 @@ int main() { typedef std::aligned_storage<10>::type T1; #if TEST_STD_VER > 11 - static_assert(std::is_same<std::aligned_storage_t<10>, T1>::value, "" ); + static_assert(std::is_same<std::aligned_storage_t<10>, T1>::value, ""); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp index 883548270469c..3e58b51a61684 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp @@ -13,6 +13,9 @@ // aligned_union<size_t Len, class ...Types> +// Issue 3034 added: +// The member typedef type shall be a trivial standard-layout type. + #include <type_traits> #include "test_macros.h" @@ -24,6 +27,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, char>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 1, ""); static_assert(sizeof(T1) == 10, ""); } @@ -32,6 +37,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, short>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } @@ -40,6 +47,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, int>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 12, ""); } @@ -48,6 +57,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, double>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 8, ""); static_assert(sizeof(T1) == 16, ""); } @@ -56,6 +67,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, short, char>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } @@ -64,6 +77,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<10, char, short>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 2, ""); static_assert(sizeof(T1) == 10, ""); } @@ -72,6 +87,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<2, int, char, short>, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } @@ -80,6 +97,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<2, char, int, short >, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } @@ -88,6 +107,8 @@ int main() #if TEST_STD_VER > 11 static_assert(std::is_same<std::aligned_union_t<2, char, short, int >, T1>::value, "" ); #endif + static_assert(std::is_trivial<T1>::value, ""); + static_assert(std::is_standard_layout<T1>::value, ""); static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp index 85b14726617f8..dbbbe159f09ed 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp @@ -11,8 +11,9 @@ // common_type -#include <type_traits> +#include <functional> #include <memory> +#include <type_traits> #include "test_macros.h" @@ -45,7 +46,6 @@ namespace std template <> struct common_type< ::S<long>, long> {}; template <> struct common_type<long, ::S<long> > {}; - template <> struct common_type< ::X<float> > {}; template <> struct common_type< ::X<double>, ::X<double> > {}; } @@ -97,7 +97,6 @@ void test_bullet_two() { static_assert(std::is_same<CommonType<int volatile[]>, int volatile*>::value, ""); static_assert(std::is_same<CommonType<void(&)()>, void(*)()>::value, ""); - static_assert(no_common_type<X<float> >::value, ""); static_assert(no_common_type<X<double> >::value, ""); } diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp index e06229f7e9756..e220f591f480b 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/remove_cvref.pass.cpp @@ -32,7 +32,7 @@ int main() test_remove_cvref<const volatile int, int>(); test_remove_cvref<volatile int, int>(); -// Doesn't decay +// Doesn't decay test_remove_cvref<int[3], int[3]>(); test_remove_cvref<int const [3], int[3]>(); test_remove_cvref<int volatile [3], int[3]>(); diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp index 24231526b2bf8..69e805d1e1f4a 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp @@ -104,36 +104,43 @@ int main() test_result_of<S const volatile&(unsigned char, int&), double const volatile&> (); } { // pointer to function - typedef bool (&RF0)(); + typedef bool (&RF0)(); typedef bool* (&RF1)(int); typedef bool& (&RF2)(int, int); typedef bool const& (&RF3)(int, int, int); + typedef bool (&RF4)(int, ...); typedef bool (*PF0)(); typedef bool* (*PF1)(int); typedef bool& (*PF2)(int, int); typedef bool const& (*PF3)(int, int, int); + typedef bool (*PF4)(int, ...); typedef bool (*&PRF0)(); typedef bool* (*&PRF1)(int); typedef bool& (*&PRF2)(int, int); typedef bool const& (*&PRF3)(int, int, int); + typedef bool (*&PRF4)(int, ...); test_result_of<RF0(), bool>(); test_result_of<RF1(int), bool*>(); test_result_of<RF2(int, long), bool&>(); test_result_of<RF3(int, long, int), bool const&>(); + test_result_of<RF4(int, float, void*), bool>(); test_result_of<PF0(), bool>(); test_result_of<PF1(int), bool*>(); test_result_of<PF2(int, long), bool&>(); test_result_of<PF3(int, long, int), bool const&>(); + test_result_of<PF4(int, float, void*), bool>(); test_result_of<PRF0(), bool>(); test_result_of<PRF1(int), bool*>(); test_result_of<PRF2(int, long), bool&>(); test_result_of<PRF3(int, long, int), bool const&>(); + test_result_of<PRF4(int, float, void*), bool>(); } { // pointer to member function typedef int (S::*PMS0)(); typedef int* (S::*PMS1)(long); typedef int& (S::*PMS2)(long, int); + typedef const int& (S::*PMS3)(int, ...); test_result_of<PMS0( S), int> (); test_result_of<PMS0( S&), int> (); test_result_of<PMS0( S*), int> (); @@ -193,9 +200,13 @@ int main() test_no_result<PMS2(std::reference_wrapper<ND>, int, int)>(); test_no_result<PMS2(std::unique_ptr<ND>, int, int)>(); + test_result_of<PMS3(S&, int), const int &>(); + test_result_of<PMS3(S&, int, long), const int &>(); + typedef int (S::*PMS0C)() const; typedef int* (S::*PMS1C)(long) const; typedef int& (S::*PMS2C)(long, int) const; + typedef const int& (S::*PMS3C)(int, ...) const; test_result_of<PMS0C( S), int> (); test_result_of<PMS0C( S&), int> (); test_result_of<PMS0C(const S&), int> (); @@ -238,9 +249,13 @@ int main() test_no_result<PMS2C(volatile S&, int, int)>(); test_no_result<PMS2C(const volatile S&, int, int)>(); + test_result_of<PMS3C(S&, int), const int &>(); + test_result_of<PMS3C(S&, int, long), const int &>(); + typedef int (S::*PMS0V)() volatile; typedef int* (S::*PMS1V)(long) volatile; typedef int& (S::*PMS2V)(long, int) volatile; + typedef const int& (S::*PMS3V)(int, ...) volatile; test_result_of<PMS0V( S), int> (); test_result_of<PMS0V( S&), int> (); test_result_of<PMS0V(volatile S&), int> (); @@ -274,9 +289,13 @@ int main() test_no_result<PMS2V(const S&, int, int)>(); test_no_result<PMS2V(const volatile S&, int, int)>(); + test_result_of<PMS3V(S&, int), const int &>(); + test_result_of<PMS3V(S&, int, long), const int &>(); + typedef int (S::*PMS0CV)() const volatile; typedef int* (S::*PMS1CV)(long) const volatile; typedef int& (S::*PMS2CV)(long, int) const volatile; + typedef const int& (S::*PMS3CV)(int, ...) const volatile; test_result_of<PMS0CV( S), int> (); test_result_of<PMS0CV( S&), int> (); test_result_of<PMS0CV(const S&), int> (); @@ -321,6 +340,9 @@ int main() test_result_of<PMS2CV(volatile S*&, int, int), int&> (); test_result_of<PMS2CV(const volatile S*&, int, int), int&> (); test_result_of<PMS2CV(std::unique_ptr<S>, int, int), int&> (); + + test_result_of<PMS3CV(S&, int), const int &>(); + test_result_of<PMS3CV(S&, int, long), const int &>(); } { // pointer to member data typedef char S::*PMD; diff --git a/test/std/utilities/meta/meta.type.synop/endian.pass.cpp b/test/std/utilities/meta/meta.type.synop/endian.pass.cpp new file mode 100644 index 0000000000000..cf0ab2d26390e --- /dev/null +++ b/test/std/utilities/meta/meta.type.synop/endian.pass.cpp @@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 + +// enum class endian; + +#include <type_traits> +#include <cstring> +#include <cassert> +#include <cstdint> + +#include "test_macros.h" + +int main() { + typedef std::endian E; + static_assert(std::is_enum<std::endian>::value, ""); + +// Check that E is a scoped enum by checking for conversions. + typedef std::underlying_type<std::endian>::type UT; + static_assert(!std::is_convertible<std::endian, UT>::value, ""); + +// test that the enumeration values exist + static_assert( std::endian::little == std::endian::little ); + static_assert( std::endian::big == std::endian::big ); + static_assert( std::endian::native == std::endian::native ); + static_assert( std::endian::little != std::endian::big ); + +// Technically not required, but true on all existing machines + static_assert( std::endian::native == std::endian::little || + std::endian::native == std::endian::big ); + +// Try to check at runtime + { + uint32_t i = 0x01020304; + char c[4]; + static_assert(sizeof(i) == sizeof(c)); + std::memcpy(c, &i, sizeof(c)); + + assert ((c[0] == 1) == (std::endian::native == std::endian::big)); + } +} diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp new file mode 100644 index 0000000000000..52100c30404c3 --- /dev/null +++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp @@ -0,0 +1,106 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-3, clang-4, clang-5, apple-clang, gcc-4, gcc-5, gcc-6 + +// type_traits + +// has_unique_object_representations + +#include <type_traits> + +#include "test_macros.h" + +template <class T> +void test_has_unique_object_representations() +{ + static_assert( std::has_unique_object_representations<T>::value, ""); + static_assert( std::has_unique_object_representations<const T>::value, ""); + static_assert( std::has_unique_object_representations<volatile T>::value, ""); + static_assert( std::has_unique_object_representations<const volatile T>::value, ""); + + static_assert( std::has_unique_object_representations_v<T>, ""); + static_assert( std::has_unique_object_representations_v<const T>, ""); + static_assert( std::has_unique_object_representations_v<volatile T>, ""); + static_assert( std::has_unique_object_representations_v<const volatile T>, ""); +} + +template <class T> +void test_has_not_has_unique_object_representations() +{ + static_assert(!std::has_unique_object_representations<T>::value, ""); + static_assert(!std::has_unique_object_representations<const T>::value, ""); + static_assert(!std::has_unique_object_representations<volatile T>::value, ""); + static_assert(!std::has_unique_object_representations<const volatile T>::value, ""); + + static_assert(!std::has_unique_object_representations_v<T>, ""); + static_assert(!std::has_unique_object_representations_v<const T>, ""); + static_assert(!std::has_unique_object_representations_v<volatile T>, ""); + static_assert(!std::has_unique_object_representations_v<const volatile T>, ""); +} + +class Empty +{ +}; + +class NotEmpty +{ + virtual ~NotEmpty(); +}; + +union EmptyUnion {}; +struct NonEmptyUnion {int x; unsigned y;}; + +struct bit_zero +{ + int : 0; +}; + +class Abstract +{ + virtual ~Abstract() = 0; +}; + +struct A +{ + ~A(); + unsigned foo; +}; + +struct B +{ + char bar; + int foo; +}; + + +int main() +{ + test_has_not_has_unique_object_representations<void>(); + test_has_not_has_unique_object_representations<Empty>(); + test_has_not_has_unique_object_representations<EmptyUnion>(); + test_has_not_has_unique_object_representations<NotEmpty>(); + test_has_not_has_unique_object_representations<bit_zero>(); + test_has_not_has_unique_object_representations<Abstract>(); + test_has_not_has_unique_object_representations<B>(); + +// I would expect all three of these to have unique representations. +// I would also expect that there are systems where they do not. +// test_has_not_has_unique_object_representations<int&>(); +// test_has_not_has_unique_object_representations<int *>(); +// test_has_not_has_unique_object_representations<double>(); + + + test_has_unique_object_representations<unsigned>(); + test_has_unique_object_representations<NonEmptyUnion>(); + test_has_unique_object_representations<char[3]>(); + test_has_unique_object_representations<char[]>(); + +} diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp index 8d63a23494b9e..4808a4dc9e486 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp @@ -59,8 +59,6 @@ struct E template <typename T> struct X { T t; }; -struct Incomplete; - int main() { test_is_assignable<int&, int&> (); diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp index 1f7c32a8cc07c..b90363a5c3802 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp @@ -30,6 +30,7 @@ struct A { explicit A(int); A(int, double); + A(int, long, double); #if TEST_STD_VER >= 11 private: #endif @@ -106,6 +107,16 @@ void test_is_constructible() #endif } +template <class T, class A0, class A1, class A2> +void test_is_constructible() +{ + static_assert(( std::is_constructible<T, A0, A1, A2>::value), ""); + LIBCPP11_STATIC_ASSERT((std::__libcpp_is_constructible<T, A0, A1, A2>::type::value), ""); +#if TEST_STD_VER > 14 + static_assert(( std::is_constructible_v<T, A0, A1, A2>), ""); +#endif +} + template <class T> void test_is_not_constructible() { @@ -146,6 +157,7 @@ int main() test_is_constructible<int, const int> (); test_is_constructible<A, int> (); test_is_constructible<A, int, double> (); + test_is_constructible<A, int, long, double> (); test_is_constructible<int&, int&> (); test_is_not_constructible<A> (); diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp index 0bb373c966205..ac4664312f841 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp @@ -13,7 +13,7 @@ // These compilers have not implemented Core 2094 which makes volatile // qualified types trivially copyable. -// XFAIL: clang-3, clang-4, apple-clang, gcc +// XFAIL: clang-3, clang-4, apple-clang-6, apple-clang-7, apple-clang-8, apple-clang-9.0, gcc #include <type_traits> #include <cassert> diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp new file mode 100644 index 0000000000000..1e1e82b03d708 --- /dev/null +++ b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <optional> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5 +// UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +// Specifically, for the copy constructor. + + +// template<class T> +// optional(T) -> optional<T>; + + +#include <optional> +#include <cassert> + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + +// Test the implicit deduction guides + { +// optional() + std::optional opt; // expected-error-re {{{{declaration of variable 'opt' with deduced type 'std::optional' requires an initializer|no viable constructor or deduction guide for deduction of template arguments of 'optional'}}}} +// clang-6 gives a bogus error here: +// declaration of variable 'opt' with deduced type 'std::optional' requires an initializer +// clang-7 (and later) give a better message: +// no viable constructor or deduction guide for deduction of template arguments of 'optional' +// So we check for one or the other. + } + + { +// optional(nullopt_t) + std::optional opt(std::nullopt); // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with nullopt_t is ill-formed"}} + } +} diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp new file mode 100644 index 0000000000000..6ce35a489d435 --- /dev/null +++ b/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp @@ -0,0 +1,54 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <optional> +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5, apple-clang-9 +// UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +// Specifically, for the copy constructor. + + +// template<class T> +// optional(T) -> optional<T>; + + +#include <optional> +#include <cassert> + +struct A {}; + +int main() +{ +// Test the explicit deduction guides + { +// optional(T) + std::optional opt(5); + static_assert(std::is_same_v<decltype(opt), std::optional<int>>, ""); + assert(static_cast<bool>(opt)); + assert(*opt == 5); + } + + { +// optional(T) + std::optional opt(A{}); + static_assert(std::is_same_v<decltype(opt), std::optional<A>>, ""); + assert(static_cast<bool>(opt)); + } + +// Test the implicit deduction guides + { +// optional(optional); + std::optional<char> source('A'); + std::optional opt(source); + static_assert(std::is_same_v<decltype(opt), std::optional<char>>, ""); + assert(static_cast<bool>(opt) == static_cast<bool>(source)); + assert(*opt == *source); + } +} diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp index 78446976431e9..457df5602850f 100644 --- a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp @@ -1,3 +1,4 @@ +// -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure @@ -11,21 +12,80 @@ // <tuple> -// Test the diagnostics libc++ generates for invalid reference binding. -// Libc++ attempts to diagnose the following cases: -// * Constructing an lvalue reference from an rvalue. -// * Constructing an rvalue reference from an lvalue. +// See llvm.org/PR20855 #include <tuple> #include <string> -#include <functional> #include <cassert> +#include "test_macros.h" + +#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary) +# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(__reference_binds_to_temporary(__VA_ARGS__), "") +# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) static_assert(!__reference_binds_to_temporary(__VA_ARGS__), "") +#else +# define ASSERT_REFERENCE_BINDS_TEMPORARY(...) static_assert(true, "") +# define ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(...) static_assert(true, "") +#endif + +template <class Tp> +struct ConvertsTo { + using RawTp = typename std::remove_cv< typename std::remove_reference<Tp>::type>::type; + + operator Tp() const { + return static_cast<Tp>(value); + } + + mutable RawTp value; +}; + +struct Base {}; +struct Derived : Base {}; + + +static_assert(std::is_same<decltype("abc"), decltype(("abc"))>::value, ""); +ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype("abc")); +ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, decltype(("abc"))); +ASSERT_REFERENCE_BINDS_TEMPORARY(std::string const&, const char*&&); + +ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(int&, const ConvertsTo<int&>&); +ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(const int&, ConvertsTo<int&>&); +ASSERT_NOT_REFERENCE_BINDS_TEMPORARY(Base&, Derived&); + static_assert(std::is_constructible<int&, std::reference_wrapper<int>>::value, ""); static_assert(std::is_constructible<int const&, std::reference_wrapper<int>>::value, ""); +template <class T> struct CannotDeduce { + using type = T; +}; -int main() { +template <class ...Args> +void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {} + +void compile_tests() { + { + F<int, int const&>(std::make_tuple(42, 42)); + } + { + F<int, int const&>(std::make_tuple<const int&, const int&>(42, 42)); + std::tuple<int, int const&> t(std::make_tuple<const int&, const int&>(42, 42)); + } + { + auto fn = &F<int, std::string const&>; + fn(std::tuple<int, std::string const&>(42, std::string("a"))); + fn(std::make_tuple(42, std::string("a"))); + } + { + Derived d; + std::tuple<Base&, Base const&> t(d, d); + } + { + ConvertsTo<int&> ct; + std::tuple<int, int&> t(42, ct); + } +} + +void allocator_tests() { std::allocator<void> alloc; int x = 42; { @@ -69,3 +129,9 @@ int main() { assert(&std::get<0>(t4) == &x); } } + + +int main() { + compile_tests(); + allocator_tests(); +} diff --git a/test/std/utilities/utility/exchange/exchange.pass.cpp b/test/std/utilities/utility/exchange/exchange.pass.cpp index 2d01d6c8c8afb..1a5007ea41fb7 100644 --- a/test/std/utilities/utility/exchange/exchange.pass.cpp +++ b/test/std/utilities/utility/exchange/exchange.pass.cpp @@ -8,14 +8,38 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11 -// utilities +// <utility> // exchange +// template<class T, class U=T> +// constexpr T // constexpr after C++17 +// exchange(T& obj, U&& new_value); + #include <utility> #include <cassert> #include <string> +#include "test_macros.h" + +#if TEST_STD_VER > 17 +TEST_CONSTEXPR bool test_constexpr() { + int v = 12; + + if (12 != std::exchange(v,23) || v != 23) + return false; + + if (23 != std::exchange(v,static_cast<short>(67)) || v != 67) + return false; + + if (67 != std::exchange<int, short>(v, {}) || v != 0) + return false; + return true; + } +#endif + + + int main() { { @@ -53,4 +77,8 @@ int main() assert ( std::exchange ( s3, "" ) == s2 ); assert ( s3.size () == 0 ); } + +#if TEST_STD_VER > 17 + static_assert(test_constexpr()); +#endif } diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp index 132443f66a7c5..90722c393c680 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/assign_const_pair_U_V.pass.cpp @@ -16,6 +16,11 @@ #include <utility> #include <cassert> +#include "test_macros.h" +#if TEST_STD_VER >= 11 +#include "archetypes.hpp" +#endif + int main() { { @@ -27,4 +32,21 @@ int main() assert(p2.first == 3); assert(p2.second == 4); } +#if TEST_STD_VER >= 11 + { + using C = TestTypes::TestType; + using P = std::pair<int, C>; + using T = std::pair<long, C>; + const T t(42, -42); + P p(101, 101); + C::reset_constructors(); + p = t; + assert(C::constructed == 0); + assert(C::assigned == 1); + assert(C::copy_assigned == 1); + assert(C::move_assigned == 0); + assert(p.first == 42); + assert(p.second.value == -42); + } +#endif } diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp index 38089200e4daa..f02e24b241408 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp @@ -49,7 +49,7 @@ int CountAssign::moved = 0; int main() { { - typedef std::pair<std::unique_ptr<int>, short> P; + typedef std::pair<std::unique_ptr<int>, int> P; P p1(std::unique_ptr<int>(new int(3)), 4); P p2; p2 = std::move(p1); diff --git a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp index 76dfc3f65a237..b7a89a84460d6 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp @@ -18,6 +18,7 @@ #include <utility> #include <memory> #include <cassert> +#include <archetypes.hpp> struct Base { @@ -40,4 +41,19 @@ int main() assert(p2.first == nullptr); assert(p2.second == 4); } + { + using C = TestTypes::TestType; + using P = std::pair<int, C>; + using T = std::pair<long, C>; + T t(42, -42); + P p(101, 101); + C::reset_constructors(); + p = std::move(t); + assert(C::constructed == 0); + assert(C::assigned == 1); + assert(C::copy_assigned == 0); + assert(C::move_assigned == 1); + assert(p.first == 42); + assert(p.second.value == -42); + } } diff --git a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp index 715b655377615..d2cb6b10984ee 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp @@ -57,7 +57,7 @@ struct ImplicitT { int main() { { - typedef std::pair<int, short> P1; + typedef std::pair<int, int> P1; typedef std::pair<double, long> P2; const P1 p1(3, 4); const P2 p2 = p1; @@ -154,7 +154,7 @@ int main() } #if TEST_STD_VER > 11 { - typedef std::pair<int, short> P1; + typedef std::pair<int, int> P1; typedef std::pair<double, long> P2; constexpr P1 p1(3, 4); constexpr P2 p2 = p1; diff --git a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp index f5d3bb621debc..7e40bed21820c 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp @@ -67,7 +67,7 @@ struct ImplicitT { int main() { { - typedef std::pair<std::unique_ptr<Derived>, short> P1; + typedef std::pair<std::unique_ptr<Derived>, int> P1; typedef std::pair<std::unique_ptr<Base>, long> P2; P1 p1(std::unique_ptr<Derived>(), 4); P2 p2 = std::move(p1); diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp index 608cdf9d6efbb..9d0bf55fb5385 100644 --- a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp +++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_init_list_args.pass.cpp @@ -73,6 +73,12 @@ void test_ctor_sfinae() { !std::is_constructible<V, std::in_place_index_t<2>, IL>::value, ""); static_assert(!test_convertible<V, std::in_place_index_t<2>, IL>(), ""); } + { // index not in variant + using V = std::variant<InitList, InitListArg, int>; + static_assert( + !std::is_constructible<V, std::in_place_index_t<3>, IL>::value, ""); + static_assert(!test_convertible<V, std::in_place_index_t<3>, IL>(), ""); + } } void test_ctor_basic() { diff --git a/test/support/Counter.h b/test/support/Counter.h index 602f35f706718..4a658c58c0646 100644 --- a/test/support/Counter.h +++ b/test/support/Counter.h @@ -45,8 +45,10 @@ namespace std { template <class T> struct hash<Counter<T> > - : public std::unary_function<Counter<T>, std::size_t> { + typedef Counter<T> argument_type; + typedef std::size_t result_type; + std::size_t operator()(const Counter<T>& x) const {return std::hash<T>(x.get());} }; } diff --git a/test/support/MoveOnly.h b/test/support/MoveOnly.h index 4afa8aef7104a..2eba8e7428af1 100644 --- a/test/support/MoveOnly.h +++ b/test/support/MoveOnly.h @@ -19,7 +19,6 @@ class MoveOnly { - friend class MoveOnly2; MoveOnly(const MoveOnly&); MoveOnly& operator=(const MoveOnly&); @@ -35,6 +34,8 @@ public: bool operator==(const MoveOnly& x) const {return data_ == x.data_;} bool operator< (const MoveOnly& x) const {return data_ < x.data_;} + MoveOnly operator+(const MoveOnly& x) const { return MoveOnly{data_ + x.data_}; } + MoveOnly operator*(const MoveOnly& x) const { return MoveOnly{data_ * x.data_}; } }; namespace std { diff --git a/test/support/count_new.hpp b/test/support/count_new.hpp index c001c0340fa2d..e3111e7a58f44 100644 --- a/test/support/count_new.hpp +++ b/test/support/count_new.hpp @@ -59,12 +59,20 @@ public: int outstanding_new; int new_called; int delete_called; + int aligned_new_called; + int aligned_delete_called; std::size_t last_new_size; + std::size_t last_new_align; + std::size_t last_delete_align; int outstanding_array_new; int new_array_called; int delete_array_called; + int aligned_new_array_called; + int aligned_delete_array_called; std::size_t last_new_array_size; + std::size_t last_new_array_align; + std::size_t last_delete_array_align; public: void newCalled(std::size_t s) @@ -82,6 +90,12 @@ public: last_new_size = s; } + void alignedNewCalled(std::size_t s, std::size_t a) { + newCalled(s); + ++aligned_new_called; + last_new_align = a; + } + void deleteCalled(void * p) { assert(p); @@ -89,6 +103,12 @@ public: ++delete_called; } + void alignedDeleteCalled(void *p, std::size_t a) { + deleteCalled(p); + ++aligned_delete_called; + last_delete_align = a; + } + void newArrayCalled(std::size_t s) { assert(disable_allocations == false); @@ -104,6 +124,12 @@ public: last_new_array_size = s; } + void alignedNewArrayCalled(std::size_t s, std::size_t a) { + newArrayCalled(s); + ++aligned_new_array_called; + last_new_array_align = a; + } + void deleteArrayCalled(void * p) { assert(p); @@ -111,6 +137,12 @@ public: ++delete_array_called; } + void alignedDeleteArrayCalled(void * p, std::size_t a) { + deleteArrayCalled(p); + ++aligned_delete_array_called; + last_delete_array_align = a; + } + void disableAllocations() { disable_allocations = true; @@ -121,7 +153,6 @@ public: disable_allocations = false; } - void reset() { disable_allocations = false; @@ -130,12 +161,18 @@ public: outstanding_new = 0; new_called = 0; delete_called = 0; + aligned_new_called = 0; + aligned_delete_called = 0; last_new_size = 0; + last_new_align = 0; outstanding_array_new = 0; new_array_called = 0; delete_array_called = 0; + aligned_new_array_called = 0; + aligned_delete_array_called = 0; last_new_array_size = 0; + last_new_array_align = 0; } public: @@ -174,6 +211,31 @@ public: return disable_checking || n != delete_called; } + bool checkAlignedNewCalledEq(int n) const + { + return disable_checking || n == aligned_new_called; + } + + bool checkAlignedNewCalledNotEq(int n) const + { + return disable_checking || n != aligned_new_called; + } + + bool checkAlignedNewCalledGreaterThan(int n) const + { + return disable_checking || aligned_new_called > n; + } + + bool checkAlignedDeleteCalledEq(int n) const + { + return disable_checking || n == aligned_delete_called; + } + + bool checkAlignedDeleteCalledNotEq(int n) const + { + return disable_checking || n != aligned_delete_called; + } + bool checkLastNewSizeEq(std::size_t n) const { return disable_checking || n == last_new_size; @@ -184,6 +246,26 @@ public: return disable_checking || n != last_new_size; } + bool checkLastNewAlignEq(std::size_t n) const + { + return disable_checking || n == last_new_align; + } + + bool checkLastNewAlignNotEq(std::size_t n) const + { + return disable_checking || n != last_new_align; + } + + bool checkLastDeleteAlignEq(std::size_t n) const + { + return disable_checking || n == last_delete_align; + } + + bool checkLastDeleteAlignNotEq(std::size_t n) const + { + return disable_checking || n != last_delete_align; + } + bool checkOutstandingArrayNewEq(int n) const { return disable_checking || n == outstanding_array_new; @@ -214,6 +296,31 @@ public: return disable_checking || n != delete_array_called; } + bool checkAlignedNewArrayCalledEq(int n) const + { + return disable_checking || n == aligned_new_array_called; + } + + bool checkAlignedNewArrayCalledNotEq(int n) const + { + return disable_checking || n != aligned_new_array_called; + } + + bool checkAlignedNewArrayCalledGreaterThan(int n) const + { + return disable_checking || aligned_new_array_called > n; + } + + bool checkAlignedDeleteArrayCalledEq(int n) const + { + return disable_checking || n == aligned_delete_array_called; + } + + bool checkAlignedDeleteArrayCalledNotEq(int n) const + { + return disable_checking || n != aligned_delete_array_called; + } + bool checkLastNewArraySizeEq(std::size_t n) const { return disable_checking || n == last_new_array_size; @@ -223,6 +330,16 @@ public: { return disable_checking || n != last_new_array_size; } + + bool checkLastNewArrayAlignEq(std::size_t n) const + { + return disable_checking || n == last_new_array_align; + } + + bool checkLastNewArrayAlignNotEq(std::size_t n) const + { + return disable_checking || n != last_new_array_align; + } }; #ifdef DISABLE_NEW_COUNT @@ -254,22 +371,65 @@ void operator delete(void* p) TEST_NOEXCEPT std::free(p); } - void* operator new[](std::size_t s) TEST_THROW_SPEC(std::bad_alloc) { getGlobalMemCounter()->newArrayCalled(s); return operator new(s); } - void operator delete[](void* p) TEST_NOEXCEPT { getGlobalMemCounter()->deleteArrayCalled(p); operator delete(p); } -#endif // DISABLE_NEW_COUNT +#ifndef TEST_HAS_NO_ALIGNED_ALLOCATION +#if defined(_LIBCPP_MSVCRT_LIKE) || \ + (!defined(_LIBCPP_VERSION) && defined(_WIN32)) +#define USE_ALIGNED_ALLOC +#endif +void* operator new(std::size_t s, std::align_val_t av) TEST_THROW_SPEC(std::bad_alloc) { + const std::size_t a = static_cast<std::size_t>(av); + getGlobalMemCounter()->alignedNewCalled(s, a); + void *ret; +#ifdef USE_ALIGNED_ALLOC + ret = _aligned_malloc(s, a); +#else + posix_memalign(&ret, a, s); +#endif + if (ret == nullptr) + detail::throw_bad_alloc_helper(); + return ret; +} + +void operator delete(void *p, std::align_val_t av) TEST_NOEXCEPT { + const std::size_t a = static_cast<std::size_t>(av); + getGlobalMemCounter()->alignedDeleteCalled(p, a); + if (p) { +#ifdef USE_ALIGNED_ALLOC + ::_aligned_free(p); +#else + ::free(p); +#endif + } +} + +void* operator new[](std::size_t s, std::align_val_t av) TEST_THROW_SPEC(std::bad_alloc) { + const std::size_t a = static_cast<std::size_t>(av); + getGlobalMemCounter()->alignedNewArrayCalled(s, a); + return operator new(s, av); +} + +void operator delete[](void *p, std::align_val_t av) TEST_NOEXCEPT { + const std::size_t a = static_cast<std::size_t>(av); + getGlobalMemCounter()->alignedDeleteArrayCalled(p, a); + return operator delete(p, av); +} + +#endif // TEST_HAS_NO_ALIGNED_ALLOCATION + +#endif // DISABLE_NEW_COUNT struct DisableAllocationGuard { explicit DisableAllocationGuard(bool disable = true) : m_disabled(disable) @@ -295,7 +455,6 @@ private: DisableAllocationGuard& operator=(DisableAllocationGuard const&); }; - struct RequireAllocationGuard { explicit RequireAllocationGuard(std::size_t RequireAtLeast = 1) : m_req_alloc(RequireAtLeast), diff --git a/test/support/filesystem_include.hpp b/test/support/filesystem_include.hpp new file mode 100644 index 0000000000000..731532a7be986 --- /dev/null +++ b/test/support/filesystem_include.hpp @@ -0,0 +1,13 @@ +#ifndef TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP +#define TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP + +#include <filesystem> +#include "test_macros.h" + +#if defined(_LIBCPP_VERSION) && TEST_STD_VER < 17 +namespace fs = std::__fs::filesystem; +#else +namespace fs = std::filesystem; +#endif + +#endif diff --git a/test/support/filesystem_test_helper.hpp b/test/support/filesystem_test_helper.hpp index 755be90351ffd..f027928700b96 100644 --- a/test/support/filesystem_test_helper.hpp +++ b/test/support/filesystem_test_helper.hpp @@ -1,15 +1,19 @@ #ifndef FILESYSTEM_TEST_HELPER_HPP #define FILESYSTEM_TEST_HELPER_HPP -#include <experimental/filesystem> +#include "filesystem_include.hpp" #include <cassert> #include <cstdio> // for printf #include <string> #include <fstream> #include <random> #include <chrono> +#include <vector> +#include <regex> -namespace fs = std::experimental::filesystem; +#include "test_macros.h" +#include "rapid-cxx-test.hpp" +#include "format_string.hpp" // static test helpers @@ -104,6 +108,20 @@ static const fs::path RecDirFollowSymlinksIterationList[] = { #error LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER must be defined #endif +namespace random_utils { +inline char to_hex(int ch) { + return ch < 10 ? static_cast<char>('0' + ch) + : static_cast<char>('a' + (ch - 10)); +} + +inline char random_hex_char() { + static std::mt19937 rd{std::random_device{}()}; + static std::uniform_int_distribution<int> mrand{0, 15}; + return to_hex(mrand(rd)); +} + +} // namespace random_utils + struct scoped_test_env { scoped_test_env() : test_root(random_env_path()) @@ -178,21 +196,11 @@ struct scoped_test_env fs::path const test_root; private: - static char to_hex(int ch) { - return ch < 10 ? static_cast<char>('0' + ch) - : static_cast<char>('a' + (ch - 10)); - } - - static char random_hex_char() { - static std::mt19937 rd { std::random_device{}() }; - static std::uniform_int_distribution<int> mrand{0, 15}; - return to_hex( mrand(rd) ); - } - static std::string unique_path_suffix() { std::string model = "test.%%%%%%"; for (auto & ch : model) { - if (ch == '%') ch = random_hex_char(); + if (ch == '%') + ch = random_utils::random_hex_char(); } return model; } @@ -383,8 +391,39 @@ bool checkCollectionsEqualBackwards( // We often need to test that the error_code was cleared if no error occurs // this function returns an error_code which is set to an error that will // never be returned by the filesystem functions. -inline std::error_code GetTestEC() { - return std::make_error_code(std::errc::address_family_not_supported); +inline std::error_code GetTestEC(unsigned Idx = 0) { + using std::errc; + auto GetErrc = [&]() { + switch (Idx) { + case 0: + return errc::address_family_not_supported; + case 1: + return errc::address_not_available; + case 2: + return errc::address_in_use; + case 3: + return errc::argument_list_too_long; + default: + assert(false && "Idx out of range"); + std::abort(); + } + }; + return std::make_error_code(GetErrc()); +} + +inline bool ErrorIsImp(const std::error_code& ec, + std::vector<std::errc> const& errors) { + for (auto errc : errors) { + if (ec == std::make_error_code(errc)) + return true; + } + return false; +} + +template <class... ErrcT> +inline bool ErrorIs(const std::error_code& ec, std::errc First, ErrcT... Rest) { + std::vector<std::errc> errors = {First, Rest...}; + return ErrorIsImp(ec, errors); } // Provide our own Sleep routine since std::this_thread::sleep_for is not @@ -401,4 +440,82 @@ void SleepFor(std::chrono::seconds dur) { ; } +inline bool PathEq(fs::path const& LHS, fs::path const& RHS) { + return LHS.native() == RHS.native(); +} + +struct ExceptionChecker { + std::errc expected_err; + fs::path expected_path1; + fs::path expected_path2; + unsigned num_paths; + const char* func_name; + std::string opt_message; + + explicit ExceptionChecker(std::errc first_err, const char* func_name, + std::string opt_msg = {}) + : expected_err{first_err}, num_paths(0), func_name(func_name), + opt_message(opt_msg) {} + explicit ExceptionChecker(fs::path p, std::errc first_err, + const char* func_name, std::string opt_msg = {}) + : expected_err(first_err), expected_path1(p), num_paths(1), + func_name(func_name), opt_message(opt_msg) {} + + explicit ExceptionChecker(fs::path p1, fs::path p2, std::errc first_err, + const char* func_name, std::string opt_msg = {}) + : expected_err(first_err), expected_path1(p1), expected_path2(p2), + num_paths(2), func_name(func_name), opt_message(opt_msg) {} + + void operator()(fs::filesystem_error const& Err) { + TEST_CHECK(ErrorIsImp(Err.code(), {expected_err})); + TEST_CHECK(Err.path1() == expected_path1); + TEST_CHECK(Err.path2() == expected_path2); + LIBCPP_ONLY(check_libcxx_string(Err)); + } + + void check_libcxx_string(fs::filesystem_error const& Err) { + std::string message = std::make_error_code(expected_err).message(); + + std::string additional_msg = ""; + if (!opt_message.empty()) { + additional_msg = opt_message + ": "; + } + auto transform_path = [](const fs::path& p) { + if (p.native().empty()) + return "\"\""; + return p.c_str(); + }; + std::string format = [&]() -> std::string { + switch (num_paths) { + case 0: + return format_string("filesystem error: in %s: %s%s", func_name, + additional_msg, message); + case 1: + return format_string("filesystem error: in %s: %s%s [%s]", func_name, + additional_msg, message, + transform_path(expected_path1)); + case 2: + return format_string("filesystem error: in %s: %s%s [%s] [%s]", + func_name, additional_msg, message, + transform_path(expected_path1), + transform_path(expected_path2)); + default: + TEST_CHECK(false && "unexpected case"); + return ""; + } + }(); + TEST_CHECK(format == Err.what()); + if (format != Err.what()) { + fprintf(stderr, + "filesystem_error::what() does not match expected output:\n"); + fprintf(stderr, " expected: \"%s\"\n", format.c_str()); + fprintf(stderr, " actual: \"%s\"\n\n", Err.what()); + } + } + + ExceptionChecker(ExceptionChecker const&) = delete; + ExceptionChecker& operator=(ExceptionChecker const&) = delete; + +}; + #endif /* FILESYSTEM_TEST_HELPER_HPP */ diff --git a/test/support/format_string.hpp b/test/support/format_string.hpp new file mode 100644 index 0000000000000..44dc30f551d15 --- /dev/null +++ b/test/support/format_string.hpp @@ -0,0 +1,71 @@ +#ifndef TEST_SUPPORT_FORMAT_STRING_HPP +#define TEST_SUPPORT_FORMAT_STRING_HPP + +#include <cstdio> +#include <string> +#include <memory> +#include <array> +#include <cstdarg> + +namespace format_string_detail { +inline std::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& xtarget; + bool active; + GuardVAList(va_list& val) : xtarget(val), active(true) {} + + void clear() { + if (active) + va_end(xtarget); + active = false; + } + ~GuardVAList() { + if (active) + va_end(xtarget); + } + }; + 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::array<char, 256> local_buff; + std::size_t size = local_buff.size(); + auto ret = ::vsnprintf(local_buff.data(), size, msg, args_cp); + + args_copy_guard.clear(); + + // handle empty expansion + if (ret == 0) + return std::string{}; + if (static_cast<std::size_t>(ret) < size) + return std::string(local_buff.data()); + + // we did not provide a long enough buffer on our first attempt. + // add 1 to size to account for null-byte in size cast to prevent overflow + size = static_cast<std::size_t>(ret) + 1; + auto buff_ptr = std::unique_ptr<char[]>(new char[size]); + ret = ::vsnprintf(buff_ptr.get(), size, msg, args); + return std::string(buff_ptr.get()); +} + +const char* unwrap(std::string& s) { return s.c_str(); } +template <class Arg> +Arg const& unwrap(Arg& a) { + static_assert(!std::is_class<Arg>::value, "cannot pass class here"); + return a; +} + +} // namespace format_string_detail + +template <class... Args> +std::string format_string(const char* fmt, Args const&... args) { + return format_string_detail::format_string_imp( + fmt, format_string_detail::unwrap(const_cast<Args&>(args))...); +} + +#endif // TEST_SUPPORT_FORMAT_STRING_HPP diff --git a/test/support/msvc_stdlib_force_include.hpp b/test/support/msvc_stdlib_force_include.hpp index 83120c7eb52bd..f2ec35fd05b0c 100644 --- a/test/support/msvc_stdlib_force_include.hpp +++ b/test/support/msvc_stdlib_force_include.hpp @@ -52,6 +52,9 @@ const AssertionDialogAvoider assertion_dialog_avoider{}; #define _MSVC_HAS_FEATURE_memory_sanitizer 0 #define _MSVC_HAS_FEATURE_thread_sanitizer 0 + #define __has_attribute(X) _MSVC_HAS_ATTRIBUTE_ ## X + #define _MSVC_HAS_ATTRIBUTE_vector_size 0 + // Silence compiler warnings. #pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored #pragma warning(disable: 4324) // structure was padded due to alignment specifier @@ -70,9 +73,6 @@ const AssertionDialogAvoider assertion_dialog_avoider{}; // atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix. #define _ENABLE_ATOMIC_ALIGNMENT_FIX - // Silence warnings about raw pointers and other unchecked iterators. - #define _SCL_SECURE_NO_WARNINGS - // Silence warnings about features that are deprecated in C++17. #define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS #endif // _LIBCXX_IN_DEVCRT diff --git a/test/support/platform_support.h b/test/support/platform_support.h index 020cdbf98e200..eae79541d7dd3 100644 --- a/test/support/platform_support.h +++ b/test/support/platform_support.h @@ -54,6 +54,8 @@ #include <stdio.h> #include <stdlib.h> +#include <codecvt> +#include <locale> #include <string> #if defined(_WIN32) || defined(__MINGW32__) #include <io.h> // _mktemp_s @@ -97,6 +99,16 @@ std::string get_temp_file_name() return Name; #endif } + +#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR +inline +std::wstring get_wide_temp_file_name() +{ + return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> >().from_bytes( + get_temp_file_name()); +} +#endif // _LIBCPP_HAS_OPEN_WITH_WCHAR + #endif // __CloudABI__ #endif // PLATFORM_SUPPORT_H diff --git a/test/support/rapid-cxx-test.hpp b/test/support/rapid-cxx-test.hpp index a25bda53109cf..bf027407a16b8 100644 --- a/test/support/rapid-cxx-test.hpp +++ b/test/support/rapid-cxx-test.hpp @@ -221,6 +221,24 @@ namespace Name \ } while (false) # +#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) \ + do { \ + TEST_SET_CHECKPOINT(); \ + ::rapid_cxx_test::test_outcome m_f(::rapid_cxx_test::failure_type::none, \ + __FILE__, TEST_FUNC_NAME(), __LINE__, \ + "TEST_CHECK_THROW_RESULT(" #Except \ + "," #Checker "," #__VA_ARGS__ ")", \ + ""); \ + try { \ + (static_cast<void>(__VA_ARGS__)); \ + m_f.type = ::rapid_cxx_test::failure_type::check; \ + } catch (Except const& Caught) { \ + Checker(Caught); \ + } \ + ::rapid_cxx_test::get_reporter().report(m_f); \ + } while (false) +# + #else // TEST_HAS_NO_EXCEPTIONS # define TEST_CHECK_NO_THROW(...) \ @@ -236,6 +254,7 @@ namespace Name \ # #define TEST_CHECK_THROW(Except, ...) ((void)0) +#define TEST_CHECK_THROW_RESULT(Except, Checker, ...) ((void)0) #endif // TEST_HAS_NO_EXCEPTIONS @@ -807,8 +826,8 @@ namespace rapid_cxx_test get_reporter().test_case_end(); } auto exit_code = get_reporter().failure_count() ? EXIT_FAILURE : EXIT_SUCCESS; - if (exit_code == EXIT_FAILURE) - get_reporter().print_summary(m_ts.name()); + if (exit_code == EXIT_FAILURE || get_reporter().unsupported_count()) + get_reporter().print_summary(m_ts.name()); return exit_code; } diff --git a/test/support/test_allocator.h b/test/support/test_allocator.h index e77796b676e74..60f9a21b244de 100644 --- a/test/support/test_allocator.h +++ b/test/support/test_allocator.h @@ -36,12 +36,37 @@ public: static int throw_after; static int count; static int alloc_count; + static int copied; + static int moved; + static int converted; + + const static int destructed_value = -1; + const static int default_value = 0; + const static int moved_value = INT_MAX; + + static void clear() { + assert(count == 0 && "clearing leaking allocator data?"); + count = 0; + time_to_throw = 0; + alloc_count = 0; + throw_after = INT_MAX; + clear_ctor_counters(); + } + + static void clear_ctor_counters() { + copied = 0; + moved = 0; + converted = 0; + } }; int test_alloc_base::count = 0; int test_alloc_base::time_to_throw = 0; int test_alloc_base::alloc_count = 0; int test_alloc_base::throw_after = INT_MAX; +int test_alloc_base::copied = 0; +int test_alloc_base::moved = 0; +int test_alloc_base::converted = 0; template <class T> class test_allocator @@ -65,13 +90,35 @@ public: test_allocator() TEST_NOEXCEPT : data_(0), id_(0) {++count;} explicit test_allocator(int i, int id = 0) TEST_NOEXCEPT : data_(i), id_(id) {++count;} - test_allocator(const test_allocator& a) TEST_NOEXCEPT - : data_(a.data_), id_(a.id_) {++count;} - template <class U> test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT - : data_(a.data_), id_(a.id_) {++count;} + test_allocator(const test_allocator& a) TEST_NOEXCEPT : data_(a.data_), + id_(a.id_) { + ++count; + ++copied; + assert(a.data_ != destructed_value && a.id_ != destructed_value && + "copying from destroyed allocator"); + } +#if TEST_STD_VER >= 11 + test_allocator(test_allocator&& a) TEST_NOEXCEPT : data_(a.data_), + id_(a.id_) { + ++count; + ++moved; + assert(a.data_ != destructed_value && a.id_ != destructed_value && + "moving from destroyed allocator"); + a.data_ = moved_value; + a.id_ = moved_value; + } +#endif + template <class U> + test_allocator(const test_allocator<U>& a) TEST_NOEXCEPT : data_(a.data_), + id_(a.id_) { + ++count; + ++converted; + } ~test_allocator() TEST_NOEXCEPT { assert(data_ >= 0); assert(id_ >= 0); - --count; data_ = -1; id_ = -1; + --count; + data_ = destructed_value; + id_ = destructed_value; } pointer address(reference x) const {return &x;} const_pointer address(const_reference x) const {return &x;} diff --git a/test/support/test_comparisons.h b/test/support/test_comparisons.h new file mode 100644 index 0000000000000..a3f8dd9f8c35f --- /dev/null +++ b/test/support/test_comparisons.h @@ -0,0 +1,175 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// A set of routines for testing the comparison operators of a type +// +// XXXX6 tests all six comparison operators +// XXXX2 tests only op== and op!= +// +// AssertComparisonsXAreNoexcept static_asserts that the operations are all noexcept. +// AssertComparisonsXReturnBool static_asserts that the operations return bool. +// AssertComparisonsXConvertibleToBool static_asserts that the operations return something convertible to bool. + + +#ifndef TEST_COMPARISONS_H +#define TEST_COMPARISONS_H + +#include <type_traits> +#include "test_macros.h" + +// Test all six comparison operations for sanity +template <class T> +TEST_CONSTEXPR_CXX14 bool testComparisons6(const T& t1, const T& t2, bool isEqual, bool isLess) +{ + if (isEqual) + { + if (!(t1 == t2)) return false; + if (!(t2 == t1)) return false; + if ( (t1 != t2)) return false; + if ( (t2 != t1)) return false; + if ( (t1 < t2)) return false; + if ( (t2 < t1)) return false; + if (!(t1 <= t2)) return false; + if (!(t2 <= t1)) return false; + if ( (t1 > t2)) return false; + if ( (t2 > t1)) return false; + if (!(t1 >= t2)) return false; + if (!(t2 >= t1)) return false; + } + else if (isLess) + { + if ( (t1 == t2)) return false; + if ( (t2 == t1)) return false; + if (!(t1 != t2)) return false; + if (!(t2 != t1)) return false; + if (!(t1 < t2)) return false; + if ( (t2 < t1)) return false; + if (!(t1 <= t2)) return false; + if ( (t2 <= t1)) return false; + if ( (t1 > t2)) return false; + if (!(t2 > t1)) return false; + if ( (t1 >= t2)) return false; + if (!(t2 >= t1)) return false; + } + else /* greater */ + { + if ( (t1 == t2)) return false; + if ( (t2 == t1)) return false; + if (!(t1 != t2)) return false; + if (!(t2 != t1)) return false; + if ( (t1 < t2)) return false; + if (!(t2 < t1)) return false; + if ( (t1 <= t2)) return false; + if (!(t2 <= t1)) return false; + if (!(t1 > t2)) return false; + if ( (t2 > t1)) return false; + if (!(t1 >= t2)) return false; + if ( (t2 >= t1)) return false; + } + + return true; +} + +// Easy call when you can init from something already comparable. +template <class T, class Param> +TEST_CONSTEXPR_CXX14 bool testComparisons6Values(Param val1, Param val2) +{ + const bool isEqual = val1 == val2; + const bool isLess = val1 < val2; + + return testComparisons6(T{val1}, T{val2}, isEqual, isLess); +} + +template <class T> +void AssertComparisons6AreNoexcept() +{ + ASSERT_NOEXCEPT(std::declval<const T&>() == std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() != std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() < std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() <= std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() > std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() >= std::declval<const T&>()); +} + +template <class T> +void AssertComparisons6ReturnBool() +{ + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() == std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() != std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() < std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() <= std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() > std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() >= std::declval<const T&>()), bool); +} + + +template <class T> +void AssertComparisons6ConvertibleToBool() +{ + static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() < std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() <= std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() > std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() >= std::declval<const T&>()), bool>::value), ""); +} + +// Test all six comparison operations for sanity +template <class T> +TEST_CONSTEXPR_CXX14 bool testComparisons2(const T& t1, const T& t2, bool isEqual) +{ + if (isEqual) + { + if (!(t1 == t2)) return false; + if (!(t2 == t1)) return false; + if ( (t1 != t2)) return false; + if ( (t2 != t1)) return false; + } + else /* greater */ + { + if ( (t1 == t2)) return false; + if ( (t2 == t1)) return false; + if (!(t1 != t2)) return false; + if (!(t2 != t1)) return false; + } + + return true; +} + +// Easy call when you can init from something already comparable. +template <class T, class Param> +TEST_CONSTEXPR_CXX14 bool testComparisons2Values(Param val1, Param val2) +{ + const bool isEqual = val1 == val2; + + return testComparisons2(T{val1}, T{val2}, isEqual); +} + +template <class T> +void AssertComparisons2AreNoexcept() +{ + ASSERT_NOEXCEPT(std::declval<const T&>() == std::declval<const T&>()); + ASSERT_NOEXCEPT(std::declval<const T&>() != std::declval<const T&>()); +} + +template <class T> +void AssertComparisons2ReturnBool() +{ + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() == std::declval<const T&>()), bool); + ASSERT_SAME_TYPE(decltype(std::declval<const T&>() != std::declval<const T&>()), bool); +} + + +template <class T> +void AssertComparisons2ConvertibleToBool() +{ + static_assert((std::is_convertible<decltype(std::declval<const T&>() == std::declval<const T&>()), bool>::value), ""); + static_assert((std::is_convertible<decltype(std::declval<const T&>() != std::declval<const T&>()), bool>::value), ""); +} + +#endif // TEST_COMPARISONS_H diff --git a/test/support/test_macros.h b/test/support/test_macros.h index 257875a35ed2f..dbbfd53094e61 100644 --- a/test/support/test_macros.h +++ b/test/support/test_macros.h @@ -27,10 +27,8 @@ #define TEST_HAS_FEATURE(X) 0 #endif -#ifdef __has_include -#define TEST_HAS_INCLUDE(X) __has_include(X) -#else -#define TEST_HAS_INCLUDE(X) 0 +#ifndef __has_include +#define __has_include(...) 0 #endif #ifdef __has_extension @@ -90,7 +88,7 @@ #endif // Attempt to deduce GCC version -#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>) +#if defined(_LIBCPP_VERSION) && __has_include(<features.h>) #include <features.h> #define TEST_HAS_GLIBC #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) @@ -157,12 +155,23 @@ #define TEST_NORETURN [[noreturn]] #endif +#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \ + (!(TEST_STD_VER > 14 || \ + (defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606L))) +#define TEST_HAS_NO_ALIGNED_ALLOCATION +#endif + #if defined(_LIBCPP_SAFE_STATIC) #define TEST_SAFE_STATIC _LIBCPP_SAFE_STATIC #else #define TEST_SAFE_STATIC #endif +// FIXME: Fix this feature check when either (A) a compiler provides a complete +// implementation, or (b) a feature check macro is specified +#define TEST_HAS_NO_SPACESHIP_OPERATOR + + #if TEST_STD_VER < 11 #define ASSERT_NOEXCEPT(...) #define ASSERT_NOT_NOEXCEPT(...) @@ -215,8 +224,18 @@ struct is_same<T, T> { enum {value = 1}; }; #if defined(__GNUC__) || defined(__clang__) template <class Tp> -inline void DoNotOptimize(Tp const& value) { - asm volatile("" : : "g"(value) : "memory"); +inline +void DoNotOptimize(Tp const& value) { + asm volatile("" : : "r,m"(value) : "memory"); +} + +template <class Tp> +inline void DoNotOptimize(Tp& value) { +#if defined(__clang__) + asm volatile("" : "+r,m"(value) : : "memory"); +#else + asm volatile("" : "+m,r"(value) : : "memory"); +#endif } #else #include <intrin.h> @@ -228,6 +247,7 @@ inline void DoNotOptimize(Tp const& value) { } #endif + #if defined(__GNUC__) #pragma GCC diagnostic pop #endif diff --git a/test/support/test_memory_resource.hpp b/test/support/test_memory_resource.hpp index b3472c8b61055..4b8167ba03933 100644 --- a/test/support/test_memory_resource.hpp +++ b/test/support/test_memory_resource.hpp @@ -28,7 +28,7 @@ // because it can't include <experimental/memory_resource> template <> struct TransformErasedTypeAlloc<std::experimental::erased_type> { - using type = std::experimental::pmr::memory_resource*; + using type = std::experimental::pmr::polymorphic_allocator<int>; }; template <class ProviderT, int = 0> diff --git a/test/support/verbose_assert.h b/test/support/verbose_assert.h new file mode 100644 index 0000000000000..353e71cfc67eb --- /dev/null +++ b/test/support/verbose_assert.h @@ -0,0 +1,222 @@ +#ifndef TEST_SUPPORT_VERBOSE_ASSERT +#define TEST_SUPPORT_VERBOSE_ASSERT + +#include <iostream> +#include <cstdio> +#include <sstream> +#include <string> +#include "test_macros.h" + +namespace verbose_assert { + +typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&); + +template <class Stream, class Tp, + class = decltype(std::declval<Stream&>() << std::declval<Tp const&>())> +std::true_type IsStreamableImp(int); +template <class Stream, class Tp> std::false_type IsStreamableImp(long); + +template <class Stream, class Tp> +struct IsStreamable : decltype(IsStreamableImp<Stream, Tp>(0)) {}; + +template <class Tp, int ST = (IsStreamable<decltype(std::cerr), Tp>::value ? 1 + : (IsStreamable<decltype(std::wcerr), Tp>::value ? 2 : -1))> +struct SelectStream { + static_assert(ST == -1, "specialization required for ST != -1"); + static void Print(Tp const&) { std::clog << "Value Not Streamable!\n"; } +}; + +template <class Tp> +struct SelectStream<Tp, 1> { + static void Print(Tp const& val) { std::cerr << val; } +}; + +template <class Tp> +struct SelectStream<Tp, 2> { + static void Print(Tp const& val) { std::wcerr << val; } +}; + +struct AssertData { + AssertData(const char* xcheck, const char* xfile, const char* xfunc, + unsigned long xline, bool xpassed = true) + : passed(xpassed), check(xcheck), file(xfile), func(xfunc), line(xline), + msg() {} + + AssertData& SetFailed(std::string xmsg = std::string()) { + msg = xmsg; + passed = false; + return *this; + } + + void PrintFailed() const { + std::fprintf(stderr, "%s:%lu %s: Assertion '%s' failed.\n", file, line, + func, check); + if (!msg.empty()) + std::fprintf(stderr, "%s\n", msg.data()); + } + + bool passed; + const char* check; + const char* file; + const char* func; + unsigned long line; + std::string msg; +}; + +// AssertHandler is the class constructed by failing CHECK macros. AssertHandler +// will log information about the failures and abort when it is destructed. +class AssertHandler { +public: + AssertHandler(AssertData const& Data) + : passed(Data.passed) { + if (!passed) + Data.PrintFailed(); + } + + ~AssertHandler() TEST_NOEXCEPT_FALSE { + if (!passed) { + error_log << std::endl; + std::abort(); + } + } + + class LogType { + friend class AssertHandler; + + template <class Tp> + friend LogType& operator<<(LogType& log, Tp const& value) { + if (!log.is_disabled) { + SelectStream<Tp>::Print(value); + } + return log; + } + + friend LogType& operator<<(LogType& log, EndLType* m) { + if (!log.is_disabled) { + SelectStream<EndLType*>::Print(m); + } + return log; + } + + private: + LogType(bool disable) : is_disabled(disable) {} + bool is_disabled; + + LogType(LogType const&); + LogType& operator=(LogType const&); + }; + + LogType& GetLog() { + if (passed) + return null_log; + return error_log; + } + +private: + static LogType null_log; + static LogType error_log; + + AssertHandler& operator=(const AssertHandler&) = delete; + AssertHandler(const AssertHandler&) = delete; + AssertHandler() = delete; + +private: + bool passed; +}; + +AssertHandler::LogType AssertHandler::null_log(true); +AssertHandler::LogType AssertHandler::error_log(false); + +template <class It1> +std::string PrintRange(const char* Name, It1 F, It1 E) { + std::stringstream ss; + ss << " " << Name << " = ["; + while (F != E) { + ss << *F; + ++F; + if (F != E) + ss << ", "; + } + ss << "]\n"; + return ss.str(); +} + +template <class Tp, class Up> +std::string PrintMismatch(Tp const& LHS, Up const& RHS, int Elem) { + std::stringstream ss; + ss << " Element " << Elem << " mismatched: `" << LHS << "` != `" << RHS + << "`!\n"; + return ss.str(); +}; + +struct EqualToComp { + template <class Tp, class Up> + bool operator()(Tp const& LHS, Up const& RHS) const { + return LHS == RHS; + } +}; + +template <class It1, class It2, class Comp> +AssertData CheckCollectionsEqual(It1 F1, It1 E1, It2 F2, It2 E2, + AssertData Data, Comp C = EqualToComp()) { + const It1 F1Orig = F1; + const It2 F2Orig = F2; + bool Failed = false; + std::string ErrorMsg; + int Idx = 0; + while (F1 != E1 && F2 != E2) { + if (!(C(*F1, *F2))) { + ErrorMsg += PrintMismatch(*F1, *F2, Idx); + Failed = true; + break; + } + ++Idx; + ++F1; + ++F2; + } + if (!Failed && (F1 != E1 || F2 != E2)) { + ErrorMsg += " Ranges have different sizes!\n"; + Failed = true; + } + if (Failed) { + ErrorMsg += PrintRange("LHS", F1Orig, E1); + ErrorMsg += PrintRange("RHS", F2Orig, E2); + Data.SetFailed(ErrorMsg); + } + return Data; +} +} // namespace verbose_assert + +#ifdef __GNUC__ +#define ASSERT_FN_NAME() __PRETTY_FUNCTION__ +#else +#define ASSERT_FN_NAME() __func__ +#endif + +#define DISPLAY(...) " " #__VA_ARGS__ " = " << (__VA_ARGS__) << "\n" + +#define ASSERT(...) \ + ::verbose_assert::AssertHandler(::verbose_assert::AssertData( \ + #__VA_ARGS__, __FILE__, ASSERT_FN_NAME(), __LINE__,(__VA_ARGS__))).GetLog() + +#define ASSERT_EQ(LHS, RHS) \ + ASSERT(LHS == RHS) << DISPLAY(LHS) << DISPLAY(RHS) +#define ASSERT_NEQ(LHS, RHS) \ + ASSERT(LHS != RHS) << DISPLAY(LHS) << DISPLAY(RHS) +#define ASSERT_PRED(PRED, LHS, RHS) \ + ASSERT(PRED(LHS, RHS)) << DISPLAY(LHS) << DISPLAY(RHS) + +#define ASSERT_COLLECTION_EQ_COMP(F1, E1, F2, E2, Comp) \ + (::verbose_assert::AssertHandler( \ + ::verbose_assert::CheckCollectionsEqual( \ + F1, E1, F2, E2, \ + ::verbose_assert::AssertData("CheckCollectionsEqual(" #F1 ", " #E1 \ + ", " #F2 ", " #E2 ")", \ + __FILE__, ASSERT_FN_NAME(), __LINE__), \ + Comp)) \ + .GetLog()) + +#define ASSERT_COLLECTION_EQ(F1, E1, F2, E2) \ + ASSERT_COLLECTION_EQ_COMP(F1, E1, F2, E2, ::verbose_assert::EqualToComp()) + +#endif diff --git a/utils/google-benchmark/AUTHORS b/utils/google-benchmark/AUTHORS index c4b059df2581d..daea1f66f07f1 100644 --- a/utils/google-benchmark/AUTHORS +++ b/utils/google-benchmark/AUTHORS @@ -10,29 +10,38 @@ Albert Pretorius <pretoalb@gmail.com> Arne Beer <arne@twobeer.de> +Carto Christopher Seymour <chris.j.seymour@hotmail.com> David Coeurjolly <david.coeurjolly@liris.cnrs.fr> -Dominic Hamon <dma@stripysock.com> +Deniz Evrenci <denizevrenci@gmail.com> +Dirac Research +Dominik Czarnota <dominik.b.czarnota@gmail.com> 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> Google Inc. International Business Machines Corporation Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com> -Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com> +Jern-Kuan Leong <jernkuan@gmail.com> JianXiong Zhou <zhoujianxiong2@gmail.com> +Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com> Jussi Knuuttila <jussi.knuuttila@gmail.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> +MongoDB Inc. Nick Hutchinson <nshutchinson@gmail.com> Oleksandr Sochka <sasha.sochka@gmail.com> Paul Redmond <paul.redmond@gmail.com> Radoslav Yovchev <radoslav.tm@gmail.com> +Roman Lebedev <lebedev.ri@gmail.com> Shuo Chen <chenshuo@chenshuo.com> +Steinar H. Gunderson <sgunderson@bigfoot.com> +Stripe, Inc. +Yixuan Qiu <yixuanq@gmail.com> Yusuke Suzuki <utatane.tea@gmail.com> -Dirac Research Zbigniew Skowron <zbychs@gmail.com> -Dominik Czarnota <dominik.b.czarnota@gmail.com> diff --git a/utils/google-benchmark/CMakeLists.txt b/utils/google-benchmark/CMakeLists.txt index 1ba3133194413..8ddacabb6e0a5 100644 --- a/utils/google-benchmark/CMakeLists.txt +++ b/utils/google-benchmark/CMakeLists.txt @@ -1,9 +1,11 @@ cmake_minimum_required (VERSION 2.8.12) + project (benchmark) foreach(p CMP0054 # CMake 3.1 CMP0056 # export EXE_LINKER_FLAGS to try_run + CMP0057 # Support no if() IN_LIST operator ) if(POLICY ${p}) cmake_policy(SET ${p} NEW) @@ -14,11 +16,59 @@ 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) option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF) -option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library" OFF) +option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library." OFF) +option(BENCHMARK_ENABLE_INSTALL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" ON) + +# Allow unmet dependencies to be met using CMake's ExternalProject mechanics, which +# may require downloading the source code. +option(BENCHMARK_DOWNLOAD_DEPENDENCIES "Allow the downloading and in-tree building of unmet dependencies" OFF) + +# This option can be used to disable building and running unit tests which depend on gtest +# 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) + +set(ENABLE_ASSEMBLY_TESTS_DEFAULT OFF) +function(should_enable_assembly_tests) + if(CMAKE_BUILD_TYPE) + string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) + if (${CMAKE_BUILD_TYPE_LOWER} MATCHES "coverage") + # FIXME: The --coverage flag needs to be removed when building assembly + # tests for this to work. + return() + endif() + endif() + if (MSVC) + return() + elseif(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + return() + elseif(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + # FIXME: Make these work on 32 bit builds + return() + elseif(BENCHMARK_BUILD_32_BITS) + # FIXME: Make these work on 32 bit builds + return() + endif() + find_program(LLVM_FILECHECK_EXE FileCheck) + if (LLVM_FILECHECK_EXE) + set(LLVM_FILECHECK_EXE "${LLVM_FILECHECK_EXE}" CACHE PATH "llvm filecheck" FORCE) + message(STATUS "LLVM FileCheck Found: ${LLVM_FILECHECK_EXE}") + else() + message(STATUS "Failed to find LLVM FileCheck") + return() + endif() + set(ENABLE_ASSEMBLY_TESTS_DEFAULT ON PARENT_SCOPE) +endfunction() +should_enable_assembly_tests() + +# This option disables the building and running of the assembly verification tests +option(BENCHMARK_ENABLE_ASSEMBLY_TESTS "Enable building and running the assembly tests" + ${ENABLE_ASSEMBLY_TESTS_DEFAULT}) # Make sure we can import out CMake functions +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + # Read the git tags to determine the project version include(GetGitVersion) get_git_version(GIT_VERSION) @@ -80,7 +130,6 @@ else() # Turn compiler warnings up to 11 add_cxx_compiler_flag(-Wall) - add_cxx_compiler_flag(-Wextra) add_cxx_compiler_flag(-Wshadow) add_cxx_compiler_flag(-Werror RELEASE) @@ -89,14 +138,24 @@ else() add_cxx_compiler_flag(-pedantic) add_cxx_compiler_flag(-pedantic-errors) add_cxx_compiler_flag(-Wshorten-64-to-32) - add_cxx_compiler_flag(-Wfloat-equal) add_cxx_compiler_flag(-fstrict-aliasing) + # Disable warnings regarding deprecated parts of the library while building + # and testing those parts of the library. + add_cxx_compiler_flag(-Wno-deprecated-declarations) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + # Intel silently ignores '-Wno-deprecated-declarations', + # warning no. 1786 must be explicitly disabled. + # See #631 for rationale. + add_cxx_compiler_flag(-wd1786) + endif() + # Disable deprecation warnings for release builds (when -Werror is enabled). + add_cxx_compiler_flag(-Wno-deprecated RELEASE) + add_cxx_compiler_flag(-Wno-deprecated RELWITHDEBINFO) + add_cxx_compiler_flag(-Wno-deprecated MINSIZEREL) if (NOT BENCHMARK_ENABLE_EXCEPTIONS) add_cxx_compiler_flag(-fno-exceptions) endif() - if (NOT BENCHMARK_USE_LIBCXX) - add_cxx_compiler_flag(-Wzero-as-null-pointer-constant) - endif() + if (HAVE_CXX_FLAG_FSTRICT_ALIASING) if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing add_cxx_compiler_flag(-Wstrict-aliasing) @@ -130,28 +189,27 @@ else() if (GCC_RANLIB) set(CMAKE_RANLIB ${GCC_RANLIB}) endif() + elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + include(llvm-toolchain) endif() endif() # Coverage build type - set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING - "Flags used by the C++ compiler during coverage builds." + set(BENCHMARK_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" + CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE) - set(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING - "Flags used for linking binaries during coverage builds." + set(BENCHMARK_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" + CACHE STRING "Flags used for linking binaries during coverage builds." FORCE) - set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING - "Flags used by the shared libraries linker during coverage builds." + set(BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" + CACHE STRING "Flags used by the shared libraries linker during coverage builds." FORCE) mark_as_advanced( - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE) + BENCHMARK_CXX_FLAGS_COVERAGE + BENCHMARK_EXE_LINKER_FLAGS_COVERAGE + BENCHMARK_SHARED_LINKER_FLAGS_COVERAGE) set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." - FORCE) + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage.") add_cxx_compiler_flag(--coverage COVERAGE) endif() @@ -169,7 +227,7 @@ if (BENCHMARK_USE_LIBCXX) # linker flags appear before all linker inputs and -lc++ must appear after. list(APPEND BENCHMARK_CXX_LIBRARIES c++) else() - message(FATAL "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler") + message(FATAL_ERROR "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler") endif() endif(BENCHMARK_USE_LIBCXX) @@ -197,5 +255,8 @@ add_subdirectory(src) if (BENCHMARK_ENABLE_TESTING) enable_testing() + if (BENCHMARK_ENABLE_GTEST_TESTS) + include(HandleGTest) + endif() add_subdirectory(test) endif() diff --git a/utils/google-benchmark/CONTRIBUTORS b/utils/google-benchmark/CONTRIBUTORS index 8ca4565aa74b2..2ff2f2a8fa0f6 100644 --- a/utils/google-benchmark/CONTRIBUTORS +++ b/utils/google-benchmark/CONTRIBUTORS @@ -28,17 +28,23 @@ Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com> Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com> Christopher Seymour <chris.j.seymour@hotmail.com> David Coeurjolly <david.coeurjolly@liris.cnrs.fr> -Dominic Hamon <dma@stripysock.com> +Deniz Evrenci <denizevrenci@gmail.com> +Dominic Hamon <dma@stripysock.com> <dominic@google.com> +Dominik Czarnota <dominik.b.czarnota@gmail.com> 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> Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com> -Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com> +Jern-Kuan Leong <jernkuan@gmail.com> JianXiong Zhou <zhoujianxiong2@gmail.com> +Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com> +John Millikin <jmillikin@stripe.com> Jussi Knuuttila <jussi.knuuttila@gmail.com> -Kaito Udagawa <umireon@gmail.com> Kai Wolf <kai.wolf@gmail.com> +Kishan Kumar <kumar.kishan@outlook.com> +Kaito Udagawa <umireon@gmail.com> Lei Xu <eddyxu@gmail.com> Matt Clarkson <mattyclarkson@gmail.com> Maxim Vafin <maxvafin@gmail.com> @@ -48,9 +54,13 @@ Pascal Leroy <phl@google.com> Paul Redmond <paul.redmond@gmail.com> Pierre Phaneuf <pphaneuf@google.com> Radoslav Yovchev <radoslav.tm@gmail.com> +Raul Marin <rmrodriguez@cartodb.com> Ray Glover <ray.glover@uk.ibm.com> +Robert Guo <robert.guo@mongodb.com> +Roman Lebedev <lebedev.ri@gmail.com> Shuo Chen <chenshuo@chenshuo.com> -Yusuke Suzuki <utatane.tea@gmail.com> 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> -Dominik Czarnota <dominik.b.czarnota@gmail.com> diff --git a/utils/google-benchmark/README.md b/utils/google-benchmark/README.md index f16a9d7906a8c..80e69f6e10de0 100644 --- a/utils/google-benchmark/README.md +++ b/utils/google-benchmark/README.md @@ -2,6 +2,7 @@ [](https://travis-ci.org/google/benchmark) [](https://ci.appveyor.com/project/google/benchmark/branch/master) [](https://coveralls.io/r/google/benchmark) +[](https://slackin-iqtfqnpzxd.now.sh/) A library to support the benchmarking of functions, similar to unit-tests. @@ -13,13 +14,94 @@ IRC channel: https://freenode.net #googlebenchmark [Additional Tooling Documentation](docs/tools.md) +[Assembly Testing Documentation](docs/AssemblyTests.md) + + +## Building + +The basic steps for configuring and building the library look like this: + +```bash +$ 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 +``` + +Note that Google Benchmark requires Google Test to build and run the tests. This +dependency can be provided two ways: + +* Checkout the Google Test sources into `benchmark/googletest` as above. +* Otherwise, if `-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON` is specified during + configuration, the library will automatically download and build any required + dependencies. + +If you do not wish to build and run the tests, add `-DBENCHMARK_ENABLE_GTEST_TESTS=OFF` +to `CMAKE_ARGS`. + + +## Installation Guide + +For Ubuntu and Debian Based System + +First make sure you have git and cmake installed (If not please install it) + +``` +sudo apt-get install git +sudo apt-get install cmake +``` + +Now, let's clone the repository and build it + +``` +git clone https://github.com/google/benchmark.git +cd benchmark +git clone https://github.com/google/googletest.git +mkdir build +cd build +cmake .. -DCMAKE_BUILD_TYPE=RELEASE +make +``` + +We need to install the library globally now + +``` +sudo make install +``` + +Now you have google/benchmark installed in your machine +Note: Don't forget to link to pthread library while building + +## 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 +being made only upon the release of a new major version. + +Newer, experimental, features are implemented and tested on the +[`v2` branch](https://github.com/google/benchmark/tree/v2). Users who wish +to use, test, and provide feedback on the new features are encouraged to try +this branch. However, this branch provides no stability guarantees and reserves +the right to change and break the API at any time. + +## Prerequisite knowledge + +Before attempting to understand this framework one should ideally have some familiarity with the structure and format of the Google Test framework, upon which it is based. Documentation for Google Test, including a "Getting Started" (primer) guide, is available here: +https://github.com/google/googletest/blob/master/googletest/docs/primer.md + + ## Example usage ### Basic usage Define a function that executes the code to be measured. ```c++ +#include <benchmark/benchmark.h> + static void BM_StringCreation(benchmark::State& state) { - while (state.KeepRunning()) + for (auto _ : state) std::string empty_string; } // Register the function as a benchmark @@ -28,7 +110,7 @@ BENCHMARK(BM_StringCreation); // Define another benchmark static void BM_StringCopy(benchmark::State& state) { std::string x = "hello"; - while (state.KeepRunning()) + for (auto _ : state) std::string copy(x); } BENCHMARK(BM_StringCopy); @@ -36,6 +118,13 @@ BENCHMARK(BM_StringCopy); 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. + +The benchmark library will reporting the timing for the code within the `for(...)` loop. + ### 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 @@ -47,7 +136,7 @@ static void BM_memcpy(benchmark::State& state) { char* src = new char[state.range(0)]; char* dst = new char[state.range(0)]; memset(src, 'x', state.range(0)); - while (state.KeepRunning()) + for (auto _ : state) memcpy(dst, src, state.range(0)); state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(state.range(0))); @@ -80,22 +169,23 @@ insertion. ```c++ static void BM_SetInsert(benchmark::State& state) { - while (state.KeepRunning()) { + std::set<int> data; + for (auto _ : state) { state.PauseTiming(); - std::set<int> data = ConstructRandomSet(state.range(0)); + data = ConstructRandomSet(state.range(0)); state.ResumeTiming(); for (int j = 0; j < state.range(1); ++j) data.insert(RandomNumber()); } } BENCHMARK(BM_SetInsert) - ->Args({1<<10, 1}) - ->Args({1<<10, 8}) - ->Args({1<<10, 64}) + ->Args({1<<10, 128}) + ->Args({2<<10, 128}) + ->Args({4<<10, 128}) + ->Args({8<<10, 128}) ->Args({1<<10, 512}) - ->Args({8<<10, 1}) - ->Args({8<<10, 8}) - ->Args({8<<10, 64}) + ->Args({2<<10, 512}) + ->Args({4<<10, 512}) ->Args({8<<10, 512}); ``` @@ -105,7 +195,7 @@ product of the two specified ranges and will generate a benchmark for each such pair. ```c++ -BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}}); +BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}}); ``` For more complex patterns of inputs, passing a custom function to `Apply` allows @@ -131,7 +221,7 @@ running time and the normalized root-mean square error of string comparison. static void BM_StringCompare(benchmark::State& state) { std::string s1(state.range(0), '-'); std::string s2(state.range(0), '-'); - while (state.KeepRunning()) { + for (auto _ : state) { benchmark::DoNotOptimize(s1.compare(s2)); } state.SetComplexityN(state.range(0)); @@ -165,7 +255,7 @@ absence of multiprogramming. template <class Q> int BM_Sequential(benchmark::State& state) { Q q; typename Q::value_type v; - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = state.range(0); i--; ) q.push(v); for (int e = state.range(0); e--; ) @@ -181,7 +271,7 @@ BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10); Three macros are provided for adding benchmark templates. ```c++ -#if __cplusplus >= 201103L // C++11 and greater. +#ifdef BENCHMARK_HAS_CXX11 #define BENCHMARK_TEMPLATE(func, ...) // Takes any number of parameters. #else // C++ < C++11 #define BENCHMARK_TEMPLATE(func, arg1) @@ -190,6 +280,62 @@ Three macros are provided for adding benchmark templates. #define BENCHMARK_TEMPLATE2(func, arg1, arg2) ``` +### A Faster KeepRunning loop + +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. + +For example, an empty inner loop of using the ranged-based for method looks like: + +```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: +``` + +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: +``` + +Unless C++03 compatibility is required, the ranged-for variant of writing +the benchmark loop should be preferred. + ## 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)` @@ -199,11 +345,11 @@ The `test_case_name` is appended to the name of the benchmark and should describe the values passed. ```c++ -template <class ...ExtraArgs>` +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 +// 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")); ``` @@ -223,8 +369,7 @@ scope, the `RegisterBenchmark` can be called anywhere. This allows for benchmark tests to be registered programmatically. Additionally `RegisterBenchmark` allows any callable object to be registered -as a benchmark. Including capturing lambdas and function objects. This -allows the creation +as a benchmark. Including capturing lambdas and function objects. For Example: ```c++ @@ -240,9 +385,10 @@ int main(int argc, char** argv) { ### 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 called -`KeepRunning`, and all will have finished before KeepRunning returns false. As -such, any global setup or teardown can be wrapped in a check against the thread +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++ @@ -250,7 +396,7 @@ static void BM_MultiThreaded(benchmark::State& state) { if (state.thread_index == 0) { // Setup code here. } - while (state.KeepRunning()) { + for (auto _ : state) { // Run the test as normal. } if (state.thread_index == 0) { @@ -274,10 +420,10 @@ Without `UseRealTime`, CPU time is used by default. ## 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 `UseManualTime` function. When `UseManualTime` is used, the benchmarked code must call -`SetIterationTime` once per iteration of the `KeepRunning` loop to +`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 @@ -293,7 +439,7 @@ static void BM_ManualTiming(benchmark::State& state) { static_cast<double>(microseconds) }; - while (state.KeepRunning()) { + 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); @@ -316,7 +462,7 @@ functions can be used. ```c++ static void BM_test(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { int x = 0; for (int i=0; i < 64; ++i) { benchmark::DoNotOptimize(x += i); @@ -355,7 +501,7 @@ away. ```c++ static void BM_vector_push_back(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { std::vector<int> v; v.reserve(1); benchmark::DoNotOptimize(v.data()); // Allow v.data() to be clobbered. @@ -384,7 +530,7 @@ the minimum time, or the wallclock time is 5x minimum time. The minimum time is set as a flag `--benchmark_min_time` or per benchmark by calling `MinTime` on the registered benchmark object. -## Reporting the mean and standard devation by 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 @@ -392,19 +538,42 @@ benchmark. The number of runs of each benchmark is specified globally by the `--benchmark_repetitions` flag or on a per benchmark basis by calling -`Repetitions` on the registered benchmark object. When a benchmark is run -more than once the mean and standard deviation of the runs will be reported. +`Repetitions` on the registered benchmark object. When a benchmark is run more +than once the mean, median and standard deviation of the runs will be reported. Additionally the `--benchmark_report_aggregates_only={true|false}` flag or `ReportAggregatesOnly(bool)` function can be used to change how repeated tests are reported. By default the result of each repeated run is reported. When this -option is 'true' only the mean and standard deviation of the runs is reported. +option is `true` only the mean, median and standard deviation of the runs is reported. Calling `ReportAggregatesOnly(bool)` on a registered benchmark object overrides the value of the flag for that benchmark. +## User-defined statistics for repeated benchmarks +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. +The following code will specify a custom statistic to be calculated, defined +by a lambda function. + +```c++ +void BM_spin_empty(benchmark::State& state) { + for (auto _ : state) { + for (int x = 0; x < state.range(0); ++x) { + benchmark::DoNotOptimize(x); + } + } +} + +BENCHMARK(BM_spin_empty) + ->ComputeStatistics("max", [](const std::vector<double>& v) -> double { + return *(std::max_element(std::begin(v), std::end(v))); + }) + ->Arg(512); +``` + ## Fixtures Fixture tests are created by -first defining a type that derives from ::benchmark::Fixture and then +first defining a type that derives from `::benchmark::Fixture` and then creating/registering the tests using the following macros: * `BENCHMARK_F(ClassName, Method)` @@ -417,13 +586,13 @@ For Example: class MyFixture : public benchmark::Fixture {}; BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) { - while (st.KeepRunning()) { + for (auto _ : st) { ... } } BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) { - while (st.KeepRunning()) { + for (auto _ : st) { ... } } @@ -432,6 +601,31 @@ BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2); /* BarTest is now registered */ ``` +### Templated fixtures +Also you can create templated fixture by using the following macros: + +* `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 @@ -441,7 +635,7 @@ will add columns "Foo", "Bar" and "Baz" in its output: ```c++ static void UserCountersExample1(benchmark::State& state) { double numFoos = 0, numBars = 0, numBazs = 0; - while (state.KeepRunning()) { + for (auto _ : state) { // ... count Foo,Bar,Baz events } state.counters["Foo"] = numFoos; @@ -491,17 +685,85 @@ When you're compiling in C++11 mode or later you can use `insert()` with 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 When errors caused by external influences, such as file I/O and network communication, occur within a benchmark the `State::SkipWithError(const char* msg)` function can be used to skip that run of benchmark and report the error. Note that only future iterations of the -`KeepRunning()` are skipped. Users may explicitly return to exit the -benchmark immediately. +`KeepRunning()` are skipped. For the ranged-for version of the benchmark loop +Users must explicitly exit the loop, otherwise all iterations will be performed. +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 `KeepRunning()` loop. +including before and after the benchmark loop. For example: @@ -512,7 +774,7 @@ static void BM_test(benchmark::State& state) { state.SkipWithError("Resource is not good!"); // KeepRunning() loop will not be entered. } - while (state.KeepRunning()) { + for (state.KeepRunning()) { auto data = resource.read_data(); if (!resource.good()) { state.SkipWithError("Failed to read data!"); @@ -521,6 +783,14 @@ static void BM_test(benchmark::State& state) { do_stuff(data); } } + +static void BM_test_ranged_fo(benchmark::State & state) { + state.SkipWithError("test will not be entered"); + for (auto _ : state) { + state.SkipWithError("Failed!"); + break; // REQUIRED to prevent all further iterations. + } +} ``` ## Running a subset of the benchmarks @@ -547,7 +817,7 @@ The library supports multiple output formats. Use the 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 +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 @@ -560,7 +830,7 @@ BM_SetInsert/1024/10 33157 33648 21431 1.13369M 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 ever benchmark run. Example json +The `benchmarks` attribute contains a list of every benchmark run. Example json output looks like: ```json { @@ -628,9 +898,15 @@ To enable link-time optimisation, use 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. + ## Linking against the library -When using gcc, it is necessary to link against pthread to avoid runtime exceptions. -This is due to how gcc implements std::thread. + +When the library is built using GCC it is necessary to link with `-pthread`, +due to how GCC implements `std::thread`. + +For GCC 4.x failing to link to pthreads will lead to runtime exceptions, not linker errors. See [issue #67](https://github.com/google/benchmark/issues/67) for more details. ## Compiler Support @@ -650,10 +926,25 @@ Anything older *may* work. Note: Using the library and its headers in C++03 is supported. C++11 is only required to build the library. +## 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 +sudo cpupower frequency-set --governor powersave +``` + # Known Issues -### Windows +### Windows with CMake * Users must manually link `shlwapi.lib`. Failure to do so may result in unresolved symbols. +### Solaris + +* Users must explicitly link with kstat library (-lkstat compilation flag). diff --git a/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake index 0b176ba27f1f7..d0d2099814402 100644 --- a/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake +++ b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake @@ -38,7 +38,7 @@ function(add_cxx_compiler_flag FLAG) if(ARGV1) string(TOUPPER "_${VARIANT}" VARIANT) endif() - set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE) + set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${BENCHMARK_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE) endif() endfunction() @@ -62,3 +62,13 @@ function(add_required_cxx_compiler_flag FLAG) message(FATAL_ERROR "Required flag '${FLAG}' is not supported by the compiler") endif() endfunction() + +function(check_cxx_warning_flag FLAG) + mangle_compiler_flag("${FLAG}" MANGLED_FLAG) + set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + # Add -Werror to ensure the compiler generates an error if the warning flag + # doesn't exist. + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror ${FLAG}") + check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG}) + set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}") +endfunction() diff --git a/utils/google-benchmark/cmake/CXXFeatureCheck.cmake b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake index 6efe6a84ee493..c4c4d660f1eba 100644 --- a/utils/google-benchmark/cmake/CXXFeatureCheck.cmake +++ b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake @@ -22,16 +22,37 @@ function(cxx_feature_check FILE) string(TOUPPER ${FILE} VAR) string(TOUPPER "HAVE_${VAR}" FEATURE) if (DEFINED HAVE_${VAR}) + set(HAVE_${VAR} 1 PARENT_SCOPE) + add_definitions(-DHAVE_${VAR}) return() endif() - message("-- Performing Test ${FEATURE}") - try_run(RUN_${FEATURE} COMPILE_${FEATURE} - ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp - CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS} - LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}) + + if (NOT DEFINED COMPILE_${FEATURE}) + message("-- Performing Test ${FEATURE}") + if(CMAKE_CROSSCOMPILING) + try_compile(COMPILE_${FEATURE} + ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp + CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS} + LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}) + if(COMPILE_${FEATURE}) + message(WARNING + "If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0") + set(RUN_${FEATURE} 0) + else() + set(RUN_${FEATURE} 1) + endif() + else() + message("-- Performing Test ${FEATURE}") + try_run(RUN_${FEATURE} COMPILE_${FEATURE} + ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp + CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS} + LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}) + endif() + endif() + if(RUN_${FEATURE} EQUAL 0) message("-- Performing Test ${FEATURE} -- success") - set(HAVE_${VAR} 1 CACHE INTERNAL "Feature test for ${FILE}" PARENT_SCOPE) + set(HAVE_${VAR} 1 PARENT_SCOPE) add_definitions(-DHAVE_${VAR}) else() if(NOT COMPILE_${FEATURE}) @@ -41,4 +62,3 @@ function(cxx_feature_check FILE) endif() endif() endfunction() - diff --git a/utils/google-benchmark/cmake/GetGitVersion.cmake b/utils/google-benchmark/cmake/GetGitVersion.cmake index 8dd948004597a..88cebe3a1caac 100644 --- a/utils/google-benchmark/cmake/GetGitVersion.cmake +++ b/utils/google-benchmark/cmake/GetGitVersion.cmake @@ -21,6 +21,7 @@ set(__get_git_version INCLUDED) function(get_git_version var) if(GIT_EXECUTABLE) execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8 + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE status OUTPUT_VARIABLE GIT_VERSION ERROR_QUIET) @@ -33,9 +34,11 @@ function(get_git_version var) # Work out if the repository is dirty execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_QUIET ERROR_QUIET) execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD -- + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_DIFF_INDEX ERROR_QUIET) string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY) diff --git a/utils/google-benchmark/cmake/HandleGTest.cmake b/utils/google-benchmark/cmake/HandleGTest.cmake new file mode 100644 index 0000000000000..7ce1a633d65a2 --- /dev/null +++ b/utils/google-benchmark/cmake/HandleGTest.cmake @@ -0,0 +1,113 @@ + +include(split_list) + +macro(build_external_gtest) + include(ExternalProject) + set(GTEST_FLAGS "") + if (BENCHMARK_USE_LIBCXX) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + list(APPEND GTEST_FLAGS -stdlib=libc++) + else() + message(WARNING "Unsupported compiler (${CMAKE_CXX_COMPILER}) when using libc++") + endif() + endif() + if (BENCHMARK_BUILD_32_BITS) + list(APPEND GTEST_FLAGS -m32) + endif() + if (NOT "${CMAKE_CXX_FLAGS}" STREQUAL "") + list(APPEND GTEST_FLAGS ${CMAKE_CXX_FLAGS}) + endif() + string(TOUPPER "${CMAKE_BUILD_TYPE}" GTEST_BUILD_TYPE) + if ("${GTEST_BUILD_TYPE}" STREQUAL "COVERAGE") + set(GTEST_BUILD_TYPE "DEBUG") + endif() + # FIXME: Since 10/Feb/2017 the googletest trunk has had a bug where + # -Werror=unused-function fires during the build on OS X. This is a temporary + # workaround to keep our travis bots from failing. It should be removed + # once gtest is fixed. + if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + list(APPEND GTEST_FLAGS "-Wno-unused-function") + endif() + split_list(GTEST_FLAGS) + set(EXCLUDE_FROM_ALL_OPT "") + set(EXCLUDE_FROM_ALL_VALUE "") + if (${CMAKE_VERSION} VERSION_GREATER "3.0.99") + set(EXCLUDE_FROM_ALL_OPT "EXCLUDE_FROM_ALL") + set(EXCLUDE_FROM_ALL_VALUE "ON") + endif() + ExternalProject_Add(googletest + ${EXCLUDE_FROM_ALL_OPT} ${EXCLUDE_FROM_ALL_VALUE} + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG master + PREFIX "${CMAKE_BINARY_DIR}/googletest" + INSTALL_DIR "${CMAKE_BINARY_DIR}/googletest" + CMAKE_CACHE_ARGS + -DCMAKE_BUILD_TYPE:STRING=${GTEST_BUILD_TYPE} + -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> + -DCMAKE_INSTALL_LIBDIR:PATH=<INSTALL_DIR>/lib + -DCMAKE_CXX_FLAGS:STRING=${GTEST_FLAGS} + -Dgtest_force_shared_crt:BOOL=ON + ) + + ExternalProject_Get_Property(googletest install_dir) + set(GTEST_INCLUDE_DIRS ${install_dir}/include) + file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIRS}) + + set(LIB_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(LIB_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}") + if("${GTEST_BUILD_TYPE}" STREQUAL "DEBUG") + set(LIB_SUFFIX "d${CMAKE_STATIC_LIBRARY_SUFFIX}") + endif() + + # Use gmock_main instead of gtest_main because it initializes gtest as well. + # Note: The libraries are listed in reverse order of their dependancies. + foreach(LIB gtest gmock gmock_main) + add_library(${LIB} UNKNOWN IMPORTED) + set_target_properties(${LIB} PROPERTIES + IMPORTED_LOCATION ${install_dir}/lib/${LIB_PREFIX}${LIB}${LIB_SUFFIX} + INTERFACE_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} + INTERFACE_LINK_LIBRARIES "${GTEST_BOTH_LIBRARIES}" + ) + add_dependencies(${LIB} googletest) + list(APPEND GTEST_BOTH_LIBRARIES ${LIB}) + endforeach() +endmacro(build_external_gtest) + +if (BENCHMARK_ENABLE_GTEST_TESTS) + if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/googletest) + set(GTEST_ROOT "${CMAKE_SOURCE_DIR}/googletest") + set(INSTALL_GTEST OFF CACHE INTERNAL "") + set(INSTALL_GMOCK OFF CACHE INTERNAL "") + add_subdirectory(${CMAKE_SOURCE_DIR}/googletest) + set(GTEST_BOTH_LIBRARIES gtest gmock gmock_main) + foreach(HEADER test mock) + # CMake 2.8 and older don't respect INTERFACE_INCLUDE_DIRECTORIES, so we + # have to add the paths ourselves. + set(HFILE g${HEADER}/g${HEADER}.h) + set(HPATH ${GTEST_ROOT}/google${HEADER}/include) + find_path(HEADER_PATH_${HEADER} ${HFILE} + NO_DEFAULT_PATHS + HINTS ${HPATH} + ) + if (NOT HEADER_PATH_${HEADER}) + message(FATAL_ERROR "Failed to find header ${HFILE} in ${HPATH}") + endif() + list(APPEND GTEST_INCLUDE_DIRS ${HEADER_PATH_${HEADER}}) + endforeach() + elseif(BENCHMARK_DOWNLOAD_DEPENDENCIES) + build_external_gtest() + else() + find_package(GTest REQUIRED) + find_path(GMOCK_INCLUDE_DIRS gmock/gmock.h + HINTS ${GTEST_INCLUDE_DIRS}) + if (NOT GMOCK_INCLUDE_DIRS) + message(FATAL_ERROR "Failed to find header gmock/gmock.h with hint ${GTEST_INCLUDE_DIRS}") + endif() + set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS}) + # FIXME: We don't currently require the gmock library to build the tests, + # and it's likely we won't find it, so we don't try. As long as we've + # found the gmock/gmock.h header and gtest_main that should be good enough. + endif() +endif() diff --git a/utils/google-benchmark/cmake/benchmark.pc.in b/utils/google-benchmark/cmake/benchmark.pc.in new file mode 100644 index 0000000000000..1e84bff68d811 --- /dev/null +++ b/utils/google-benchmark/cmake/benchmark.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: @PROJECT_NAME@ +Description: Google microbenchmark framework +Version: @VERSION@ + +Libs: -L${libdir} -lbenchmark +Cflags: -I${includedir} diff --git a/utils/google-benchmark/cmake/llvm-toolchain.cmake b/utils/google-benchmark/cmake/llvm-toolchain.cmake new file mode 100644 index 0000000000000..fc119e52fd26a --- /dev/null +++ b/utils/google-benchmark/cmake/llvm-toolchain.cmake @@ -0,0 +1,8 @@ +find_package(LLVMAr REQUIRED) +set(CMAKE_AR "${LLVMAR_EXECUTABLE}" CACHE FILEPATH "" FORCE) + +find_package(LLVMNm REQUIRED) +set(CMAKE_NM "${LLVMNM_EXECUTABLE}" CACHE FILEPATH "" FORCE) + +find_package(LLVMRanLib REQUIRED) +set(CMAKE_RANLIB "${LLVMRANLIB_EXECUTABLE}" CACHE FILEPATH "" FORCE) diff --git a/utils/google-benchmark/cmake/split_list.cmake b/utils/google-benchmark/cmake/split_list.cmake new file mode 100644 index 0000000000000..67aed3fdc8579 --- /dev/null +++ b/utils/google-benchmark/cmake/split_list.cmake @@ -0,0 +1,3 @@ +macro(split_list listname) + string(REPLACE ";" " " ${listname} "${${listname}}") +endmacro() diff --git a/utils/google-benchmark/docs/AssemblyTests.md b/utils/google-benchmark/docs/AssemblyTests.md new file mode 100644 index 0000000000000..1fbdc269b53d6 --- /dev/null +++ b/utils/google-benchmark/docs/AssemblyTests.md @@ -0,0 +1,147 @@ +# Assembly Tests + +The Benchmark library provides a number of functions whose primary +purpose in to affect assembly generation, including `DoNotOptimize` +and `ClobberMemory`. In addition there are other functions, +such as `KeepRunning`, for which generating good assembly is paramount. + +For these functions it's important to have tests that verify the +correctness and quality of the implementation. This requires testing +the code generated by the compiler. + +This document describes how the Benchmark library tests compiler output, +as well as how to properly write new tests. + + +## Anatomy of a Test + +Writing a test has two steps: + +* Write the code you want to generate assembly for. +* Add `// CHECK` lines to match against the verified assembly. + +Example: +```c++ + +// CHECK-LABEL: test_add: +extern "C" int test_add() { + extern int ExternInt; + return ExternInt + 1; + + // CHECK: movl ExternInt(%rip), %eax + // CHECK: addl %eax + // CHECK: ret +} + +``` + +#### LLVM Filecheck + +[LLVM's Filecheck](https://llvm.org/docs/CommandGuide/FileCheck.html) +is used to test the generated assembly against the `// CHECK` lines +specified in the tests source file. Please see the documentation +linked above for information on how to write `CHECK` directives. + +#### Tips and Tricks: + +* Tests should match the minimal amount of output required to establish +correctness. `CHECK` directives don't have to match on the exact next line +after the previous match, so tests should omit checks for unimportant +bits of assembly. ([`CHECK-NEXT`](https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-next-directive) +can be used to ensure a match occurs exactly after the previous match). + +* The tests are compiled with `-O3 -g0`. So we're only testing the +optimized output. + +* The assembly output is further cleaned up using `tools/strip_asm.py`. +This removes comments, assembler directives, and unused labels before +the test is run. + +* The generated and stripped assembly file for a test is output under +`<build-directory>/test/<test-name>.s` + +* Filecheck supports using [`CHECK` prefixes](https://llvm.org/docs/CommandGuide/FileCheck.html#cmdoption-check-prefixes) +to specify lines that should only match in certain situations. +The Benchmark tests use `CHECK-CLANG` and `CHECK-GNU` for lines that +are only expected to match Clang or GCC's output respectively. Normal +`CHECK` lines match against all compilers. (Note: `CHECK-NOT` and +`CHECK-LABEL` are NOT prefixes. They are versions of non-prefixed +`CHECK` lines) + +* Use `extern "C"` to disable name mangling for specific functions. This +makes them easier to name in the `CHECK` lines. + + +## Problems Writing Portable Tests + +Writing tests which check the code generated by a compiler are +inherently non-portable. Different compilers and even different compiler +versions may generate entirely different code. The Benchmark tests +must tolerate this. + +LLVM Filecheck provides a number of mechanisms to help write +"more portable" tests; including [matching using regular expressions](https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-pattern-matching-syntax), +allowing the creation of [named variables](https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-variables) +for later matching, and [checking non-sequential matches](https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-dag-directive). + +#### Capturing Variables + +For example, say GCC stores a variable in a register but Clang stores +it in memory. To write a test that tolerates both cases we "capture" +the destination of the store, and then use the captured expression +to write the remainder of the test. + +```c++ +// CHECK-LABEL: test_div_no_op_into_shr: +extern "C" void test_div_no_op_into_shr(int value) { + int divisor = 2; + benchmark::DoNotOptimize(divisor); // hide the value from the optimizer + return value / divisor; + + // CHECK: movl $2, [[DEST:.*]] + // CHECK: idivl [[DEST]] + // CHECK: ret +} +``` + +#### Using Regular Expressions to Match Differing Output + +Often tests require testing assembly lines which may subtly differ +between compilers or compiler versions. A common example of this +is matching stack frame addresses. In this case regular expressions +can be used to match the differing bits of output. For example: + +```c++ +int ExternInt; +struct Point { int x, y, z; }; + +// CHECK-LABEL: test_store_point: +extern "C" void test_store_point() { + Point p{ExternInt, ExternInt, ExternInt}; + benchmark::DoNotOptimize(p); + + // CHECK: movl ExternInt(%rip), %eax + // CHECK: movl %eax, -{{[0-9]+}}(%rsp) + // CHECK: movl %eax, -{{[0-9]+}}(%rsp) + // CHECK: movl %eax, -{{[0-9]+}}(%rsp) + // CHECK: ret +} +``` + +## Current Requirements and Limitations + +The tests require Filecheck to be installed along the `PATH` of the +build machine. Otherwise the tests will be disabled. + +Additionally, as mentioned in the previous section, codegen tests are +inherently non-portable. Currently the tests are limited to: + +* x86_64 targets. +* Compiled with GCC or Clang + +Further work could be done, at least on a limited basis, to extend the +tests to other architectures and compilers (using `CHECK` prefixes). + +Furthermore, the tests fail for builds which specify additional flags +that modify code generation, including `--coverage` or `-fsanitize=`. + diff --git a/utils/google-benchmark/docs/tools.md b/utils/google-benchmark/docs/tools.md index f176f74a48f8f..70500bd3223ce 100644 --- a/utils/google-benchmark/docs/tools.md +++ b/utils/google-benchmark/docs/tools.md @@ -11,49 +11,232 @@ $ compare_bench.py <old-benchmark> <new-benchmark> [benchmark options]... Where `<old-benchmark>` and `<new-benchmark>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file. +`[benchmark options]` will be passed to the benchmarks invocations. They can be anything that binary accepts, be it either normal `--benchmark_*` parameters, or some custom parameters your binary takes. + The sample output using the JSON test files under `Inputs/` gives: ``` bash $ ./compare_bench.py ./gbench/Inputs/test1_run1.json ./gbench/Inputs/test1_run2.json Comparing ./gbench/Inputs/test1_run1.json to ./gbench/Inputs/test1_run2.json -Benchmark Time CPU ----------------------------------------------- -BM_SameTimes +0.00 +0.00 -BM_2xFaster -0.50 -0.50 -BM_2xSlower +1.00 +1.00 -BM_10PercentFaster -0.10 -0.10 -BM_10PercentSlower +0.10 +0.10 +Benchmark Time CPU Time Old Time New CPU Old CPU New +------------------------------------------------------------------------------------------------------------- +BM_SameTimes +0.0000 +0.0000 10 10 10 10 +BM_2xFaster -0.5000 -0.5000 50 25 50 25 +BM_2xSlower +1.0000 +1.0000 50 100 50 100 +BM_1PercentFaster -0.0100 -0.0100 100 99 100 99 +BM_1PercentSlower +0.0100 +0.0100 100 101 100 101 +BM_10PercentFaster -0.1000 -0.1000 100 90 100 90 +BM_10PercentSlower +0.1000 +0.1000 100 110 100 110 +BM_100xSlower +99.0000 +99.0000 100 10000 100 10000 +BM_100xFaster -0.9900 -0.9900 10000 100 10000 100 +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 ``` +As you can note, the values in `Time` and `CPU` columns are calculated as `(new - old) / |old|`. + When a benchmark executable is run, the raw output from the benchmark is printed in real time to stdout. The sample output using `benchmark/basic_test` for both arguments looks like: ``` ./compare_bench.py test/basic_test test/basic_test --benchmark_filter=BM_empty.* -RUNNING: test/basic_test --benchmark_filter=BM_empty.* -Run on (4 X 4228.32 MHz CPU s) -2016-08-02 19:21:33 +RUNNING: test/basic_test --benchmark_filter=BM_empty.* --benchmark_out=/tmp/tmpN7LF3a +Run on (8 X 4000 MHz CPU s) +2017-11-07 23:28:36 +--------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------- -BM_empty 9 ns 9 ns 79545455 -BM_empty/threads:4 4 ns 9 ns 75268816 -BM_empty_stop_start 8 ns 8 ns 83333333 -BM_empty_stop_start/threads:4 3 ns 8 ns 83333332 -RUNNING: test/basic_test --benchmark_filter=BM_empty.* -Run on (4 X 4228.32 MHz CPU s) -2016-08-02 19:21:35 +--------------------------------------------------------------------- +BM_empty 4 ns 4 ns 170178757 +BM_empty/threads:8 1 ns 7 ns 103868920 +BM_empty_stop_start 0 ns 0 ns 1000000000 +BM_empty_stop_start/threads:8 0 ns 0 ns 1403031720 +RUNNING: /test/basic_test --benchmark_filter=BM_empty.* --benchmark_out=/tmp/tmplvrIp8 +Run on (8 X 4000 MHz CPU s) +2017-11-07 23:28:38 +--------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------- -BM_empty 9 ns 9 ns 76086957 -BM_empty/threads:4 4 ns 9 ns 76086956 -BM_empty_stop_start 8 ns 8 ns 87500000 -BM_empty_stop_start/threads:4 3 ns 8 ns 88607596 -Comparing test/basic_test to test/basic_test -Benchmark Time CPU ---------------------------------------------------------- -BM_empty +0.00 +0.00 -BM_empty/threads:4 +0.00 +0.00 -BM_empty_stop_start +0.00 +0.00 -BM_empty_stop_start/threads:4 +0.00 +0.00 +--------------------------------------------------------------------- +BM_empty 4 ns 4 ns 169534855 +BM_empty/threads:8 1 ns 7 ns 104188776 +BM_empty_stop_start 0 ns 0 ns 1000000000 +BM_empty_stop_start/threads:8 0 ns 0 ns 1404159424 +Comparing ../build/test/basic_test to ../build/test/basic_test +Benchmark Time CPU Time Old Time New CPU Old CPU New +--------------------------------------------------------------------------------------------------------------------- +BM_empty -0.0048 -0.0049 4 4 4 4 +BM_empty/threads:8 -0.0123 -0.0054 1 1 7 7 +BM_empty_stop_start -0.0000 -0.0000 0 0 0 0 +BM_empty_stop_start/threads:8 -0.0029 +0.0001 0 0 0 0 + ``` +As you can note, the values in `Time` and `CPU` columns are calculated as `(new - old) / |old|`. Obviously this example doesn't give any useful output, but it's intended to show the output format when 'compare_bench.py' needs to run benchmarks. + +## compare.py + +The `compare.py` can be used to compare the result of benchmarks. +There are three modes of operation: + +1. Just compare two benchmarks, what `compare_bench.py` did. +The program is invoked like: + +``` bash +$ compare.py benchmarks <benchmark_baseline> <benchmark_contender> [benchmark options]... +``` +Where `<benchmark_baseline>` and `<benchmark_contender>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file. + +`[benchmark options]` will be passed to the benchmarks invocations. They can be anything that binary accepts, be it either normal `--benchmark_*` parameters, or some custom parameters your binary takes. + +Example output: +``` +$ ./compare.py benchmarks ./a.out ./a.out +RUNNING: ./a.out --benchmark_out=/tmp/tmprBT5nW +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:16:44 +------------------------------------------------------ +Benchmark Time CPU Iterations +------------------------------------------------------ +BM_memcpy/8 36 ns 36 ns 19101577 211.669MB/s +BM_memcpy/64 76 ns 76 ns 9412571 800.199MB/s +BM_memcpy/512 84 ns 84 ns 8249070 5.64771GB/s +BM_memcpy/1024 116 ns 116 ns 6181763 8.19505GB/s +BM_memcpy/8192 643 ns 643 ns 1062855 11.8636GB/s +BM_copy/8 222 ns 222 ns 3137987 34.3772MB/s +BM_copy/64 1608 ns 1608 ns 432758 37.9501MB/s +BM_copy/512 12589 ns 12589 ns 54806 38.7867MB/s +BM_copy/1024 25169 ns 25169 ns 27713 38.8003MB/s +BM_copy/8192 201165 ns 201112 ns 3486 38.8466MB/s +RUNNING: ./a.out --benchmark_out=/tmp/tmpt1wwG_ +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:16:53 +------------------------------------------------------ +Benchmark Time CPU Iterations +------------------------------------------------------ +BM_memcpy/8 36 ns 36 ns 19397903 211.255MB/s +BM_memcpy/64 73 ns 73 ns 9691174 839.635MB/s +BM_memcpy/512 85 ns 85 ns 8312329 5.60101GB/s +BM_memcpy/1024 118 ns 118 ns 6438774 8.11608GB/s +BM_memcpy/8192 656 ns 656 ns 1068644 11.6277GB/s +BM_copy/8 223 ns 223 ns 3146977 34.2338MB/s +BM_copy/64 1611 ns 1611 ns 435340 37.8751MB/s +BM_copy/512 12622 ns 12622 ns 54818 38.6844MB/s +BM_copy/1024 25257 ns 25239 ns 27779 38.6927MB/s +BM_copy/8192 205013 ns 205010 ns 3479 38.108MB/s +Comparing ./a.out to ./a.out +Benchmark Time CPU Time Old Time New CPU Old CPU New +------------------------------------------------------------------------------------------------------ +BM_memcpy/8 +0.0020 +0.0020 36 36 36 36 +BM_memcpy/64 -0.0468 -0.0470 76 73 76 73 +BM_memcpy/512 +0.0081 +0.0083 84 85 84 85 +BM_memcpy/1024 +0.0098 +0.0097 116 118 116 118 +BM_memcpy/8192 +0.0200 +0.0203 643 656 643 656 +BM_copy/8 +0.0046 +0.0042 222 223 222 223 +BM_copy/64 +0.0020 +0.0020 1608 1611 1608 1611 +BM_copy/512 +0.0027 +0.0026 12589 12622 12589 12622 +BM_copy/1024 +0.0035 +0.0028 25169 25257 25169 25239 +BM_copy/8192 +0.0191 +0.0194 201165 205013 201112 205010 +``` + +What it does is for the every benchmark from the first run it looks for the benchmark with exactly the same name in the second run, and then compares the results. If the names differ, the benchmark is omitted from the diff. +As you can note, the values in `Time` and `CPU` columns are calculated as `(new - old) / |old|`. + +2. Compare two different filters of one benchmark +The program is invoked like: + +``` bash +$ compare.py filters <benchmark> <filter_baseline> <filter_contender> [benchmark options]... +``` +Where `<benchmark>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file. + +Where `<filter_baseline>` and `<filter_contender>` are the same regex filters that you would pass to the `[--benchmark_filter=<regex>]` parameter of the benchmark binary. + +`[benchmark options]` will be passed to the benchmarks invocations. They can be anything that binary accepts, be it either normal `--benchmark_*` parameters, or some custom parameters your binary takes. + +Example output: +``` +$ ./compare.py filters ./a.out BM_memcpy BM_copy +RUNNING: ./a.out --benchmark_filter=BM_memcpy --benchmark_out=/tmp/tmpBWKk0k +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:37:28 +------------------------------------------------------ +Benchmark Time CPU Iterations +------------------------------------------------------ +BM_memcpy/8 36 ns 36 ns 17891491 211.215MB/s +BM_memcpy/64 74 ns 74 ns 9400999 825.646MB/s +BM_memcpy/512 87 ns 87 ns 8027453 5.46126GB/s +BM_memcpy/1024 111 ns 111 ns 6116853 8.5648GB/s +BM_memcpy/8192 657 ns 656 ns 1064679 11.6247GB/s +RUNNING: ./a.out --benchmark_filter=BM_copy --benchmark_out=/tmp/tmpAvWcOM +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:37:33 +---------------------------------------------------- +Benchmark Time CPU Iterations +---------------------------------------------------- +BM_copy/8 227 ns 227 ns 3038700 33.6264MB/s +BM_copy/64 1640 ns 1640 ns 426893 37.2154MB/s +BM_copy/512 12804 ns 12801 ns 55417 38.1444MB/s +BM_copy/1024 25409 ns 25407 ns 27516 38.4365MB/s +BM_copy/8192 202986 ns 202990 ns 3454 38.4871MB/s +Comparing BM_memcpy to BM_copy (from ./a.out) +Benchmark Time CPU Time Old Time New CPU Old CPU New +-------------------------------------------------------------------------------------------------------------------- +[BM_memcpy vs. BM_copy]/8 +5.2829 +5.2812 36 227 36 227 +[BM_memcpy vs. BM_copy]/64 +21.1719 +21.1856 74 1640 74 1640 +[BM_memcpy vs. BM_copy]/512 +145.6487 +145.6097 87 12804 87 12801 +[BM_memcpy vs. BM_copy]/1024 +227.1860 +227.1776 111 25409 111 25407 +[BM_memcpy vs. BM_copy]/8192 +308.1664 +308.2898 657 202986 656 202990 +``` + +As you can see, it applies filter to the benchmarks, both when running the benchmark, and before doing the diff. And to make the diff work, the matches are replaced with some common string. Thus, you can compare two different benchmark families within one benchmark binary. +As you can note, the values in `Time` and `CPU` columns are calculated as `(new - old) / |old|`. + +3. Compare filter one from benchmark one to filter two from benchmark two: +The program is invoked like: + +``` bash +$ compare.py filters <benchmark_baseline> <filter_baseline> <benchmark_contender> <filter_contender> [benchmark options]... +``` + +Where `<benchmark_baseline>` and `<benchmark_contender>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file. + +Where `<filter_baseline>` and `<filter_contender>` are the same regex filters that you would pass to the `[--benchmark_filter=<regex>]` parameter of the benchmark binary. + +`[benchmark options]` will be passed to the benchmarks invocations. They can be anything that binary accepts, be it either normal `--benchmark_*` parameters, or some custom parameters your binary takes. + +Example output: +``` +$ ./compare.py benchmarksfiltered ./a.out BM_memcpy ./a.out BM_copy +RUNNING: ./a.out --benchmark_filter=BM_memcpy --benchmark_out=/tmp/tmp_FvbYg +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:38:27 +------------------------------------------------------ +Benchmark Time CPU Iterations +------------------------------------------------------ +BM_memcpy/8 37 ns 37 ns 18953482 204.118MB/s +BM_memcpy/64 74 ns 74 ns 9206578 828.245MB/s +BM_memcpy/512 91 ns 91 ns 8086195 5.25476GB/s +BM_memcpy/1024 120 ns 120 ns 5804513 7.95662GB/s +BM_memcpy/8192 664 ns 664 ns 1028363 11.4948GB/s +RUNNING: ./a.out --benchmark_filter=BM_copy --benchmark_out=/tmp/tmpDfL5iE +Run on (8 X 4000 MHz CPU s) +2017-11-07 21:38:32 +---------------------------------------------------- +Benchmark Time CPU Iterations +---------------------------------------------------- +BM_copy/8 230 ns 230 ns 2985909 33.1161MB/s +BM_copy/64 1654 ns 1653 ns 419408 36.9137MB/s +BM_copy/512 13122 ns 13120 ns 53403 37.2156MB/s +BM_copy/1024 26679 ns 26666 ns 26575 36.6218MB/s +BM_copy/8192 215068 ns 215053 ns 3221 36.3283MB/s +Comparing BM_memcpy (from ./a.out) to BM_copy (from ./a.out) +Benchmark Time CPU Time Old Time New CPU Old CPU New +-------------------------------------------------------------------------------------------------------------------- +[BM_memcpy vs. BM_copy]/8 +5.1649 +5.1637 37 230 37 230 +[BM_memcpy vs. BM_copy]/64 +21.4352 +21.4374 74 1654 74 1653 +[BM_memcpy vs. BM_copy]/512 +143.6022 +143.5865 91 13122 91 13120 +[BM_memcpy vs. BM_copy]/1024 +221.5903 +221.4790 120 26679 120 26666 +[BM_memcpy vs. BM_copy]/8192 +322.9059 +323.0096 664 215068 664 215053 +``` +This is a mix of the previous two modes, two (potentially different) benchmark binaries are run, and a different filter is applied to each one. +As you can note, the values in `Time` and `CPU` columns are calculated as `(new - old) / |old|`. diff --git a/utils/google-benchmark/include/benchmark/benchmark.h b/utils/google-benchmark/include/benchmark/benchmark.h index b3b0a8e947fb4..193fffc4beaa4 100644 --- a/utils/google-benchmark/include/benchmark/benchmark.h +++ b/utils/google-benchmark/include/benchmark/benchmark.h @@ -11,11 +11,1457 @@ // 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. + +// Support for registering benchmarks for functions. + +/* Example usage: +// Define a function that executes the code to be measured a +// specified number of times: +static void BM_StringCreation(benchmark::State& state) { + for (auto _ : state) + std::string empty_string; +} + +// Register the function as a benchmark +BENCHMARK(BM_StringCreation); + +// Define another benchmark +static void BM_StringCopy(benchmark::State& state) { + std::string x = "hello"; + for (auto _ : state) + std::string copy(x); +} +BENCHMARK(BM_StringCopy); + +// Augment the main() program to invoke benchmarks if specified +// via the --benchmarks command line flag. E.g., +// my_unittest --benchmark_filter=all +// my_unittest --benchmark_filter=BM_StringCreation +// my_unittest --benchmark_filter=String +// my_unittest --benchmark_filter='Copy|Creation' +int main(int argc, char** argv) { + benchmark::Initialize(&argc, argv); + benchmark::RunSpecifiedBenchmarks(); + return 0; +} + +// Sometimes a family of microbenchmarks 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 microbenchmarks for measuring the speed +// of memcpy() calls of different lengths: + +static void BM_memcpy(benchmark::State& state) { + char* src = new char[state.range(0)]; char* dst = new char[state.range(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))); + delete[] src; delete[] dst; +} +BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10); + +// The preceding code is quite repetitive, and can be replaced with the +// following short-hand. The following invocation will pick a few +// appropriate arguments in the specified range and will generate a +// microbenchmark for each such argument. +BENCHMARK(BM_memcpy)->Range(8, 8<<10); + +// You might have a microbenchmark that depends on two inputs. For +// example, the following code defines a family of microbenchmarks for +// measuring the speed of set insertion. +static void BM_SetInsert(benchmark::State& state) { + set<int> data; + for (auto _ : state) { + state.PauseTiming(); + data = ConstructRandomSet(state.range(0)); + state.ResumeTiming(); + for (int j = 0; j < state.range(1); ++j) + data.insert(RandomNumber()); + } +} +BENCHMARK(BM_SetInsert) + ->Args({1<<10, 128}) + ->Args({2<<10, 128}) + ->Args({4<<10, 128}) + ->Args({8<<10, 128}) + ->Args({1<<10, 512}) + ->Args({2<<10, 512}) + ->Args({4<<10, 512}) + ->Args({8<<10, 512}); + +// The preceding code is quite repetitive, and can be replaced with +// the following short-hand. The following macro will pick a few +// appropriate arguments in the product of the two specified ranges +// and will generate a microbenchmark for each such pair. +BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}}); + +// For more complex patterns of inputs, passing a custom function +// to Apply allows programmatic specification of an +// arbitrary set of arguments to run the microbenchmark on. +// The following example enumerates a dense range on +// one parameter, and a sparse range on the second. +static void CustomArguments(benchmark::internal::Benchmark* b) { + for (int i = 0; i <= 10; ++i) + for (int j = 32; j <= 1024*1024; j *= 8) + b->Args({i, j}); +} +BENCHMARK(BM_SetInsert)->Apply(CustomArguments); + +// Templated microbenchmarks work the same way: +// Produce then consume 'size' messages 'iters' times +// Measures throughput in the absence of multiprogramming. +template <class Q> int BM_Sequential(benchmark::State& state) { + Q q; + typename Q::value_type v; + for (auto _ : state) { + for (int i = state.range(0); i--; ) + q.push(v); + for (int e = state.range(0); e--; ) + q.Wait(&v); + } + // actually messages, not bytes: + state.SetBytesProcessed( + static_cast<int64_t>(state.iterations())*state.range(0)); +} +BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10); + +Use `Benchmark::MinTime(double t)` to set the minimum time used to run the +benchmark. This option overrides the `benchmark_min_time` flag. + +void BM_test(benchmark::State& state) { + ... body ... +} +BENCHMARK(BM_test)->MinTime(2.0); // Run for at least 2 seconds. + +In a multithreaded test, it is guaranteed that none of the threads will start +until all have reached the loop start, and all will have finished before any +thread exits the loop body. As such, any global setup or teardown you want to +do can be wrapped in a check against the thread index: + +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(4); + + +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: + +BENCHMARK(BM_test)->Unit(benchmark::kMillisecond); +*/ + #ifndef BENCHMARK_BENCHMARK_H_ #define BENCHMARK_BENCHMARK_H_ -#include "benchmark_api.h" -#include "macros.h" -#include "reporter.h" +// The _MSVC_LANG check should detect Visual Studio 2015 Update 3 and newer. +#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) +#define BENCHMARK_HAS_CXX11 +#endif + +#include <stdint.h> + +#include <algorithm> +#include <cassert> +#include <cstddef> +#include <iosfwd> +#include <map> +#include <set> +#include <string> +#include <vector> + +#if defined(BENCHMARK_HAS_CXX11) +#include <initializer_list> +#include <type_traits> +#include <utility> +#endif + +#if defined(_MSC_VER) +#include <intrin.h> // for _ReadWriteBarrier +#endif + +#ifndef BENCHMARK_HAS_CXX11 +#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + TypeName& operator=(const TypeName&) +#else +#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&) = delete; \ + TypeName& operator=(const TypeName&) = delete +#endif + +#if defined(__GNUC__) +#define BENCHMARK_UNUSED __attribute__((unused)) +#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 +#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x) +#else +#define BENCHMARK_NOEXCEPT +#define BENCHMARK_NOEXCEPT_OP(x) +#endif +#define __func__ __FUNCTION__ +#else +#define BENCHMARK_UNUSED +#define BENCHMARK_ALWAYS_INLINE +#define BENCHMARK_NOEXCEPT +#define BENCHMARK_NOEXCEPT_OP(x) +#endif + +#define BENCHMARK_INTERNAL_TOSTRING2(x) #x +#define BENCHMARK_INTERNAL_TOSTRING(x) BENCHMARK_INTERNAL_TOSTRING2(x) + +#if defined(__GNUC__) || defined(__clang__) +#define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y) +#define BENCHMARK_DEPRECATED_MSG(msg) __attribute__((deprecated(msg))) +#else +#define BENCHMARK_BUILTIN_EXPECT(x, y) x +#define BENCHMARK_DEPRECATED_MSG(msg) +#define BENCHMARK_WARNING_MSG(msg) \ + __pragma(message(__FILE__ "(" BENCHMARK_INTERNAL_TOSTRING( \ + __LINE__) ") : warning note: " msg)) +#endif + +#if defined(__GNUC__) && !defined(__clang__) +#define BENCHMARK_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +#endif + +namespace benchmark { +class BenchmarkReporter; + +void Initialize(int* argc, char** argv); + +// 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). +bool ReportUnrecognizedArguments(int argc, char** argv); + +// Generate a list of benchmarks matching the specified --benchmark_filter flag +// and if --benchmark_list_tests is specified return after printing the name +// of each matching benchmark. Otherwise run each matching benchmark and +// report the results. +// +// The second and third overload use the specified 'console_reporter' and +// 'file_reporter' respectively. 'file_reporter' will write to the file +// specified +// by '--benchmark_output'. If '--benchmark_output' is not given the +// 'file_reporter' is ignored. +// +// RETURNS: The number of matching benchmarks. +size_t RunSpecifiedBenchmarks(); +size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter); +size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter, + BenchmarkReporter* file_reporter); + +// If this routine is called, peak memory allocation past this point in the +// benchmark is reported at the end of the benchmark report line. (It is +// computed by running the benchmark once with a single iteration and a memory +// tracer.) +// TODO(dominic) +// void MemoryUsage(); + +namespace internal { +class Benchmark; +class BenchmarkImp; +class BenchmarkFamilies; + +void UseCharPointer(char const volatile*); + +// Take ownership of the pointer and register the benchmark. Return the +// registered benchmark. +Benchmark* RegisterBenchmarkInternal(Benchmark*); + +// Ensure that the standard streams are properly initialized in every TU. +int InitializeStreams(); +BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams(); + +} // namespace internal + +#if (!defined(__GNUC__) && !defined(__clang__)) || defined(__pnacl__) || \ + defined(__EMSCRIPTEN__) +#define BENCHMARK_HAS_NO_INLINE_ASSEMBLY +#endif + +// The DoNotOptimize(...) function can be used to prevent a value or +// expression from being optimized away by the compiler. This function is +// intended to add little to no overhead. +// See: https://youtu.be/nXaxk27zwlk?t=2441 +#ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY +template <class Tp> +inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { + asm volatile("" : : "r,m"(value) : "memory"); +} + +template <class Tp> +inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp& value) { +#if defined(__clang__) + asm volatile("" : "+r,m"(value) : : "memory"); +#else + asm volatile("" : "+m,r"(value) : : "memory"); +#endif +} + +// Force the compiler to flush pending writes to global memory. Acts as an +// effective read/write barrier +inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() { + asm volatile("" : : : "memory"); +} +#elif defined(_MSC_VER) +template <class Tp> +inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { + internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); + _ReadWriteBarrier(); +} + +inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() { _ReadWriteBarrier(); } +#else +template <class Tp> +inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { + internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); +} +// FIXME Add ClobberMemory() for non-gnu and non-msvc compilers +#endif + +// This class is used for user-defined counters. +class Counter { + public: + enum Flags { + kDefaults = 0, + // Mark the counter as a rate. It will be presented divided + // by the duration of the benchmark. + kIsRate = 1U << 0U, + // Mark the counter as a thread-average quantity. It will be + // presented divided by the number of threads. + kAvgThreads = 1U << 1U, + // Mark the counter as a thread-average rate. See above. + kAvgThreadsRate = kIsRate | kAvgThreads, + // Mark the counter as a constant value, valid/same for *every* iteration. + // When reporting, it will be *multiplied* by the iteration count. + kIsIterationInvariant = 1U << 2U, + // Mark the counter as a constant rate. + // When reporting, it will be *multiplied* by the iteration count + // and then divided by the duration of the benchmark. + kIsIterationInvariantRate = kIsRate | kIsIterationInvariant, + // Mark the counter as a iteration-average quantity. + // 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 + }; + + double value; + Flags flags; + + BENCHMARK_ALWAYS_INLINE + Counter(double v = 0., Flags f = kDefaults) : value(v), flags(f) {} + + BENCHMARK_ALWAYS_INLINE operator double const&() const { return value; } + BENCHMARK_ALWAYS_INLINE operator double&() { return value; } +}; + +// A helper for user code to create unforeseen combinations of Flags, without +// having to do this cast manually each time, or providing this operator. +Counter::Flags inline operator|(const Counter::Flags& LHS, + const Counter::Flags& RHS) { + return static_cast<Counter::Flags>(static_cast<int>(LHS) | + static_cast<int>(RHS)); +} + +// This is the container for the user-defined counters. +typedef std::map<std::string, Counter> UserCounters; + +// TimeUnit is passed to a benchmark in order to specify the order of magnitude +// for the measured time. +enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond }; + +// BigO is passed to a benchmark in order to specify the asymptotic +// computational +// complexity for the benchmark. In case oAuto is selected, complexity will be +// calculated automatically to the best fit. +enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda }; + +// BigOFunc is passed to a benchmark in order to specify the asymptotic +// computational complexity for the benchmark. +typedef double(BigOFunc)(int64_t); + +// 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>&); + +struct Statistics { + std::string name_; + StatisticsFunc* compute_; + + Statistics(std::string name, StatisticsFunc* compute) + : name_(name), compute_(compute) {} +}; + +namespace internal { +class ThreadTimer; +class ThreadManager; + +enum ReportMode +#if defined(BENCHMARK_HAS_CXX11) + : unsigned +#else +#endif +{ RM_Unspecified, // The mode has not been manually specified + RM_Default, // The mode is user-specified as default. + RM_ReportAggregatesOnly }; +} // namespace internal + +// State is passed to a running Benchmark and contains state for the +// benchmark to use. +class State { + public: + struct StateIterator; + friend struct StateIterator; + + // Returns iterators used to run each iteration of a benchmark using a + // C++11 ranged-based for loop. These functions should not be called directly. + // + // REQUIRES: The benchmark has not started running yet. Neither begin nor end + // have been called previously. + // + // NOTE: KeepRunning may not be used after calling either of these functions. + BENCHMARK_ALWAYS_INLINE StateIterator begin(); + BENCHMARK_ALWAYS_INLINE StateIterator end(); + + // Returns true if the benchmark should continue through another iteration. + // NOTE: A benchmark may not return from the test until KeepRunning() has + // returned false. + bool KeepRunning(); + + // Returns true iff the benchmark should run n more iterations. + // REQUIRES: 'n' > 0. + // NOTE: A benchmark must not return from the test until KeepRunningBatch() + // has returned false. + // NOTE: KeepRunningBatch() may overshoot by up to 'n' iterations. + // + // Intended usage: + // while (state.KeepRunningBatch(1000)) { + // // process 1000 elements + // } + bool KeepRunningBatch(size_t n); + + // REQUIRES: timer is running and 'SkipWithError(...)' has not been called + // by the current thread. + // Stop the benchmark timer. If not called, the timer will be + // automatically stopped after the last iteration of the benchmark loop. + // + // For threaded benchmarks the PauseTiming() function only pauses the timing + // for the current thread. + // + // NOTE: The "real time" measurement is per-thread. If different threads + // report different measurements the largest one is reported. + // + // NOTE: PauseTiming()/ResumeTiming() are relatively + // heavyweight, and so their use should generally be avoided + // within each benchmark iteration, if possible. + void PauseTiming(); + + // REQUIRES: timer is not running and 'SkipWithError(...)' has not been called + // by the current thread. + // Start the benchmark timer. The timer is NOT running on entrance to the + // benchmark function. It begins running after control flow enters the + // benchmark loop. + // + // NOTE: PauseTiming()/ResumeTiming() are relatively + // heavyweight, and so their use should generally be avoided + // within each benchmark iteration, if possible. + void ResumeTiming(); + + // REQUIRES: 'SkipWithError(...)' has not been called previously by the + // current thread. + // Report the benchmark as resulting in an error with the specified 'msg'. + // After this call the user may explicitly 'return' from the benchmark. + // + // If the ranged-for style of benchmark loop is used, the user must explicitly + // break from the loop, otherwise all future iterations will be run. + // If the 'KeepRunning()' loop is used the current thread will automatically + // exit the loop at the end of the current iteration. + // + // For threaded benchmarks only the current thread stops executing and future + // calls to `KeepRunning()` will block until all threads have completed + // the `KeepRunning()` loop. If multiple threads report an error only the + // first error message is used. + // + // NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit + // the current scope immediately. If the function is called from within + // the 'KeepRunning()' loop the current iteration will finish. It is the users + // responsibility to exit the scope as needed. + void SkipWithError(const char* msg); + + // 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 + // specified. + // + // For threaded benchmarks the final value will be set to the largest + // reported values. + void SetIterationTime(double seconds); + + // Set the number of bytes processed by the current benchmark + // execution. This routine is typically called once at the end of a + // throughput oriented benchmark. If this routine is called with a + // value > 0, the report is printed in MB/sec instead of nanoseconds + // per iteration. + // + // REQUIRES: a benchmark has exited its benchmarking loop. + BENCHMARK_ALWAYS_INLINE + void SetBytesProcessed(int64_t bytes) { bytes_processed_ = bytes; } + + BENCHMARK_ALWAYS_INLINE + int64_t bytes_processed() const { return bytes_processed_; } + + // If this routine is called with complexity_n > 0 and complexity report is + // requested for the + // family benchmark, then current benchmark will be part of the computation + // and complexity_n will + // represent the length of N. + BENCHMARK_ALWAYS_INLINE + void SetComplexityN(int64_t complexity_n) { complexity_n_ = complexity_n; } + + BENCHMARK_ALWAYS_INLINE + int64_t complexity_length_n() { 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 + // executing benchmark. It is typically called at the end of a processing + // benchmark where a processing items/second output is desired. + // + // REQUIRES: a benchmark has exited its benchmarking loop. + BENCHMARK_ALWAYS_INLINE + void SetItemsProcessed(int64_t items) { items_processed_ = items; } + + BENCHMARK_ALWAYS_INLINE + int64_t items_processed() const { return items_processed_; } + + // If this routine is called, the specified label is printed at the + // end of the benchmark report line for the currently executing + // benchmark. Example: + // static void BM_Compress(benchmark::State& state) { + // ... + // double compress = input_size / output_size; + // state.SetLabel(StrFormat("compress:%.1f%%", 100.0*compression)); + // } + // Produces output that looks like: + // BM_Compress 50 50 14115038 compress:27.3% + // + // REQUIRES: a benchmark has exited its benchmarking loop. + void SetLabel(const char* label); + + void BENCHMARK_ALWAYS_INLINE SetLabel(const std::string& str) { + this->SetLabel(str.c_str()); + } + + // Range arguments for this run. CHECKs if the argument has been set. + BENCHMARK_ALWAYS_INLINE + int64_t range(std::size_t pos = 0) const { + assert(range_.size() > pos); + return range_[pos]; + } + + BENCHMARK_DEPRECATED_MSG("use 'range(0)' instead") + int64_t range_x() const { return range(0); } + + BENCHMARK_DEPRECATED_MSG("use 'range(1)' instead") + int64_t range_y() const { return range(1); } + + BENCHMARK_ALWAYS_INLINE + size_t iterations() const { + if (BENCHMARK_BUILTIN_EXPECT(!started_, false)) { + return 0; + } + return max_iterations - total_iterations_ + batch_leftover_; + } + + private + : // 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_; + + // 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_; + + public: + const size_t max_iterations; + + private: + bool started_; + bool finished_; + bool error_occurred_; + + private: // items we don't need on the first cache line + std::vector<int64_t> range_; + + int64_t bytes_processed_; + int64_t items_processed_; + + int64_t complexity_n_; + + public: + // Container for user-defined counters. + UserCounters counters; + // Index of the executing thread. Values from [0, threads). + const int thread_index; + // Number of threads concurrently executing the benchmark. + const int threads; + + // TODO(EricWF) make me private + State(size_t max_iters, const std::vector<int64_t>& ranges, int thread_i, + int n_threads, internal::ThreadTimer* timer, + internal::ThreadManager* manager); + + private: + void StartKeepRunning(); + // Implementation of KeepRunning() and KeepRunningBatch(). + // is_batch must be true unless n is 1. + bool KeepRunningInternal(size_t n, bool is_batch); + void FinishKeepRunning(); + internal::ThreadTimer* timer_; + internal::ThreadManager* manager_; + BENCHMARK_DISALLOW_COPY_AND_ASSIGN(State); +}; + +inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunning() { + return KeepRunningInternal(1, /*is_batch=*/false); +} + +inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningBatch(size_t n) { + return KeepRunningInternal(n, /*is_batch=*/true); +} + +inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningInternal(size_t n, + bool is_batch) { + // total_iterations_ is set to 0 by the constructor, and always set to a + // nonzero value by StartKepRunning(). + assert(n > 0); + // n must be 1 unless is_batch is true. + assert(is_batch || n == 1); + if (BENCHMARK_BUILTIN_EXPECT(total_iterations_ >= n, true)) { + total_iterations_ -= n; + return true; + } + if (!started_) { + StartKeepRunning(); + if (!error_occurred_ && total_iterations_ >= n) { + total_iterations_ -= n; + return true; + } + } + // For non-batch runs, total_iterations_ must be 0 by now. + if (is_batch && total_iterations_ != 0) { + batch_leftover_ = n - total_iterations_; + total_iterations_ = 0; + return true; + } + FinishKeepRunning(); + return false; +} + +struct State::StateIterator { + struct BENCHMARK_UNUSED Value {}; + typedef std::forward_iterator_tag iterator_category; + typedef Value value_type; + typedef Value reference; + typedef Value pointer; + typedef std::ptrdiff_t difference_type; + + private: + friend class State; + BENCHMARK_ALWAYS_INLINE + StateIterator() : cached_(0), parent_() {} + + BENCHMARK_ALWAYS_INLINE + explicit StateIterator(State* st) + : cached_(st->error_occurred_ ? 0 : st->max_iterations), parent_(st) {} + + public: + BENCHMARK_ALWAYS_INLINE + Value operator*() const { return Value(); } + + BENCHMARK_ALWAYS_INLINE + StateIterator& operator++() { + assert(cached_ > 0); + --cached_; + return *this; + } + + BENCHMARK_ALWAYS_INLINE + bool operator!=(StateIterator const&) const { + if (BENCHMARK_BUILTIN_EXPECT(cached_ != 0, true)) return true; + parent_->FinishKeepRunning(); + return false; + } + + private: + size_t cached_; + State* const parent_; +}; + +inline BENCHMARK_ALWAYS_INLINE State::StateIterator State::begin() { + return StateIterator(this); +} +inline BENCHMARK_ALWAYS_INLINE State::StateIterator State::end() { + StartKeepRunning(); + return StateIterator(); +} + +namespace internal { + +typedef void(Function)(State&); + +// ------------------------------------------------------ +// Benchmark registration object. The BENCHMARK() macro expands +// into an internal::Benchmark* object. Various methods can +// be called on this object to change the properties of the benchmark. +// Each method returns "this" so that multiple method calls can +// chained into one expression. +class Benchmark { + public: + virtual ~Benchmark(); + + // Note: the following methods all return "this" so that multiple + // method calls can be chained together in one expression. + + // 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. + Benchmark* Arg(int64_t x); + + // Run this benchmark with the given time unit for the generated output report + Benchmark* Unit(TimeUnit unit); + + // Run this benchmark once for a number of values picked from the + // range [start..limit]. (start and limit are always picked.) + // REQUIRES: The function passed to the constructor must accept an arg1. + Benchmark* Range(int64_t start, int64_t limit); + + // Run this benchmark once for all values in the range [start..limit] with + // specific step + // REQUIRES: The function passed to the constructor must accept an arg1. + Benchmark* DenseRange(int64_t start, int64_t limit, int step = 1); + + // Run this benchmark once with "args" as the extra arguments passed + // to the function. + // REQUIRES: The function passed to the constructor must accept arg1, arg2 ... + Benchmark* Args(const std::vector<int64_t>& args); + + // Equivalent to Args({x, y}) + // NOTE: This is a legacy C++03 interface provided for compatibility only. + // New code should use 'Args'. + Benchmark* ArgPair(int64_t x, int64_t y) { + std::vector<int64_t> args; + args.push_back(x); + args.push_back(y); + return Args(args); + } + + // Run this benchmark once for a number of values picked from the + // ranges [start..limit]. (starts and limits are always picked.) + // REQUIRES: The function passed to the constructor must accept arg1, arg2 ... + Benchmark* Ranges(const std::vector<std::pair<int64_t, int64_t> >& ranges); + + // Equivalent to ArgNames({name}) + Benchmark* ArgName(const std::string& name); + + // Set the argument names to display in the benchmark name. If not called, + // only argument values will be shown. + Benchmark* ArgNames(const std::vector<std::string>& names); + + // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}). + // NOTE: This is a legacy C++03 interface provided for compatibility only. + // New code should use 'Ranges'. + Benchmark* RangePair(int64_t lo1, int64_t hi1, int64_t lo2, int64_t hi2) { + std::vector<std::pair<int64_t, int64_t> > ranges; + ranges.push_back(std::make_pair(lo1, hi1)); + ranges.push_back(std::make_pair(lo2, hi2)); + return Ranges(ranges); + } + + // Pass this benchmark object to *func, which can customize + // the benchmark by calling various methods like Arg, Args, + // Threads, etc. + Benchmark* Apply(void (*func)(Benchmark* benchmark)); + + // Set the range multiplier for non-dense range. If not called, the range + // multiplier kRangeMultiplier will be used. + Benchmark* RangeMultiplier(int multiplier); + + // Set the minimum amount of time to use when running this benchmark. This + // option overrides the `benchmark_min_time` flag. + // REQUIRES: `t > 0` and `Iterations` has not been called on this benchmark. + Benchmark* MinTime(double t); + + // Specify the amount of iterations that should be run by this benchmark. + // REQUIRES: 'n > 0' and `MinTime` has not been called on this benchmark. + // + // 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); + + // Specify the amount of times to repeat this benchmark. This option overrides + // the `benchmark_repetitions` flag. + // REQUIRES: `n > 0` + Benchmark* Repetitions(int n); + + // Specify if each repetition of the benchmark should be reported separately + // or if only the final statistics should be reported. If the benchmark + // is not repeated then the single result is always reported. + Benchmark* ReportAggregatesOnly(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. + Benchmark* UseRealTime(); + + // If a benchmark must measure time manually (e.g. if GPU execution time is + // being + // measured), call this method. If called, each benchmark iteration should + // call + // SetIterationTime(seconds) to report the measured time, which will be used + // to control how many iterations are run, and in the printing of items/second + // or MB/second values. + Benchmark* UseManualTime(); + + // Set the asymptotic computational complexity for the benchmark. If called + // the asymptotic computational complexity will be shown on the output. + Benchmark* Complexity(BigO complexity = benchmark::oAuto); + + // Set the asymptotic computational complexity for the benchmark. If called + // the asymptotic computational complexity will be shown on the output. + Benchmark* Complexity(BigOFunc* complexity); + + // Add this statistics to be computed over all the values of benchmark run + Benchmark* ComputeStatistics(std::string name, StatisticsFunc* statistics); + + // Support for running multiple copies of the same benchmark concurrently + // in multiple threads. This may be useful when measuring the scaling + // of some piece of code. + + // Run one instance of this benchmark concurrently in t threads. + Benchmark* Threads(int t); + + // Pick a set of values T from [min_threads,max_threads]. + // min_threads and max_threads are always included in T. Run this + // benchmark once for each value in T. The benchmark run for a + // particular value t consists of t threads running the benchmark + // function concurrently. For example, consider: + // BENCHMARK(Foo)->ThreadRange(1,16); + // This will run the following benchmarks: + // Foo in 1 thread + // Foo in 2 threads + // Foo in 4 threads + // Foo in 8 threads + // Foo in 16 threads + Benchmark* ThreadRange(int min_threads, int max_threads); + + // For each value n in the range, run this benchmark once using n threads. + // min_threads and max_threads are always included in the range. + // stride specifies the increment. E.g. DenseThreadRange(1, 8, 3) starts + // a benchmark with 1, 4, 7 and 8 threads. + Benchmark* DenseThreadRange(int min_threads, int max_threads, int stride = 1); + + // Equivalent to ThreadRange(NumCPUs(), NumCPUs()) + Benchmark* ThreadPerCpu(); + + virtual void Run(State& state) = 0; + + // Used inside the benchmark implementation + struct Instance; + + protected: + explicit Benchmark(const char* name); + Benchmark(Benchmark const&); + void SetName(const char* name); + + int ArgsCnt() const; + + private: + friend class BenchmarkFamilies; + + std::string name_; + ReportMode report_mode_; + std::vector<std::string> arg_names_; // Args for all benchmark runs + std::vector<std::vector<int64_t> > args_; // Args for all benchmark runs + TimeUnit time_unit_; + int range_multiplier_; + double min_time_; + size_t iterations_; + int repetitions_; + bool use_real_time_; + bool use_manual_time_; + BigO complexity_; + BigOFunc* complexity_lambda_; + std::vector<Statistics> statistics_; + std::vector<int> thread_counts_; + + Benchmark& operator=(Benchmark const&); +}; + +} // namespace internal + +// Create and register a benchmark with the specified 'name' that invokes +// the specified functor 'fn'. +// +// RETURNS: A pointer to the registered benchmark. +internal::Benchmark* RegisterBenchmark(const char* name, + internal::Function* fn); + +#if defined(BENCHMARK_HAS_CXX11) +template <class Lambda> +internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn); +#endif + +// Remove all registered benchmarks. All pointers to previously registered +// benchmarks are invalidated. +void ClearRegisteredBenchmarks(); + +namespace internal { +// The class used to hold all Benchmarks created from static function. +// (ie those created using the BENCHMARK(...) macros. +class FunctionBenchmark : public Benchmark { + public: + FunctionBenchmark(const char* name, Function* func) + : Benchmark(name), func_(func) {} + + virtual void Run(State& st); + + private: + Function* func_; +}; + +#ifdef BENCHMARK_HAS_CXX11 +template <class Lambda> +class LambdaBenchmark : public Benchmark { + public: + virtual void Run(State& st) { lambda_(st); } + + private: + template <class OLambda> + LambdaBenchmark(const char* name, OLambda&& lam) + : Benchmark(name), lambda_(std::forward<OLambda>(lam)) {} + + LambdaBenchmark(LambdaBenchmark const&) = delete; + + private: + template <class Lam> + friend Benchmark* ::benchmark::RegisterBenchmark(const char*, Lam&&); + + Lambda lambda_; +}; +#endif + +} // namespace internal + +inline internal::Benchmark* RegisterBenchmark(const char* name, + internal::Function* fn) { + return internal::RegisterBenchmarkInternal( + ::new internal::FunctionBenchmark(name, fn)); +} + +#ifdef BENCHMARK_HAS_CXX11 +template <class Lambda> +internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) { + using BenchType = + internal::LambdaBenchmark<typename std::decay<Lambda>::type>; + return internal::RegisterBenchmarkInternal( + ::new BenchType(name, std::forward<Lambda>(fn))); +} +#endif + +#if defined(BENCHMARK_HAS_CXX11) && \ + (!defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409) +template <class Lambda, class... Args> +internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn, + Args&&... args) { + return benchmark::RegisterBenchmark( + name, [=](benchmark::State& st) { fn(st, args...); }); +} +#else +#define BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK +#endif + +// The base class for all fixture tests. +class Fixture : public internal::Benchmark { + public: + Fixture() : internal::Benchmark("") {} + + virtual void Run(State& st) { + this->SetUp(st); + this->BenchmarkCase(st); + this->TearDown(st); + } + + // These will be deprecated ... + virtual void SetUp(const State&) {} + virtual void TearDown(const State&) {} + // ... In favor of these. + virtual void SetUp(State& st) { SetUp(const_cast<const State&>(st)); } + virtual void TearDown(State& st) { TearDown(const_cast<const State&>(st)); } + + protected: + virtual void BenchmarkCase(State&) = 0; +}; + +} // namespace benchmark + +// ------------------------------------------------------ +// Macro to register benchmarks + +// Check that __COUNTER__ is defined and that __COUNTER__ increases by 1 +// every time it is expanded. X + 1 == X + 0 is used in case X is defined to be +// empty. If X is empty the expression becomes (+1 == +0). +#if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0) +#define BENCHMARK_PRIVATE_UNIQUE_ID __COUNTER__ +#else +#define BENCHMARK_PRIVATE_UNIQUE_ID __LINE__ +#endif + +// Helpers for generating unique variable names +#define BENCHMARK_PRIVATE_NAME(n) \ + BENCHMARK_PRIVATE_CONCAT(_benchmark_, 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 + +#define BENCHMARK_PRIVATE_DECLARE(n) \ + static ::benchmark::internal::Benchmark* BENCHMARK_PRIVATE_NAME(n) \ + BENCHMARK_UNUSED + +#define BENCHMARK(n) \ + BENCHMARK_PRIVATE_DECLARE(n) = \ + (::benchmark::internal::RegisterBenchmarkInternal( \ + new ::benchmark::internal::FunctionBenchmark(#n, n))) + +// Old-style macros +#define BENCHMARK_WITH_ARG(n, a) BENCHMARK(n)->Arg((a)) +#define BENCHMARK_WITH_ARG2(n, a1, a2) BENCHMARK(n)->Args({(a1), (a2)}) +#define BENCHMARK_WITH_UNIT(n, t) BENCHMARK(n)->Unit((t)) +#define BENCHMARK_RANGE(n, lo, hi) BENCHMARK(n)->Range((lo), (hi)) +#define BENCHMARK_RANGE2(n, l1, h1, l2, h2) \ + BENCHMARK(n)->RangePair({{(l1), (h1)}, {(l2), (h2)}}) + +#ifdef BENCHMARK_HAS_CXX11 + +// Register a benchmark which invokes the function specified by `func` +// with the additional arguments specified by `...`. +// +// For example: +// +// template <class ...ExtraArgs>` +// void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) { +// [...] +//} +// /* Registers a benchmark named "BM_takes_args/int_string_test` */ +// BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc")); +#define BENCHMARK_CAPTURE(func, test_case_name, ...) \ + BENCHMARK_PRIVATE_DECLARE(func) = \ + (::benchmark::internal::RegisterBenchmarkInternal( \ + new ::benchmark::internal::FunctionBenchmark( \ + #func "/" #test_case_name, \ + [](::benchmark::State& st) { func(st, __VA_ARGS__); }))) + +#endif // BENCHMARK_HAS_CXX11 + +// This will register a benchmark for a templatized function. For example: +// +// template<int arg> +// void BM_Foo(int iters); +// +// BENCHMARK_TEMPLATE(BM_Foo, 1); +// +// will register BM_Foo<1> as a benchmark. +#define BENCHMARK_TEMPLATE1(n, a) \ + BENCHMARK_PRIVATE_DECLARE(n) = \ + (::benchmark::internal::RegisterBenchmarkInternal( \ + new ::benchmark::internal::FunctionBenchmark(#n "<" #a ">", n<a>))) + +#define BENCHMARK_TEMPLATE2(n, a, b) \ + BENCHMARK_PRIVATE_DECLARE(n) = \ + (::benchmark::internal::RegisterBenchmarkInternal( \ + new ::benchmark::internal::FunctionBenchmark(#n "<" #a "," #b ">", \ + n<a, b>))) + +#ifdef BENCHMARK_HAS_CXX11 +#define BENCHMARK_TEMPLATE(n, ...) \ + BENCHMARK_PRIVATE_DECLARE(n) = \ + (::benchmark::internal::RegisterBenchmarkInternal( \ + new ::benchmark::internal::FunctionBenchmark( \ + #n "<" #__VA_ARGS__ ">", n<__VA_ARGS__>))) +#else +#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_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_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&); \ + }; + +#ifdef BENCHMARK_HAS_CXX11 +#define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, ...) \ + class BaseClass##_##Method##_Benchmark : public BaseClass<__VA_ARGS__> { \ + public: \ + BaseClass##_##Method##_Benchmark() : BaseClass<__VA_ARGS__>() { \ + this->SetName(#BaseClass "<" #__VA_ARGS__ ">/" #Method); \ + } \ + \ + protected: \ + virtual void BenchmarkCase(::benchmark::State&); \ + }; +#else +#define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(n, a) \ + BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(n, a) +#endif + +#define BENCHMARK_DEFINE_F(BaseClass, Method) \ + BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \ + void BaseClass##_##Method##_Benchmark::BenchmarkCase + +#define BENCHMARK_TEMPLATE1_DEFINE_F(BaseClass, Method, a) \ + BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \ + void BaseClass##_##Method##_Benchmark::BenchmarkCase + +#define BENCHMARK_TEMPLATE2_DEFINE_F(BaseClass, Method, a, b) \ + BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \ + void BaseClass##_##Method##_Benchmark::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 +#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) + +#define BENCHMARK_PRIVATE_REGISTER_F(TestName) \ + BENCHMARK_PRIVATE_DECLARE(TestName) = \ + (::benchmark::internal::RegisterBenchmarkInternal(new TestName())) + +// This macro will define and register a benchmark within a fixture class. +#define BENCHMARK_F(BaseClass, Method) \ + BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \ + BENCHMARK_REGISTER_F(BaseClass, Method); \ + void BaseClass##_##Method##_Benchmark::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 + +#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 + +#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 +#else +#define BENCHMARK_TEMPLATE_F(BaseClass, Method, a) \ + BENCHMARK_TEMPLATE1_F(BaseClass, Method, a) +#endif + +// Helper macro to create a main routine in a test that runs the benchmarks +#define BENCHMARK_MAIN() \ + int main(int argc, char** argv) { \ + ::benchmark::Initialize(&argc, argv); \ + if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \ + ::benchmark::RunSpecifiedBenchmarks(); \ + } \ + int main(int, char**) + +// ------------------------------------------------------ +// Benchmark Reporters + +namespace benchmark { + +struct CPUInfo { + struct CacheInfo { + std::string type; + int level; + int size; + int num_sharing; + }; + + int num_cpus; + double cycles_per_second; + std::vector<CacheInfo> caches; + bool scaling_enabled; + + static const CPUInfo& Get(); + + private: + CPUInfo(); + BENCHMARK_DISALLOW_COPY_AND_ASSIGN(CPUInfo); +}; + +// 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 +// RunSpecifiedBenchmarks and passing it a custom reporter object. +// The reporter object must implement the following interface. +class BenchmarkReporter { + public: + struct Context { + CPUInfo const& cpu_info; + // The number of chars in the longest benchmark name. + size_t name_field_width; + static const char* executable_name; + Context(); + }; + + struct Run { + Run() + : error_occurred(false), + iterations(1), + time_unit(kNanosecond), + real_accumulated_time(0), + cpu_accumulated_time(0), + bytes_per_second(0), + items_per_second(0), + max_heapbytes_used(0), + complexity(oNone), + complexity_lambda(), + complexity_n(0), + report_big_o(false), + report_rms(false), + counters() {} + + std::string benchmark_name; + std::string report_label; // Empty if not set by benchmark. + bool error_occurred; + std::string error_message; + + int64_t iterations; + TimeUnit time_unit; + double real_accumulated_time; + double cpu_accumulated_time; + + // Return a value representing the real time per iteration in the unit + // specified by 'time_unit'. + // NOTE: If 'iterations' is zero the returned value represents the + // accumulated time. + double GetAdjustedRealTime() const; + + // Return a value representing the cpu time per iteration in the unit + // specified by 'time_unit'. + // NOTE: If 'iterations' is zero the returned value represents the + // accumulated time. + double GetAdjustedCPUTime() const; + + // Zero if not set by benchmark. + double bytes_per_second; + double items_per_second; + + // This is set to 0.0 if memory tracing is not enabled. + double max_heapbytes_used; + + // Keep track of arguments to compute asymptotic complexity + BigO complexity; + BigOFunc* complexity_lambda; + int64_t complexity_n; + + // what statistics to compute from the measurements + const std::vector<Statistics>* statistics; + + // Inform print function whether the current run is a complexity report + bool report_big_o; + bool report_rms; + + UserCounters counters; + }; + + // Construct a BenchmarkReporter with the output stream set to 'std::cout' + // and the error stream set to 'std::cerr' + BenchmarkReporter(); + + // Called once for every suite of benchmarks run. + // The parameter "context" contains information that the + // reporter may wish to use when generating its report, for example the + // platform under which the benchmarks are running. The benchmark run is + // never started if this function returns false, allowing the reporter + // to skip runs based on the context information. + virtual bool ReportContext(const Context& context) = 0; + + // Called once for each group of benchmark runs, gives information about + // cpu-time and heap memory usage during the benchmark run. If the group + // of runs contained more than two entries then 'report' contains additional + // elements representing the mean and standard deviation of those runs. + // Additionally if this group of runs was the last in a family of benchmarks + // 'reports' contains additional entries representing the asymptotic + // complexity and RMS of that benchmark family. + virtual void ReportRuns(const std::vector<Run>& report) = 0; + + // Called once and only once after ever group of benchmarks is run and + // reported. + virtual void Finalize() {} + + // REQUIRES: The object referenced by 'out' is valid for the lifetime + // of the reporter. + void SetOutputStream(std::ostream* out) { + assert(out); + output_stream_ = out; + } + + // REQUIRES: The object referenced by 'err' is valid for the lifetime + // of the reporter. + void SetErrorStream(std::ostream* err) { + assert(err); + error_stream_ = err; + } + + std::ostream& GetOutputStream() const { return *output_stream_; } + + std::ostream& GetErrorStream() const { return *error_stream_; } + + virtual ~BenchmarkReporter(); + + // Write a human readable string to 'out' representing the specified + // 'context'. + // REQUIRES: 'out' is non-null. + static void PrintBasicContext(std::ostream* out, Context const& context); + + private: + std::ostream* output_stream_; + std::ostream* error_stream_; +}; + +// Simple reporter that outputs benchmark data to the console. This is the +// default reporter used by RunSpecifiedBenchmarks(). +class ConsoleReporter : public BenchmarkReporter { + public: + enum OutputOptions { + OO_None = 0, + OO_Color = 1, + OO_Tabular = 2, + OO_ColorTabular = OO_Color | OO_Tabular, + OO_Defaults = OO_ColorTabular + }; + explicit ConsoleReporter(OutputOptions opts_ = OO_Defaults) + : output_options_(opts_), + name_field_width_(0), + prev_counters_(), + printed_header_(false) {} + + virtual bool ReportContext(const Context& context); + virtual void ReportRuns(const std::vector<Run>& reports); + + protected: + virtual void PrintRunData(const Run& report); + virtual void PrintHeader(const Run& report); + + OutputOptions output_options_; + size_t name_field_width_; + UserCounters prev_counters_; + bool printed_header_; +}; + +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(); + + 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 { + public: + CSVReporter() : printed_header_(false) {} + virtual bool ReportContext(const Context& context); + virtual void ReportRuns(const std::vector<Run>& reports); + + private: + void PrintRunData(const Run& report); + + bool printed_header_; + std::set<std::string> user_counter_names_; +}; + +inline const char* GetTimeUnitString(TimeUnit unit) { + switch (unit) { + case kMillisecond: + return "ms"; + case kMicrosecond: + return "us"; + case kNanosecond: + default: + return "ns"; + } +} + +inline double GetTimeUnitMultiplier(TimeUnit unit) { + switch (unit) { + case kMillisecond: + return 1e3; + case kMicrosecond: + return 1e6; + case kNanosecond: + default: + return 1e9; + } +} + +} // namespace benchmark #endif // BENCHMARK_BENCHMARK_H_ diff --git a/utils/google-benchmark/include/benchmark/benchmark_api.h b/utils/google-benchmark/include/benchmark/benchmark_api.h deleted file mode 100644 index 1e853e2cd4e0a..0000000000000 --- a/utils/google-benchmark/include/benchmark/benchmark_api.h +++ /dev/null @@ -1,915 +0,0 @@ -// Support for registering benchmarks for functions. - -/* Example usage: -// Define a function that executes the code to be measured a -// specified number of times: -static void BM_StringCreation(benchmark::State& state) { - while (state.KeepRunning()) - std::string empty_string; -} - -// Register the function as a benchmark -BENCHMARK(BM_StringCreation); - -// Define another benchmark -static void BM_StringCopy(benchmark::State& state) { - std::string x = "hello"; - while (state.KeepRunning()) - std::string copy(x); -} -BENCHMARK(BM_StringCopy); - -// Augment the main() program to invoke benchmarks if specified -// via the --benchmarks command line flag. E.g., -// my_unittest --benchmark_filter=all -// my_unittest --benchmark_filter=BM_StringCreation -// my_unittest --benchmark_filter=String -// my_unittest --benchmark_filter='Copy|Creation' -int main(int argc, char** argv) { - benchmark::Initialize(&argc, argv); - benchmark::RunSpecifiedBenchmarks(); - return 0; -} - -// Sometimes a family of microbenchmarks 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 microbenchmarks for measuring the speed -// of memcpy() calls of different lengths: - -static void BM_memcpy(benchmark::State& state) { - char* src = new char[state.range(0)]; char* dst = new char[state.range(0)]; - memset(src, 'x', state.range(0)); - while (state.KeepRunning()) - memcpy(dst, src, state.range(0)); - state.SetBytesProcessed(int64_t(state.iterations()) * - int64_t(state.range(0))); - delete[] src; delete[] dst; -} -BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10); - -// The preceding code is quite repetitive, and can be replaced with the -// following short-hand. The following invocation will pick a few -// appropriate arguments in the specified range and will generate a -// microbenchmark for each such argument. -BENCHMARK(BM_memcpy)->Range(8, 8<<10); - -// You might have a microbenchmark that depends on two inputs. For -// example, the following code defines a family of microbenchmarks for -// measuring the speed of set insertion. -static void BM_SetInsert(benchmark::State& state) { - while (state.KeepRunning()) { - state.PauseTiming(); - set<int> data = ConstructRandomSet(state.range(0)); - state.ResumeTiming(); - for (int j = 0; j < state.range(1); ++j) - data.insert(RandomNumber()); - } -} -BENCHMARK(BM_SetInsert) - ->Args({1<<10, 1}) - ->Args({1<<10, 8}) - ->Args({1<<10, 64}) - ->Args({1<<10, 512}) - ->Args({8<<10, 1}) - ->Args({8<<10, 8}) - ->Args({8<<10, 64}) - ->Args({8<<10, 512}); - -// The preceding code is quite repetitive, and can be replaced with -// the following short-hand. The following macro will pick a few -// appropriate arguments in the product of the two specified ranges -// and will generate a microbenchmark for each such pair. -BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}}); - -// For more complex patterns of inputs, passing a custom function -// to Apply allows programmatic specification of an -// arbitrary set of arguments to run the microbenchmark on. -// The following example enumerates a dense range on -// one parameter, and a sparse range on the second. -static void CustomArguments(benchmark::internal::Benchmark* b) { - for (int i = 0; i <= 10; ++i) - for (int j = 32; j <= 1024*1024; j *= 8) - b->Args({i, j}); -} -BENCHMARK(BM_SetInsert)->Apply(CustomArguments); - -// Templated microbenchmarks work the same way: -// Produce then consume 'size' messages 'iters' times -// Measures throughput in the absence of multiprogramming. -template <class Q> int BM_Sequential(benchmark::State& state) { - Q q; - typename Q::value_type v; - while (state.KeepRunning()) { - for (int i = state.range(0); i--; ) - q.push(v); - for (int e = state.range(0); e--; ) - q.Wait(&v); - } - // actually messages, not bytes: - state.SetBytesProcessed( - static_cast<int64_t>(state.iterations())*state.range(0)); -} -BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10); - -Use `Benchmark::MinTime(double t)` to set the minimum time used to run the -benchmark. This option overrides the `benchmark_min_time` flag. - -void BM_test(benchmark::State& state) { - ... body ... -} -BENCHMARK(BM_test)->MinTime(2.0); // Run for at least 2 seconds. - -In a multithreaded test, it is guaranteed that none of the threads will start -until all have called KeepRunning, and all will have finished before KeepRunning -returns false. As such, any global setup or teardown you want to do can be -wrapped in a check against the thread index: - -static void BM_MultiThreaded(benchmark::State& state) { - if (state.thread_index == 0) { - // Setup code here. - } - while (state.KeepRunning()) { - // Run the test as normal. - } - if (state.thread_index == 0) { - // Teardown code here. - } -} -BENCHMARK(BM_MultiThreaded)->Threads(4); - - -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: - -BENCHMARK(BM_test)->Unit(benchmark::kMillisecond); -*/ - -#ifndef BENCHMARK_BENCHMARK_API_H_ -#define BENCHMARK_BENCHMARK_API_H_ - -#include <assert.h> -#include <stddef.h> -#include <stdint.h> - -#include <string> -#include <vector> -#include <map> - -#include "macros.h" - -#if defined(BENCHMARK_HAS_CXX11) -#include <type_traits> -#include <initializer_list> -#include <utility> -#endif - -#if defined(_MSC_VER) -#include <intrin.h> // for _ReadWriteBarrier -#endif - -namespace benchmark { -class BenchmarkReporter; - -void Initialize(int* argc, char** argv); - -// 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). -bool ReportUnrecognizedArguments(int argc, char** argv); - -// Generate a list of benchmarks matching the specified --benchmark_filter flag -// and if --benchmark_list_tests is specified return after printing the name -// of each matching benchmark. Otherwise run each matching benchmark and -// report the results. -// -// The second and third overload use the specified 'console_reporter' and -// 'file_reporter' respectively. 'file_reporter' will write to the file -// specified -// by '--benchmark_output'. If '--benchmark_output' is not given the -// 'file_reporter' is ignored. -// -// RETURNS: The number of matching benchmarks. -size_t RunSpecifiedBenchmarks(); -size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter); -size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter, - BenchmarkReporter* file_reporter); - -// If this routine is called, peak memory allocation past this point in the -// benchmark is reported at the end of the benchmark report line. (It is -// computed by running the benchmark once with a single iteration and a memory -// tracer.) -// TODO(dominic) -// void MemoryUsage(); - -namespace internal { -class Benchmark; -class BenchmarkImp; -class BenchmarkFamilies; - -void UseCharPointer(char const volatile*); - -// Take ownership of the pointer and register the benchmark. Return the -// registered benchmark. -Benchmark* RegisterBenchmarkInternal(Benchmark*); - -// Ensure that the standard streams are properly initialized in every TU. -int InitializeStreams(); -BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams(); - -} // end namespace internal - - -#if !defined(__GNUC__) || defined(__pnacl__) || defined(EMSCRIPTN) -# define BENCHMARK_HAS_NO_INLINE_ASSEMBLY -#endif - -// The DoNotOptimize(...) function can be used to prevent a value or -// expression from being optimized away by the compiler. This function is -// intended to add little to no overhead. -// See: https://youtu.be/nXaxk27zwlk?t=2441 -#ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY -template <class Tp> -inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { - asm volatile("" : : "g"(value) : "memory"); -} -// Force the compiler to flush pending writes to global memory. Acts as an -// effective read/write barrier -inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() { - asm volatile("" : : : "memory"); -} -#elif defined(_MSC_VER) -template <class Tp> -inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { - internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); - _ReadWriteBarrier(); -} - -inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() { - _ReadWriteBarrier(); -} -#else -template <class Tp> -inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { - internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value)); -} -// FIXME Add ClobberMemory() for non-gnu and non-msvc compilers -#endif - - - -// This class is used for user-defined counters. -class Counter { -public: - - enum Flags { - kDefaults = 0, - // Mark the counter as a rate. It will be presented divided - // by the duration of the benchmark. - kIsRate = 1, - // Mark the counter as a thread-average quantity. It will be - // presented divided by the number of threads. - kAvgThreads = 2, - // Mark the counter as a thread-average rate. See above. - kAvgThreadsRate = kIsRate|kAvgThreads - }; - - double value; - Flags flags; - - BENCHMARK_ALWAYS_INLINE - Counter(double v = 0., Flags f = kDefaults) : value(v), flags(f) {} - - BENCHMARK_ALWAYS_INLINE operator double const& () const { return value; } - BENCHMARK_ALWAYS_INLINE operator double & () { return value; } - -}; - -// This is the container for the user-defined counters. -typedef std::map<std::string, Counter> UserCounters; - - -// TimeUnit is passed to a benchmark in order to specify the order of magnitude -// for the measured time. -enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond }; - -// BigO is passed to a benchmark in order to specify the asymptotic -// computational -// complexity for the benchmark. In case oAuto is selected, complexity will be -// calculated automatically to the best fit. -enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda }; - -// BigOFunc is passed to a benchmark in order to specify the asymptotic -// computational complexity for the benchmark. -typedef double(BigOFunc)(int); - -namespace internal { -class ThreadTimer; -class ThreadManager; - -#if defined(BENCHMARK_HAS_CXX11) -enum ReportMode : unsigned { -#else -enum ReportMode { -#endif - RM_Unspecified, // The mode has not been manually specified - RM_Default, // The mode is user-specified as default. - RM_ReportAggregatesOnly -}; -} - -// State is passed to a running Benchmark and contains state for the -// benchmark to use. -class State { - public: - // Returns true if the benchmark should continue through another iteration. - // NOTE: A benchmark may not return from the test until KeepRunning() has - // returned false. - bool KeepRunning() { - if (BENCHMARK_BUILTIN_EXPECT(!started_, false)) { - StartKeepRunning(); - } - bool const res = total_iterations_++ < max_iterations; - if (BENCHMARK_BUILTIN_EXPECT(!res, false)) { - FinishKeepRunning(); - } - return res; - } - - // REQUIRES: timer is running and 'SkipWithError(...)' has not been called - // by the current thread. - // Stop the benchmark timer. If not called, the timer will be - // automatically stopped after KeepRunning() returns false for the first time. - // - // For threaded benchmarks the PauseTiming() function only pauses the timing - // for the current thread. - // - // NOTE: The "real time" measurement is per-thread. If different threads - // report different measurements the largest one is reported. - // - // NOTE: PauseTiming()/ResumeTiming() are relatively - // heavyweight, and so their use should generally be avoided - // within each benchmark iteration, if possible. - void PauseTiming(); - - // REQUIRES: timer is not running and 'SkipWithError(...)' has not been called - // by the current thread. - // Start the benchmark timer. The timer is NOT running on entrance to the - // benchmark function. It begins running after the first call to KeepRunning() - // - // NOTE: PauseTiming()/ResumeTiming() are relatively - // heavyweight, and so their use should generally be avoided - // within each benchmark iteration, if possible. - void ResumeTiming(); - - // REQUIRES: 'SkipWithError(...)' has not been called previously by the - // current thread. - // Skip any future iterations of the 'KeepRunning()' loop in the current - // thread and report an error with the specified 'msg'. After this call - // the user may explicitly 'return' from the benchmark. - // - // For threaded benchmarks only the current thread stops executing and future - // calls to `KeepRunning()` will block until all threads have completed - // the `KeepRunning()` loop. If multiple threads report an error only the - // first error message is used. - // - // NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit - // the current scope immediately. If the function is called from within - // the 'KeepRunning()' loop the current iteration will finish. It is the users - // responsibility to exit the scope as needed. - void SkipWithError(const char* msg); - - // REQUIRES: called exactly once per iteration of the KeepRunning loop. - // Set the manually measured time for this benchmark iteration, which - // is used instead of automatically measured time if UseManualTime() was - // specified. - // - // For threaded benchmarks the final value will be set to the largest - // reported values. - void SetIterationTime(double seconds); - - // Set the number of bytes processed by the current benchmark - // execution. This routine is typically called once at the end of a - // throughput oriented benchmark. If this routine is called with a - // value > 0, the report is printed in MB/sec instead of nanoseconds - // per iteration. - // - // REQUIRES: a benchmark has exited its KeepRunning loop. - BENCHMARK_ALWAYS_INLINE - void SetBytesProcessed(size_t bytes) { bytes_processed_ = bytes; } - - BENCHMARK_ALWAYS_INLINE - size_t bytes_processed() const { return bytes_processed_; } - - // If this routine is called with complexity_n > 0 and complexity report is - // requested for the - // family benchmark, then current benchmark will be part of the computation - // and complexity_n will - // represent the length of N. - BENCHMARK_ALWAYS_INLINE - void SetComplexityN(int complexity_n) { complexity_n_ = complexity_n; } - - BENCHMARK_ALWAYS_INLINE - int complexity_length_n() { 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 - // executing benchmark. It is typically called at the end of a processing - // benchmark where a processing items/second output is desired. - // - // REQUIRES: a benchmark has exited its KeepRunning loop. - BENCHMARK_ALWAYS_INLINE - void SetItemsProcessed(size_t items) { items_processed_ = items; } - - BENCHMARK_ALWAYS_INLINE - size_t items_processed() const { return items_processed_; } - - // If this routine is called, the specified label is printed at the - // end of the benchmark report line for the currently executing - // benchmark. Example: - // static void BM_Compress(benchmark::State& state) { - // ... - // double compress = input_size / output_size; - // state.SetLabel(StringPrintf("compress:%.1f%%", 100.0*compression)); - // } - // Produces output that looks like: - // BM_Compress 50 50 14115038 compress:27.3% - // - // REQUIRES: a benchmark has exited its KeepRunning loop. - void SetLabel(const char* label); - - void BENCHMARK_ALWAYS_INLINE SetLabel(const std::string& str) { - this->SetLabel(str.c_str()); - } - - // Range arguments for this run. CHECKs if the argument has been set. - BENCHMARK_ALWAYS_INLINE - int range(std::size_t pos = 0) const { - assert(range_.size() > pos); - return range_[pos]; - } - - BENCHMARK_DEPRECATED_MSG("use 'range(0)' instead") - int range_x() const { return range(0); } - - BENCHMARK_DEPRECATED_MSG("use 'range(1)' instead") - int range_y() const { return range(1); } - - BENCHMARK_ALWAYS_INLINE - size_t iterations() const { return total_iterations_; } - - private: - bool started_; - bool finished_; - size_t total_iterations_; - - std::vector<int> range_; - - size_t bytes_processed_; - size_t items_processed_; - - int complexity_n_; - - bool error_occurred_; - - public: - // Container for user-defined counters. - UserCounters counters; - // Index of the executing thread. Values from [0, threads). - const int thread_index; - // Number of threads concurrently executing the benchmark. - const int threads; - const size_t max_iterations; - - // TODO make me private - State(size_t max_iters, const std::vector<int>& ranges, int thread_i, - int n_threads, internal::ThreadTimer* timer, - internal::ThreadManager* manager); - - private: - void StartKeepRunning(); - void FinishKeepRunning(); - internal::ThreadTimer* timer_; - internal::ThreadManager* manager_; - BENCHMARK_DISALLOW_COPY_AND_ASSIGN(State); -}; - -namespace internal { - -typedef void(Function)(State&); - -// ------------------------------------------------------ -// Benchmark registration object. The BENCHMARK() macro expands -// into an internal::Benchmark* object. Various methods can -// be called on this object to change the properties of the benchmark. -// Each method returns "this" so that multiple method calls can -// chained into one expression. -class Benchmark { - public: - virtual ~Benchmark(); - - // Note: the following methods all return "this" so that multiple - // method calls can be chained together in one expression. - - // 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. - Benchmark* Arg(int x); - - // Run this benchmark with the given time unit for the generated output report - Benchmark* Unit(TimeUnit unit); - - // Run this benchmark once for a number of values picked from the - // range [start..limit]. (start and limit are always picked.) - // REQUIRES: The function passed to the constructor must accept an arg1. - Benchmark* Range(int start, int limit); - - // Run this benchmark once for all values in the range [start..limit] with - // specific step - // REQUIRES: The function passed to the constructor must accept an arg1. - Benchmark* DenseRange(int start, int limit, int step = 1); - - // Run this benchmark once with "args" as the extra arguments passed - // to the function. - // REQUIRES: The function passed to the constructor must accept arg1, arg2 ... - Benchmark* Args(const std::vector<int>& args); - - // Equivalent to Args({x, y}) - // NOTE: This is a legacy C++03 interface provided for compatibility only. - // New code should use 'Args'. - Benchmark* ArgPair(int x, int y) { - std::vector<int> args; - args.push_back(x); - args.push_back(y); - return Args(args); - } - - // Run this benchmark once for a number of values picked from the - // ranges [start..limit]. (starts and limits are always picked.) - // REQUIRES: The function passed to the constructor must accept arg1, arg2 ... - Benchmark* Ranges(const std::vector<std::pair<int, int> >& ranges); - - // Equivalent to ArgNames({name}) - Benchmark* ArgName(const std::string& name); - - // Set the argument names to display in the benchmark name. If not called, - // only argument values will be shown. - Benchmark* ArgNames(const std::vector<std::string>& names); - - // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}). - // NOTE: This is a legacy C++03 interface provided for compatibility only. - // New code should use 'Ranges'. - Benchmark* RangePair(int lo1, int hi1, int lo2, int hi2) { - std::vector<std::pair<int, int> > ranges; - ranges.push_back(std::make_pair(lo1, hi1)); - ranges.push_back(std::make_pair(lo2, hi2)); - return Ranges(ranges); - } - - // Pass this benchmark object to *func, which can customize - // the benchmark by calling various methods like Arg, Args, - // Threads, etc. - Benchmark* Apply(void (*func)(Benchmark* benchmark)); - - // Set the range multiplier for non-dense range. If not called, the range - // multiplier kRangeMultiplier will be used. - Benchmark* RangeMultiplier(int multiplier); - - // Set the minimum amount of time to use when running this benchmark. This - // option overrides the `benchmark_min_time` flag. - // REQUIRES: `t > 0` and `Iterations` has not been called on this benchmark. - Benchmark* MinTime(double t); - - // Specify the amount of iterations that should be run by this benchmark. - // REQUIRES: 'n > 0' and `MinTime` has not been called on this benchmark. - // - // 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); - - // Specify the amount of times to repeat this benchmark. This option overrides - // the `benchmark_repetitions` flag. - // REQUIRES: `n > 0` - Benchmark* Repetitions(int n); - - // Specify if each repetition of the benchmark should be reported separately - // or if only the final statistics should be reported. If the benchmark - // is not repeated then the single result is always reported. - Benchmark* ReportAggregatesOnly(bool v = 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. - Benchmark* UseRealTime(); - - // If a benchmark must measure time manually (e.g. if GPU execution time is - // being - // measured), call this method. If called, each benchmark iteration should - // call - // SetIterationTime(seconds) to report the measured time, which will be used - // to control how many iterations are run, and in the printing of items/second - // or MB/second values. - Benchmark* UseManualTime(); - - // Set the asymptotic computational complexity for the benchmark. If called - // the asymptotic computational complexity will be shown on the output. - Benchmark* Complexity(BigO complexity = benchmark::oAuto); - - // Set the asymptotic computational complexity for the benchmark. If called - // the asymptotic computational complexity will be shown on the output. - Benchmark* Complexity(BigOFunc* complexity); - - // Support for running multiple copies of the same benchmark concurrently - // in multiple threads. This may be useful when measuring the scaling - // of some piece of code. - - // Run one instance of this benchmark concurrently in t threads. - Benchmark* Threads(int t); - - // Pick a set of values T from [min_threads,max_threads]. - // min_threads and max_threads are always included in T. Run this - // benchmark once for each value in T. The benchmark run for a - // particular value t consists of t threads running the benchmark - // function concurrently. For example, consider: - // BENCHMARK(Foo)->ThreadRange(1,16); - // This will run the following benchmarks: - // Foo in 1 thread - // Foo in 2 threads - // Foo in 4 threads - // Foo in 8 threads - // Foo in 16 threads - Benchmark* ThreadRange(int min_threads, int max_threads); - - // For each value n in the range, run this benchmark once using n threads. - // min_threads and max_threads are always included in the range. - // stride specifies the increment. E.g. DenseThreadRange(1, 8, 3) starts - // a benchmark with 1, 4, 7 and 8 threads. - Benchmark* DenseThreadRange(int min_threads, int max_threads, int stride = 1); - - // Equivalent to ThreadRange(NumCPUs(), NumCPUs()) - Benchmark* ThreadPerCpu(); - - virtual void Run(State& state) = 0; - - // Used inside the benchmark implementation - struct Instance; - - protected: - explicit Benchmark(const char* name); - Benchmark(Benchmark const&); - void SetName(const char* name); - - int ArgsCnt() const; - - static void AddRange(std::vector<int>* dst, int lo, int hi, int mult); - - private: - friend class BenchmarkFamilies; - - std::string name_; - ReportMode report_mode_; - std::vector<std::string> arg_names_; // Args for all benchmark runs - std::vector<std::vector<int> > args_; // Args for all benchmark runs - TimeUnit time_unit_; - int range_multiplier_; - double min_time_; - size_t iterations_; - int repetitions_; - bool use_real_time_; - bool use_manual_time_; - BigO complexity_; - BigOFunc* complexity_lambda_; - std::vector<int> thread_counts_; - - Benchmark& operator=(Benchmark const&); -}; - -} // namespace internal - -// Create and register a benchmark with the specified 'name' that invokes -// the specified functor 'fn'. -// -// RETURNS: A pointer to the registered benchmark. -internal::Benchmark* RegisterBenchmark(const char* name, - internal::Function* fn); - -#if defined(BENCHMARK_HAS_CXX11) -template <class Lambda> -internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn); -#endif - -namespace internal { -// The class used to hold all Benchmarks created from static function. -// (ie those created using the BENCHMARK(...) macros. -class FunctionBenchmark : public Benchmark { - public: - FunctionBenchmark(const char* name, Function* func) - : Benchmark(name), func_(func) {} - - virtual void Run(State& st); - - private: - Function* func_; -}; - -#ifdef BENCHMARK_HAS_CXX11 -template <class Lambda> -class LambdaBenchmark : public Benchmark { - public: - virtual void Run(State& st) { lambda_(st); } - - private: - template <class OLambda> - LambdaBenchmark(const char* name, OLambda&& lam) - : Benchmark(name), lambda_(std::forward<OLambda>(lam)) {} - - LambdaBenchmark(LambdaBenchmark const&) = delete; - - private: - template <class Lam> - friend Benchmark* ::benchmark::RegisterBenchmark(const char*, Lam&&); - - Lambda lambda_; -}; -#endif - -} // end namespace internal - -inline internal::Benchmark* RegisterBenchmark(const char* name, - internal::Function* fn) { - return internal::RegisterBenchmarkInternal( - ::new internal::FunctionBenchmark(name, fn)); -} - -#ifdef BENCHMARK_HAS_CXX11 -template <class Lambda> -internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) { - using BenchType = - internal::LambdaBenchmark<typename std::decay<Lambda>::type>; - return internal::RegisterBenchmarkInternal( - ::new BenchType(name, std::forward<Lambda>(fn))); -} -#endif - -#if defined(BENCHMARK_HAS_CXX11) && \ - (!defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409) -template <class Lambda, class... Args> -internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn, - Args&&... args) { - return benchmark::RegisterBenchmark( - name, [=](benchmark::State& st) { fn(st, args...); }); -} -#else -#define BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK -#endif - -// The base class for all fixture tests. -class Fixture : public internal::Benchmark { - public: - Fixture() : internal::Benchmark("") {} - - virtual void Run(State& st) { - this->SetUp(st); - this->BenchmarkCase(st); - this->TearDown(st); - } - - // These will be deprecated ... - virtual void SetUp(const State&) {} - virtual void TearDown(const State&) {} - // ... In favor of these. - virtual void SetUp(State& st) { SetUp(const_cast<const State&>(st)); } - virtual void TearDown(State& st) { TearDown(const_cast<const State&>(st)); } - - protected: - virtual void BenchmarkCase(State&) = 0; -}; - -} // end namespace benchmark - -// ------------------------------------------------------ -// Macro to register benchmarks - -// Check that __COUNTER__ is defined and that __COUNTER__ increases by 1 -// every time it is expanded. X + 1 == X + 0 is used in case X is defined to be -// empty. If X is empty the expression becomes (+1 == +0). -#if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0) -#define BENCHMARK_PRIVATE_UNIQUE_ID __COUNTER__ -#else -#define BENCHMARK_PRIVATE_UNIQUE_ID __LINE__ -#endif - -// Helpers for generating unique variable names -#define BENCHMARK_PRIVATE_NAME(n) \ - BENCHMARK_PRIVATE_CONCAT(_benchmark_, 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 - -#define BENCHMARK_PRIVATE_DECLARE(n) \ - static ::benchmark::internal::Benchmark* BENCHMARK_PRIVATE_NAME(n) \ - BENCHMARK_UNUSED - -#define BENCHMARK(n) \ - BENCHMARK_PRIVATE_DECLARE(n) = \ - (::benchmark::internal::RegisterBenchmarkInternal( \ - new ::benchmark::internal::FunctionBenchmark(#n, n))) - -// Old-style macros -#define BENCHMARK_WITH_ARG(n, a) BENCHMARK(n)->Arg((a)) -#define BENCHMARK_WITH_ARG2(n, a1, a2) BENCHMARK(n)->Args({(a1), (a2)}) -#define BENCHMARK_WITH_UNIT(n, t) BENCHMARK(n)->Unit((t)) -#define BENCHMARK_RANGE(n, lo, hi) BENCHMARK(n)->Range((lo), (hi)) -#define BENCHMARK_RANGE2(n, l1, h1, l2, h2) \ - BENCHMARK(n)->RangePair({{(l1), (h1)}, {(l2), (h2)}}) - -#if __cplusplus >= 201103L - -// Register a benchmark which invokes the function specified by `func` -// with the additional arguments specified by `...`. -// -// For example: -// -// template <class ...ExtraArgs>` -// void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) { -// [...] -//} -// /* Registers a benchmark named "BM_takes_args/int_string_test` */ -// BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc")); -#define BENCHMARK_CAPTURE(func, test_case_name, ...) \ - BENCHMARK_PRIVATE_DECLARE(func) = \ - (::benchmark::internal::RegisterBenchmarkInternal( \ - new ::benchmark::internal::FunctionBenchmark( \ - #func "/" #test_case_name, \ - [](::benchmark::State& st) { func(st, __VA_ARGS__); }))) - -#endif // __cplusplus >= 11 - -// This will register a benchmark for a templatized function. For example: -// -// template<int arg> -// void BM_Foo(int iters); -// -// BENCHMARK_TEMPLATE(BM_Foo, 1); -// -// will register BM_Foo<1> as a benchmark. -#define BENCHMARK_TEMPLATE1(n, a) \ - BENCHMARK_PRIVATE_DECLARE(n) = \ - (::benchmark::internal::RegisterBenchmarkInternal( \ - new ::benchmark::internal::FunctionBenchmark(#n "<" #a ">", n<a>))) - -#define BENCHMARK_TEMPLATE2(n, a, b) \ - BENCHMARK_PRIVATE_DECLARE(n) = \ - (::benchmark::internal::RegisterBenchmarkInternal( \ - new ::benchmark::internal::FunctionBenchmark(#n "<" #a "," #b ">", \ - n<a, b>))) - -#if __cplusplus >= 201103L -#define BENCHMARK_TEMPLATE(n, ...) \ - BENCHMARK_PRIVATE_DECLARE(n) = \ - (::benchmark::internal::RegisterBenchmarkInternal( \ - new ::benchmark::internal::FunctionBenchmark( \ - #n "<" #__VA_ARGS__ ">", n<__VA_ARGS__>))) -#else -#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_DEFINE_F(BaseClass, Method) \ - BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \ - void BaseClass##_##Method##_Benchmark::BenchmarkCase - -#define BENCHMARK_REGISTER_F(BaseClass, Method) \ - BENCHMARK_PRIVATE_REGISTER_F(BaseClass##_##Method##_Benchmark) - -#define BENCHMARK_PRIVATE_REGISTER_F(TestName) \ - BENCHMARK_PRIVATE_DECLARE(TestName) = \ - (::benchmark::internal::RegisterBenchmarkInternal(new TestName())) - -// This macro will define and register a benchmark within a fixture class. -#define BENCHMARK_F(BaseClass, Method) \ - BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \ - BENCHMARK_REGISTER_F(BaseClass, Method); \ - void BaseClass##_##Method##_Benchmark::BenchmarkCase - -// Helper macro to create a main routine in a test that runs the benchmarks -#define BENCHMARK_MAIN() \ - int main(int argc, char** argv) { \ - ::benchmark::Initialize(&argc, argv); \ - if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \ - ::benchmark::RunSpecifiedBenchmarks(); \ - } - -#endif // BENCHMARK_BENCHMARK_API_H_ diff --git a/utils/google-benchmark/include/benchmark/macros.h b/utils/google-benchmark/include/benchmark/macros.h deleted file mode 100644 index 2466fd3fad06c..0000000000000 --- a/utils/google-benchmark/include/benchmark/macros.h +++ /dev/null @@ -1,66 +0,0 @@ -// 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. -#ifndef BENCHMARK_MACROS_H_ -#define BENCHMARK_MACROS_H_ - -#if __cplusplus >= 201103L -#define BENCHMARK_HAS_CXX11 -#endif - -#ifndef BENCHMARK_HAS_CXX11 -#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - TypeName& operator=(const TypeName&) -#else -#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&) = delete; \ - TypeName& operator=(const TypeName&) = delete -#endif - -#if defined(__GNUC__) -#define BENCHMARK_UNUSED __attribute__((unused)) -#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 -#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x) -#else -#define BENCHMARK_NOEXCEPT -#define BENCHMARK_NOEXCEPT_OP(x) -#endif -#define __func__ __FUNCTION__ -#else -#define BENCHMARK_UNUSED -#define BENCHMARK_ALWAYS_INLINE -#define BENCHMARK_NOEXCEPT -#define BENCHMARK_NOEXCEPT_OP(x) -#endif - -#if defined(__GNUC__) -#define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y) -#define BENCHMARK_DEPRECATED_MSG(msg) __attribute__((deprecated(msg))) -#else -#define BENCHMARK_BUILTIN_EXPECT(x, y) x -#define BENCHMARK_DEPRECATED_MSG(msg) -#endif - -#if defined(__GNUC__) && !defined(__clang__) -#define BENCHMARK_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) -#endif - -#endif // BENCHMARK_MACROS_H_ diff --git a/utils/google-benchmark/include/benchmark/reporter.h b/utils/google-benchmark/include/benchmark/reporter.h deleted file mode 100644 index 789124ba8138e..0000000000000 --- a/utils/google-benchmark/include/benchmark/reporter.h +++ /dev/null @@ -1,230 +0,0 @@ -// 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. -#ifndef BENCHMARK_REPORTER_H_ -#define BENCHMARK_REPORTER_H_ - -#include <cassert> -#include <iosfwd> -#include <string> -#include <utility> -#include <vector> -#include <set> - -#include "benchmark_api.h" // For forward declaration of BenchmarkReporter - -namespace benchmark { - -// 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 -// RunSpecifiedBenchmarks and passing it a custom reporter object. -// The reporter object must implement the following interface. -class BenchmarkReporter { - public: - struct Context { - int num_cpus; - double mhz_per_cpu; - bool cpu_scaling_enabled; - - // The number of chars in the longest benchmark name. - size_t name_field_width; - }; - - struct Run { - Run() - : error_occurred(false), - iterations(1), - time_unit(kNanosecond), - real_accumulated_time(0), - cpu_accumulated_time(0), - bytes_per_second(0), - items_per_second(0), - max_heapbytes_used(0), - complexity(oNone), - complexity_lambda(), - complexity_n(0), - report_big_o(false), - report_rms(false), - counters() {} - - std::string benchmark_name; - std::string report_label; // Empty if not set by benchmark. - bool error_occurred; - std::string error_message; - - int64_t iterations; - TimeUnit time_unit; - double real_accumulated_time; - double cpu_accumulated_time; - - // Return a value representing the real time per iteration in the unit - // specified by 'time_unit'. - // NOTE: If 'iterations' is zero the returned value represents the - // accumulated time. - double GetAdjustedRealTime() const; - - // Return a value representing the cpu time per iteration in the unit - // specified by 'time_unit'. - // NOTE: If 'iterations' is zero the returned value represents the - // accumulated time. - double GetAdjustedCPUTime() const; - - // Zero if not set by benchmark. - double bytes_per_second; - double items_per_second; - - // This is set to 0.0 if memory tracing is not enabled. - double max_heapbytes_used; - - // Keep track of arguments to compute asymptotic complexity - BigO complexity; - BigOFunc* complexity_lambda; - int complexity_n; - - // Inform print function whether the current run is a complexity report - bool report_big_o; - bool report_rms; - - UserCounters counters; - }; - - // Construct a BenchmarkReporter with the output stream set to 'std::cout' - // and the error stream set to 'std::cerr' - BenchmarkReporter(); - - // Called once for every suite of benchmarks run. - // The parameter "context" contains information that the - // reporter may wish to use when generating its report, for example the - // platform under which the benchmarks are running. The benchmark run is - // never started if this function returns false, allowing the reporter - // to skip runs based on the context information. - virtual bool ReportContext(const Context& context) = 0; - - // Called once for each group of benchmark runs, gives information about - // cpu-time and heap memory usage during the benchmark run. If the group - // of runs contained more than two entries then 'report' contains additional - // elements representing the mean and standard deviation of those runs. - // Additionally if this group of runs was the last in a family of benchmarks - // 'reports' contains additional entries representing the asymptotic - // complexity and RMS of that benchmark family. - virtual void ReportRuns(const std::vector<Run>& report) = 0; - - // Called once and only once after ever group of benchmarks is run and - // reported. - virtual void Finalize() {} - - // REQUIRES: The object referenced by 'out' is valid for the lifetime - // of the reporter. - void SetOutputStream(std::ostream* out) { - assert(out); - output_stream_ = out; - } - - // REQUIRES: The object referenced by 'err' is valid for the lifetime - // of the reporter. - void SetErrorStream(std::ostream* err) { - assert(err); - error_stream_ = err; - } - - std::ostream& GetOutputStream() const { return *output_stream_; } - - std::ostream& GetErrorStream() const { return *error_stream_; } - - virtual ~BenchmarkReporter(); - - // Write a human readable string to 'out' representing the specified - // 'context'. - // REQUIRES: 'out' is non-null. - static void PrintBasicContext(std::ostream* out, Context const& context); - - private: - std::ostream* output_stream_; - std::ostream* error_stream_; -}; - -// Simple reporter that outputs benchmark data to the console. This is the -// default reporter used by RunSpecifiedBenchmarks(). -class ConsoleReporter : public BenchmarkReporter { - public: - enum OutputOptions { OO_None, OO_Color }; - explicit ConsoleReporter(OutputOptions color_output = OO_Color) - : name_field_width_(0), color_output_(color_output == OO_Color) {} - - virtual bool ReportContext(const Context& context); - virtual void ReportRuns(const std::vector<Run>& reports); - - protected: - virtual void PrintRunData(const Run& report); - virtual void PrintHeader(const Run& report); - - size_t name_field_width_; - bool printed_header_; - - private: - bool color_output_; -}; - -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(); - - private: - void PrintRunData(const Run& report); - - bool first_report_; -}; - -class CSVReporter : public BenchmarkReporter { - public: - CSVReporter() : printed_header_(false) {} - virtual bool ReportContext(const Context& context); - virtual void ReportRuns(const std::vector<Run>& reports); - - private: - void PrintRunData(const Run& report); - - bool printed_header_; - std::set< std::string > user_counter_names_; -}; - -inline const char* GetTimeUnitString(TimeUnit unit) { - switch (unit) { - case kMillisecond: - return "ms"; - case kMicrosecond: - return "us"; - case kNanosecond: - default: - return "ns"; - } -} - -inline double GetTimeUnitMultiplier(TimeUnit unit) { - switch (unit) { - case kMillisecond: - return 1e3; - case kMicrosecond: - return 1e6; - case kNanosecond: - default: - return 1e9; - } -} - -} // end namespace benchmark -#endif // BENCHMARK_REPORTER_H_ diff --git a/utils/google-benchmark/mingw.py b/utils/google-benchmark/mingw.py deleted file mode 100644 index 706ad559db9c7..0000000000000 --- a/utils/google-benchmark/mingw.py +++ /dev/null @@ -1,320 +0,0 @@ -#! /usr/bin/env python -# encoding: utf-8 - -import argparse -import errno -import logging -import os -import platform -import re -import sys -import subprocess -import tempfile - -try: - import winreg -except ImportError: - import _winreg as winreg -try: - import urllib.request as request -except ImportError: - import urllib as request -try: - import urllib.parse as parse -except ImportError: - import urlparse as parse - -class EmptyLogger(object): - ''' - Provides an implementation that performs no logging - ''' - def debug(self, *k, **kw): - pass - def info(self, *k, **kw): - pass - def warn(self, *k, **kw): - pass - def error(self, *k, **kw): - pass - def critical(self, *k, **kw): - pass - def setLevel(self, *k, **kw): - pass - -urls = ( - 'http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20' - 'targetting%20Win32/Personal%20Builds/mingw-builds/installer/' - 'repository.txt', - 'http://downloads.sourceforge.net/project/mingwbuilds/host-windows/' - 'repository.txt' -) -''' -A list of mingw-build repositories -''' - -def repository(urls = urls, log = EmptyLogger()): - ''' - Downloads and parse mingw-build repository files and parses them - ''' - log.info('getting mingw-builds repository') - versions = {} - re_sourceforge = re.compile(r'http://sourceforge.net/projects/([^/]+)/files') - re_sub = r'http://downloads.sourceforge.net/project/\1' - for url in urls: - log.debug(' - requesting: %s', url) - socket = request.urlopen(url) - repo = socket.read() - if not isinstance(repo, str): - repo = repo.decode(); - socket.close() - for entry in repo.split('\n')[:-1]: - value = entry.split('|') - version = tuple([int(n) for n in value[0].strip().split('.')]) - version = versions.setdefault(version, {}) - arch = value[1].strip() - if arch == 'x32': - arch = 'i686' - elif arch == 'x64': - arch = 'x86_64' - arch = version.setdefault(arch, {}) - threading = arch.setdefault(value[2].strip(), {}) - exceptions = threading.setdefault(value[3].strip(), {}) - revision = exceptions.setdefault(int(value[4].strip()[3:]), - re_sourceforge.sub(re_sub, value[5].strip())) - return versions - -def find_in_path(file, path=None): - ''' - Attempts to find an executable in the path - ''' - if platform.system() == 'Windows': - file += '.exe' - if path is None: - path = os.environ.get('PATH', '') - if type(path) is type(''): - path = path.split(os.pathsep) - return list(filter(os.path.exists, - map(lambda dir, file=file: os.path.join(dir, file), path))) - -def find_7zip(log = EmptyLogger()): - ''' - Attempts to find 7zip for unpacking the mingw-build archives - ''' - log.info('finding 7zip') - path = find_in_path('7z') - if not path: - key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\7-Zip') - path, _ = winreg.QueryValueEx(key, 'Path') - path = [os.path.join(path, '7z.exe')] - log.debug('found \'%s\'', path[0]) - return path[0] - -find_7zip() - -def unpack(archive, location, log = EmptyLogger()): - ''' - Unpacks a mingw-builds archive - ''' - sevenzip = find_7zip(log) - log.info('unpacking %s', os.path.basename(archive)) - cmd = [sevenzip, 'x', archive, '-o' + location, '-y'] - log.debug(' - %r', cmd) - with open(os.devnull, 'w') as devnull: - subprocess.check_call(cmd, stdout = devnull) - -def download(url, location, log = EmptyLogger()): - ''' - Downloads and unpacks a mingw-builds archive - ''' - log.info('downloading MinGW') - log.debug(' - url: %s', url) - log.debug(' - location: %s', location) - - re_content = re.compile(r'attachment;[ \t]*filename=(")?([^"]*)(")?[\r\n]*') - - stream = request.urlopen(url) - try: - content = stream.getheader('Content-Disposition') or '' - except AttributeError: - content = stream.headers.getheader('Content-Disposition') or '' - matches = re_content.match(content) - if matches: - filename = matches.group(2) - else: - parsed = parse.urlparse(stream.geturl()) - filename = os.path.basename(parsed.path) - - try: - os.makedirs(location) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(location): - pass - else: - raise - - archive = os.path.join(location, filename) - with open(archive, 'wb') as out: - while True: - buf = stream.read(1024) - if not buf: - break - out.write(buf) - unpack(archive, location, log = log) - os.remove(archive) - - possible = os.path.join(location, 'mingw64') - if not os.path.exists(possible): - possible = os.path.join(location, 'mingw32') - if not os.path.exists(possible): - raise ValueError('Failed to find unpacked MinGW: ' + possible) - return possible - -def root(location = None, arch = None, version = None, threading = None, - exceptions = None, revision = None, log = EmptyLogger()): - ''' - Returns the root folder of a specific version of the mingw-builds variant - of gcc. Will download the compiler if needed - ''' - - # Get the repository if we don't have all the information - if not (arch and version and threading and exceptions and revision): - versions = repository(log = log) - - # Determine some defaults - version = version or max(versions.keys()) - if not arch: - arch = platform.machine().lower() - if arch == 'x86': - arch = 'i686' - elif arch == 'amd64': - arch = 'x86_64' - if not threading: - keys = versions[version][arch].keys() - if 'posix' in keys: - threading = 'posix' - elif 'win32' in keys: - threading = 'win32' - else: - threading = keys[0] - if not exceptions: - keys = versions[version][arch][threading].keys() - if 'seh' in keys: - exceptions = 'seh' - elif 'sjlj' in keys: - exceptions = 'sjlj' - else: - exceptions = keys[0] - if revision == None: - revision = max(versions[version][arch][threading][exceptions].keys()) - if not location: - location = os.path.join(tempfile.gettempdir(), 'mingw-builds') - - # Get the download url - url = versions[version][arch][threading][exceptions][revision] - - # Tell the user whatzzup - log.info('finding MinGW %s', '.'.join(str(v) for v in version)) - log.debug(' - arch: %s', arch) - log.debug(' - threading: %s', threading) - log.debug(' - exceptions: %s', exceptions) - log.debug(' - revision: %s', revision) - log.debug(' - url: %s', url) - - # Store each specific revision differently - slug = '{version}-{arch}-{threading}-{exceptions}-rev{revision}' - slug = slug.format( - version = '.'.join(str(v) for v in version), - arch = arch, - threading = threading, - exceptions = exceptions, - revision = revision - ) - if arch == 'x86_64': - root_dir = os.path.join(location, slug, 'mingw64') - elif arch == 'i686': - root_dir = os.path.join(location, slug, 'mingw32') - else: - raise ValueError('Unknown MinGW arch: ' + arch) - - # Download if needed - if not os.path.exists(root_dir): - downloaded = download(url, os.path.join(location, slug), log = log) - if downloaded != root_dir: - raise ValueError('The location of mingw did not match\n%s\n%s' - % (downloaded, root_dir)) - - return root_dir - -def str2ver(string): - ''' - Converts a version string into a tuple - ''' - try: - version = tuple(int(v) for v in string.split('.')) - if len(version) is not 3: - raise ValueError() - except ValueError: - raise argparse.ArgumentTypeError( - 'please provide a three digit version string') - return version - -def main(): - ''' - Invoked when the script is run directly by the python interpreter - ''' - parser = argparse.ArgumentParser( - description = 'Downloads a specific version of MinGW', - formatter_class = argparse.ArgumentDefaultsHelpFormatter - ) - parser.add_argument('--location', - help = 'the location to download the compiler to', - default = os.path.join(tempfile.gettempdir(), 'mingw-builds')) - parser.add_argument('--arch', required = True, choices = ['i686', 'x86_64'], - help = 'the target MinGW architecture string') - parser.add_argument('--version', type = str2ver, - help = 'the version of GCC to download') - parser.add_argument('--threading', choices = ['posix', 'win32'], - help = 'the threading type of the compiler') - parser.add_argument('--exceptions', choices = ['sjlj', 'seh', 'dwarf'], - help = 'the method to throw exceptions') - parser.add_argument('--revision', type=int, - help = 'the revision of the MinGW release') - group = parser.add_mutually_exclusive_group() - group.add_argument('-v', '--verbose', action='store_true', - help='increase the script output verbosity') - group.add_argument('-q', '--quiet', action='store_true', - help='only print errors and warning') - args = parser.parse_args() - - # Create the logger - logger = logging.getLogger('mingw') - handler = logging.StreamHandler() - formatter = logging.Formatter('%(message)s') - handler.setFormatter(formatter) - logger.addHandler(handler) - logger.setLevel(logging.INFO) - if args.quiet: - logger.setLevel(logging.WARN) - if args.verbose: - logger.setLevel(logging.DEBUG) - - # Get MinGW - root_dir = root(location = args.location, arch = args.arch, - version = args.version, threading = args.threading, - exceptions = args.exceptions, revision = args.revision, - log = logger) - - sys.stdout.write('%s\n' % os.path.join(root_dir, 'bin')) - -if __name__ == '__main__': - try: - main() - except IOError as e: - sys.stderr.write('IO error: %s\n' % e) - sys.exit(1) - except OSError as e: - sys.stderr.write('OS error: %s\n' % e) - sys.exit(1) - except KeyboardInterrupt as e: - sys.stderr.write('Killed\n') - sys.exit(1) diff --git a/utils/google-benchmark/releasing.md b/utils/google-benchmark/releasing.md new file mode 100644 index 0000000000000..f0cd7010e3a90 --- /dev/null +++ b/utils/google-benchmark/releasing.md @@ -0,0 +1,16 @@ +# How to release + +* Make sure you're on master 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 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` diff --git a/utils/google-benchmark/src/CMakeLists.txt b/utils/google-benchmark/src/CMakeLists.txt index 7707773930c5d..977474f43f2ab 100644 --- a/utils/google-benchmark/src/CMakeLists.txt +++ b/utils/google-benchmark/src/CMakeLists.txt @@ -11,6 +11,10 @@ file(GLOB *.cc ${PROJECT_SOURCE_DIR}/include/benchmark/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.h) +file(GLOB BENCHMARK_MAIN "benchmark_main.cc") +foreach(item ${BENCHMARK_MAIN}) + list(REMOVE_ITEM SOURCE_FILES "${item}") +endforeach() add_library(benchmark ${SOURCE_FILES}) set_target_properties(benchmark PROPERTIES @@ -18,6 +22,9 @@ set_target_properties(benchmark PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) +target_include_directories(benchmark PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> + ) # Link threads. target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) @@ -31,45 +38,71 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_link_libraries(benchmark Shlwapi) endif() +# We need extra libraries on Solaris +if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + target_link_libraries(benchmark kstat) +endif() + +# Benchmark main library +add_library(benchmark_main "benchmark_main.cc") +set_target_properties(benchmark_main PROPERTIES + OUTPUT_NAME "benchmark_main" + VERSION ${GENERIC_LIB_VERSION} + SOVERSION ${GENERIC_LIB_SOVERSION} +) +target_include_directories(benchmark PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> + ) +target_link_libraries(benchmark_main 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") set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") +set(pkg_config "${generated_dir}/${PROJECT_NAME}.pc") set(targets_export_name "${PROJECT_NAME}Targets") set(namespace "${PROJECT_NAME}::") include(CMakePackageConfigHelpers) write_basic_package_version_file( - "${version_config}" VERSION ${GIT_VERSION} COMPATIBILITY SameMajorVersion + "${version_config}" VERSION ${GENERIC_LIB_VERSION} COMPATIBILITY SameMajorVersion ) configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY) +configure_file("${PROJECT_SOURCE_DIR}/cmake/benchmark.pc.in" "${pkg_config}" @ONLY) -# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable) -install( - TARGETS benchmark - EXPORT ${targets_export_name} - ARCHIVE DESTINATION ${lib_install_dir} - LIBRARY DESTINATION ${lib_install_dir} - RUNTIME DESTINATION ${bin_install_dir} - INCLUDES DESTINATION ${include_install_dir}) - -install( - DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark" - DESTINATION ${include_install_dir} - FILES_MATCHING PATTERN "*.*h") - -install( - FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") - -install( - EXPORT "${targets_export_name}" - NAMESPACE "${namespace}" - DESTINATION "${config_install_dir}") +if (BENCHMARK_ENABLE_INSTALL) + # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable) + 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}) + + install( + DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark" + DESTINATION ${include_install_dir} + FILES_MATCHING PATTERN "*.*h") + + install( + FILES "${project_config}" "${version_config}" + DESTINATION "${config_install_dir}") + + install( + FILES "${pkg_config}" + DESTINATION "${pkgconfig_install_dir}") + + install( + EXPORT "${targets_export_name}" + NAMESPACE "${namespace}" + DESTINATION "${config_install_dir}") +endif() diff --git a/utils/google-benchmark/src/benchmark.cc b/utils/google-benchmark/src/benchmark.cc index 00ffa07ff56e5..b14bc629143e2 100644 --- a/utils/google-benchmark/src/benchmark.cc +++ b/utils/google-benchmark/src/benchmark.cc @@ -17,7 +17,9 @@ #include "internal_macros.h" #ifndef BENCHMARK_OS_WINDOWS +#ifndef BENCHMARK_OS_FUCHSIA #include <sys/resource.h> +#endif #include <sys/time.h> #include <unistd.h> #endif @@ -27,10 +29,10 @@ #include <condition_variable> #include <cstdio> #include <cstdlib> -#include <cstring> #include <fstream> #include <iostream> #include <memory> +#include <string> #include <thread> #include "check.h" @@ -38,13 +40,14 @@ #include "commandlineflags.h" #include "complexity.h" #include "counter.h" +#include "internal_macros.h" #include "log.h" #include "mutex.h" #include "re.h" -#include "stat.h" +#include "statistics.h" #include "string_util.h" -#include "sysinfo.h" -#include "timers.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 " @@ -82,7 +85,7 @@ 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 additonal output to"); +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: " @@ -91,134 +94,28 @@ DEFINE_string(benchmark_color, "auto", "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"); namespace benchmark { -namespace internal { - -void UseCharPointer(char const volatile*) {} - -} // end namespace internal namespace { - static const size_t kMaxIterations = 1000000000; - } // end namespace namespace internal { -class ThreadManager { - public: - ThreadManager(int num_threads) - : alive_threads_(num_threads), start_stop_barrier_(num_threads) {} - - Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) { - return benchmark_mutex_; - } - - bool StartStopBarrier() EXCLUDES(end_cond_mutex_) { - return start_stop_barrier_.wait(); - } - - void NotifyThreadComplete() EXCLUDES(end_cond_mutex_) { - start_stop_barrier_.removeThread(); - if (--alive_threads_ == 0) { - MutexLock lock(end_cond_mutex_); - end_condition_.notify_all(); - } - } - - void WaitForAllThreads() EXCLUDES(end_cond_mutex_) { - MutexLock lock(end_cond_mutex_); - end_condition_.wait(lock.native_handle(), - [this]() { return alive_threads_ == 0; }); - } - - public: - struct Result { - double real_time_used = 0; - double cpu_time_used = 0; - double manual_time_used = 0; - int64_t bytes_processed = 0; - int64_t items_processed = 0; - int complexity_n = 0; - std::string report_label_; - std::string error_message_; - bool has_error_ = false; - UserCounters counters; - }; - GUARDED_BY(GetBenchmarkMutex()) Result results; - - private: - mutable Mutex benchmark_mutex_; - std::atomic<int> alive_threads_; - Barrier start_stop_barrier_; - Mutex end_cond_mutex_; - Condition end_condition_; -}; - -// Timer management class -class ThreadTimer { - public: - ThreadTimer() = default; - - // Called by each thread - void StartTimer() { - running_ = true; - start_real_time_ = ChronoClockNow(); - start_cpu_time_ = ThreadCPUUsage(); - } - - // Called by each thread - void StopTimer() { - CHECK(running_); - running_ = false; - real_time_used_ += ChronoClockNow() - start_real_time_; - cpu_time_used_ += ThreadCPUUsage() - start_cpu_time_; - } - - // Called by each thread - void SetIterationTime(double seconds) { manual_time_used_ += seconds; } - - bool running() const { return running_; } - - // REQUIRES: timer is not running - double real_time_used() { - CHECK(!running_); - return real_time_used_; - } - - // REQUIRES: timer is not running - double cpu_time_used() { - CHECK(!running_); - return cpu_time_used_; - } - - // REQUIRES: timer is not running - double manual_time_used() { - CHECK(!running_); - return manual_time_used_; - } - - private: - bool running_ = false; // Is the timer running - double start_real_time_ = 0; // If running_ - double start_cpu_time_ = 0; // If running_ - - // Accumulated time so far (does not contain current slice if running_) - double real_time_used_ = 0; - double cpu_time_used_ = 0; - // Manually set iteration time. User sets this with SetIterationTime(seconds). - double manual_time_used_ = 0; -}; +void UseCharPointer(char const volatile*) {} namespace { BenchmarkReporter::Run CreateRunReport( const benchmark::internal::Benchmark::Instance& b, - const internal::ThreadManager::Result& results, size_t iters, - double seconds) { + const internal::ThreadManager::Result& results, double seconds) { // Create report about this benchmark run. BenchmarkReporter::Run report; @@ -226,8 +123,8 @@ BenchmarkReporter::Run CreateRunReport( report.error_occurred = results.has_error_; report.error_message = results.error_message_; report.report_label = results.report_label_; - // Report the total iterations across all threads. - report.iterations = static_cast<int64_t>(iters) * b.threads; + // This is the total iterations across all threads. + report.iterations = results.iterations; report.time_unit = b.time_unit; if (!report.error_occurred) { @@ -251,7 +148,9 @@ BenchmarkReporter::Run CreateRunReport( report.complexity_n = results.complexity_n; report.complexity = b.complexity; report.complexity_lambda = b.complexity_lambda; + report.statistics = b.statistics; report.counters = results.counters; + internal::Finish(&report.counters, results.iterations, seconds, b.threads); } return report; } @@ -264,11 +163,12 @@ void RunInThread(const benchmark::internal::Benchmark::Instance* b, internal::ThreadTimer timer; State st(iters, b->arg, thread_id, b->threads, &timer, manager); b->benchmark->Run(st); - CHECK(st.iterations() == st.max_iterations) + CHECK(st.iterations() >= st.max_iterations) << "Benchmark returned before State::KeepRunning() returned false!"; { MutexLock l(manager->GetBenchmarkMutex()); internal::ThreadManager::Result& results = manager->results; + results.iterations += st.iterations(); results.cpu_time_used += timer.cpu_time_used(); results.real_time_used += timer.real_time_used(); results.manual_time_used += timer.manual_time_used(); @@ -333,21 +233,23 @@ std::vector<BenchmarkReporter::Run> RunBenchmark( const double min_time = !IsZero(b.min_time) ? b.min_time : FLAGS_benchmark_min_time; + // clang-format off + // turn off clang-format since it mangles prettiness here // Determine if this run should be reported; Either it has // run for a sufficient amount of time or because an error was reported. const bool should_report = repetition_num > 0 - || has_explicit_iteration_count // An exact iteration count was requested + || has_explicit_iteration_count // An exact iteration count was requested || results.has_error_ - || iters >= kMaxIterations - || seconds >= min_time // the elapsed time is large enough + || iters >= kMaxIterations // No chance to try again, we hit the limit. + || 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. || ((results.real_time_used >= 5 * min_time) && !b.use_manual_time); + // clang-format on if (should_report) { - BenchmarkReporter::Run report = - CreateRunReport(b, results, iters, seconds); + BenchmarkReporter::Run report = CreateRunReport(b, results, seconds); if (!report.error_occurred && b.complexity != oNone) complexity_reports->push_back(report); reports.push_back(report); @@ -390,25 +292,50 @@ std::vector<BenchmarkReporter::Run> RunBenchmark( } // namespace } // namespace internal -State::State(size_t max_iters, const std::vector<int>& ranges, int thread_i, +State::State(size_t max_iters, const std::vector<int64_t>& ranges, int thread_i, int n_threads, internal::ThreadTimer* timer, internal::ThreadManager* manager) - : started_(false), + : total_iterations_(0), + batch_leftover_(0), + max_iterations(max_iters), + started_(false), finished_(false), - total_iterations_(0), + error_occurred_(false), range_(ranges), bytes_processed_(0), items_processed_(0), complexity_n_(0), - error_occurred_(false), counters(), thread_index(thread_i), threads(n_threads), - max_iterations(max_iters), timer_(timer), manager_(manager) { CHECK(max_iterations != 0) << "At least one iteration must be run"; CHECK_LT(thread_index, threads) << "thread_index must be less than threads"; + + // Note: The use of offsetof below is technically undefined until C++17 + // because State is not a standard layout type. However, all compilers + // currently provide well-defined behavior as an extension (which is + // demonstrated since constexpr evaluation must diagnose all undefined + // behavior). However, GCC and Clang also warn about this use of offsetof, + // which must be suppressed. +#if defined(__INTEL_COMPILER) +#pragma warning push +#pragma warning(disable:1875) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif + // Offset tests to ensure commonly accessed data is on the first cache line. + const int cache_line_size = 64; + static_assert(offsetof(State, error_occurred_) <= + (cache_line_size - sizeof(error_occurred_)), + ""); +#if defined(__INTEL_COMPILER) +#pragma warning pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif } void State::PauseTiming() { @@ -432,7 +359,7 @@ void State::SkipWithError(const char* msg) { manager_->results.has_error_ = true; } } - total_iterations_ = max_iterations; + total_iterations_ = 0; if (timer_->running()) timer_->StopTimer(); } @@ -448,6 +375,7 @@ void State::SetLabel(const char* label) { void State::StartKeepRunning() { CHECK(!started_ && !finished_); started_ = true; + total_iterations_ = error_occurred_ ? 0 : max_iterations; manager_->StartStopBarrier(); if (!error_occurred_) ResumeTiming(); } @@ -457,8 +385,8 @@ void State::FinishKeepRunning() { if (!error_occurred_) { PauseTiming(); } - // Total iterations now is one greater than max iterations. Fix this. - total_iterations_ = max_iterations; + // Total iterations has now wrapped around past 0. Fix this. + total_iterations_ = 0; finished_ = true; manager_->StartStopBarrier(); } @@ -467,30 +395,30 @@ namespace internal { namespace { void RunBenchmarks(const std::vector<Benchmark::Instance>& benchmarks, - BenchmarkReporter* console_reporter, - BenchmarkReporter* file_reporter) { + BenchmarkReporter* console_reporter, + BenchmarkReporter* file_reporter) { // Note the file_reporter can be null. CHECK(console_reporter != nullptr); // Determine the width of the name field using a minimum width of 10. bool has_repetitions = FLAGS_benchmark_repetitions > 1; size_t name_field_width = 10; + size_t stat_field_width = 0; for (const Benchmark::Instance& benchmark : benchmarks) { name_field_width = std::max<size_t>(name_field_width, benchmark.name.size()); has_repetitions |= benchmark.repetitions > 1; + + for (const auto& Stat : *benchmark.statistics) + stat_field_width = std::max<size_t>(stat_field_width, Stat.name_.size()); } - if (has_repetitions) name_field_width += std::strlen("_stddev"); + if (has_repetitions) name_field_width += 1 + stat_field_width; // Print header here BenchmarkReporter::Context context; - context.num_cpus = NumCPUs(); - context.mhz_per_cpu = CyclesPerSecond() / 1000000.0f; - - context.cpu_scaling_enabled = CpuScalingEnabled(); context.name_field_width = name_field_width; - // Keep track of runing times of all instances of current benchmark + // 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 @@ -521,10 +449,10 @@ void RunBenchmarks(const std::vector<Benchmark::Instance>& benchmarks, } std::unique_ptr<BenchmarkReporter> CreateReporter( - std::string const& name, ConsoleReporter::OutputOptions allow_color) { + std::string const& name, ConsoleReporter::OutputOptions output_opts) { typedef std::unique_ptr<BenchmarkReporter> PtrType; if (name == "console") { - return PtrType(new ConsoleReporter(allow_color)); + return PtrType(new ConsoleReporter(output_opts)); } else if (name == "json") { return PtrType(new JSONReporter); } else if (name == "csv") { @@ -536,6 +464,30 @@ std::unique_ptr<BenchmarkReporter> CreateReporter( } } // end namespace + +bool IsZero(double n) { + return std::abs(n) < std::numeric_limits<double>::epsilon(); +} + +ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) { + int output_opts = ConsoleReporter::OO_Defaults; + if ((FLAGS_benchmark_color == "auto" && IsColorTerminal()) || + IsTruthyFlagValue(FLAGS_benchmark_color)) { + output_opts |= ConsoleReporter::OO_Color; + } else { + output_opts &= ~ConsoleReporter::OO_Color; + } + if (force_no_color) { + output_opts &= ~ConsoleReporter::OO_Color; + } + if (FLAGS_benchmark_counters_tabular) { + output_opts |= ConsoleReporter::OO_Tabular; + } else { + output_opts &= ~ConsoleReporter::OO_Tabular; + } + return static_cast<ConsoleReporter::OutputOptions>(output_opts); +} + } // end namespace internal size_t RunSpecifiedBenchmarks() { @@ -557,29 +509,21 @@ size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter, std::unique_ptr<BenchmarkReporter> default_console_reporter; std::unique_ptr<BenchmarkReporter> default_file_reporter; if (!console_reporter) { - auto output_opts = ConsoleReporter::OO_None; - if (FLAGS_benchmark_color == "auto") - output_opts = IsColorTerminal() ? ConsoleReporter::OO_Color - : ConsoleReporter::OO_None; - else - output_opts = IsTruthyFlagValue(FLAGS_benchmark_color) - ? ConsoleReporter::OO_Color - : ConsoleReporter::OO_None; - default_console_reporter = - internal::CreateReporter(FLAGS_benchmark_format, output_opts); + default_console_reporter = internal::CreateReporter( + FLAGS_benchmark_format, internal::GetOutputOptions()); console_reporter = default_console_reporter.get(); } auto& Out = console_reporter->GetOutputStream(); auto& Err = console_reporter->GetErrorStream(); std::string const& fname = FLAGS_benchmark_out; - if (fname == "" && file_reporter) { + if (fname.empty() && file_reporter) { Err << "A custom file reporter was provided but " "--benchmark_out=<file> was not specified." << std::endl; std::exit(1); } - if (fname != "") { + if (!fname.empty()) { output_file.open(fname); if (!output_file.is_open()) { Err << "invalid file name: '" << fname << std::endl; @@ -625,12 +569,15 @@ void PrintUsageAndExit() { " [--benchmark_out=<filename>]\n" " [--benchmark_out_format=<json|console|csv>]\n" " [--benchmark_color={auto|true|false}]\n" + " [--benchmark_counters_tabular={true|false}]\n" " [--v=<verbosity>]\n"); exit(0); } void ParseCommandLineFlags(int* argc, char** argv) { using namespace benchmark; + BenchmarkReporter::Context::executable_name = + (argc && *argc > 0) ? argv[0] : "unknown"; for (int i = 1; i < *argc; ++i) { if (ParseBoolFlag(argv[i], "benchmark_list_tests", &FLAGS_benchmark_list_tests) || @@ -649,6 +596,8 @@ void ParseCommandLineFlags(int* argc, char** argv) { // "color_print" is the deprecated name for "benchmark_color". // TODO: Remove this. ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) || + ParseBoolFlag(argv[i], "benchmark_counters_tabular", + &FLAGS_benchmark_counters_tabular) || ParseInt32Flag(argv[i], "v", &FLAGS_v)) { for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1]; @@ -682,7 +631,8 @@ void Initialize(int* argc, char** argv) { 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], argv[i]); + fprintf(stderr, "%s: error: unrecognized command-line flag: %s\n", argv[0], + argv[i]); } return argc > 1; } diff --git a/utils/google-benchmark/src/benchmark_api_internal.h b/utils/google-benchmark/src/benchmark_api_internal.h index 828ed12165ff7..dd7a3ffe8cbb2 100644 --- a/utils/google-benchmark/src/benchmark_api_internal.h +++ b/utils/google-benchmark/src/benchmark_api_internal.h @@ -1,7 +1,7 @@ #ifndef BENCHMARK_API_INTERNAL_H #define BENCHMARK_API_INTERNAL_H -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include <cmath> #include <iosfwd> @@ -17,7 +17,7 @@ struct Benchmark::Instance { std::string name; Benchmark* benchmark; ReportMode report_mode; - std::vector<int> arg; + std::vector<int64_t> arg; TimeUnit time_unit; int range_multiplier; bool use_real_time; @@ -25,6 +25,7 @@ struct Benchmark::Instance { BigO complexity; BigOFunc* complexity_lambda; UserCounters counters; + const std::vector<Statistics>* statistics; bool last_benchmark_instance; int repetitions; double min_time; @@ -36,13 +37,10 @@ bool FindBenchmarksInternal(const std::string& re, std::vector<Benchmark::Instance>* benchmarks, std::ostream* Err); -namespace { +bool IsZero(double n); -bool IsZero(double n) { - return std::abs(n) < std::numeric_limits<double>::epsilon(); -} +ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false); -} // end namespace } // end namespace internal } // end namespace benchmark diff --git a/utils/google-benchmark/src/benchmark_main.cc b/utils/google-benchmark/src/benchmark_main.cc new file mode 100644 index 0000000000000..b3b247831496f --- /dev/null +++ b/utils/google-benchmark/src/benchmark_main.cc @@ -0,0 +1,17 @@ +// Copyright 2018 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" + +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/src/benchmark_register.cc b/utils/google-benchmark/src/benchmark_register.cc index fe373204189f3..26a89721c786a 100644 --- a/utils/google-benchmark/src/benchmark_register.cc +++ b/utils/google-benchmark/src/benchmark_register.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/benchmark.h" -#include "benchmark_api_internal.h" -#include "internal_macros.h" +#include "benchmark_register.h" #ifndef BENCHMARK_OS_WINDOWS +#ifndef BENCHMARK_OS_FUCHSIA #include <sys/resource.h> +#endif #include <sys/time.h> #include <unistd.h> #endif @@ -31,17 +31,20 @@ #include <fstream> #include <iostream> #include <memory> +#include <sstream> #include <thread> +#include "benchmark/benchmark.h" +#include "benchmark_api_internal.h" #include "check.h" #include "commandlineflags.h" #include "complexity.h" +#include "internal_macros.h" #include "log.h" #include "mutex.h" #include "re.h" -#include "stat.h" +#include "statistics.h" #include "string_util.h" -#include "sysinfo.h" #include "timers.h" namespace benchmark { @@ -69,9 +72,12 @@ class BenchmarkFamilies { // Registers a benchmark family and returns the index assigned to it. size_t AddBenchmark(std::unique_ptr<Benchmark> family); + // Clear all registered benchmark families. + void ClearBenchmarks(); + // Extract the list of benchmark instances that match the specified // regular expression. - bool FindBenchmarks(const std::string& re, + bool FindBenchmarks(std::string re, std::vector<Benchmark::Instance>* benchmarks, std::ostream* Err); @@ -94,14 +100,25 @@ size_t BenchmarkFamilies::AddBenchmark(std::unique_ptr<Benchmark> family) { return index; } +void BenchmarkFamilies::ClearBenchmarks() { + MutexLock l(mutex_); + families_.clear(); + families_.shrink_to_fit(); +} + bool BenchmarkFamilies::FindBenchmarks( - const std::string& spec, std::vector<Benchmark::Instance>* benchmarks, + std::string spec, std::vector<Benchmark::Instance>* benchmarks, std::ostream* ErrStream) { CHECK(ErrStream); auto& Err = *ErrStream; // Make regular expression out of command-line flag std::string error_msg; Regex re; + bool isNegativeFilter = false; + if (spec[0] == '-') { + spec.replace(0, 1, ""); + isNegativeFilter = true; + } if (!re.Init(spec, &error_msg)) { Err << "Could not compile benchmark re: " << error_msg << std::endl; return false; @@ -149,6 +166,7 @@ bool BenchmarkFamilies::FindBenchmarks( 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 @@ -160,20 +178,20 @@ bool BenchmarkFamilies::FindBenchmarks( const auto& arg_name = family->arg_names_[arg_i]; if (!arg_name.empty()) { instance.name += - StringPrintF("%s:", family->arg_names_[arg_i].c_str()); + StrFormat("%s:", family->arg_names_[arg_i].c_str()); } } - instance.name += std::to_string(arg); + instance.name += StrFormat("%d", arg); ++arg_i; } if (!IsZero(family->min_time_)) - instance.name += StringPrintF("/min_time:%0.3f", family->min_time_); + instance.name += StrFormat("/min_time:%0.3f", family->min_time_); if (family->iterations_ != 0) - instance.name += StringPrintF("/iterations:%d", family->iterations_); + instance.name += StrFormat("/iterations:%d", family->iterations_); if (family->repetitions_ != 0) - instance.name += StringPrintF("/repeats:%d", family->repetitions_); + instance.name += StrFormat("/repeats:%d", family->repetitions_); if (family->use_manual_time_) { instance.name += "/manual_time"; @@ -183,10 +201,11 @@ bool BenchmarkFamilies::FindBenchmarks( // Add the number of threads used to the name if (!family->thread_counts_.empty()) { - instance.name += StringPrintF("/threads:%d", instance.threads); + instance.name += StrFormat("/threads:%d", instance.threads); } - if (re.Match(instance.name)) { + 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)); } @@ -226,34 +245,15 @@ Benchmark::Benchmark(const char* name) use_real_time_(false), use_manual_time_(false), complexity_(oNone), - complexity_lambda_(nullptr) {} + complexity_lambda_(nullptr) { + ComputeStatistics("mean", StatisticsMean); + ComputeStatistics("median", StatisticsMedian); + ComputeStatistics("stddev", StatisticsStdDev); +} Benchmark::~Benchmark() {} -void Benchmark::AddRange(std::vector<int>* dst, int lo, int hi, int mult) { - CHECK_GE(lo, 0); - CHECK_GE(hi, lo); - CHECK_GE(mult, 2); - - // Add "lo" - dst->push_back(lo); - - static const int kint32max = std::numeric_limits<int32_t>::max(); - - // Now space out the benchmarks in multiples of "mult" - for (int32_t i = 1; i < kint32max / mult; i *= mult) { - if (i >= hi) break; - if (i > lo) { - dst->push_back(i); - } - } - // Add "hi" (if different from "lo") - if (hi != lo) { - dst->push_back(hi); - } -} - -Benchmark* Benchmark::Arg(int x) { +Benchmark* Benchmark::Arg(int64_t x) { CHECK(ArgsCnt() == -1 || ArgsCnt() == 1); args_.push_back({x}); return this; @@ -264,20 +264,21 @@ Benchmark* Benchmark::Unit(TimeUnit unit) { return this; } -Benchmark* Benchmark::Range(int start, int limit) { +Benchmark* Benchmark::Range(int64_t start, int64_t limit) { CHECK(ArgsCnt() == -1 || ArgsCnt() == 1); - std::vector<int> arglist; + std::vector<int64_t> arglist; AddRange(&arglist, start, limit, range_multiplier_); - for (int i : arglist) { + for (int64_t i : arglist) { args_.push_back({i}); } return this; } -Benchmark* Benchmark::Ranges(const std::vector<std::pair<int, int>>& ranges) { +Benchmark* Benchmark::Ranges( + const std::vector<std::pair<int64_t, int64_t>>& ranges) { CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(ranges.size())); - std::vector<std::vector<int>> arglists(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, @@ -288,7 +289,7 @@ Benchmark* Benchmark::Ranges(const std::vector<std::pair<int, int>>& ranges) { std::vector<std::size_t> ctr(arglists.size(), 0); for (std::size_t i = 0; i < total; i++) { - std::vector<int> tmp; + std::vector<int64_t> tmp; tmp.reserve(arglists.size()); for (std::size_t j = 0; j < arglists.size(); j++) { @@ -320,17 +321,17 @@ Benchmark* Benchmark::ArgNames(const std::vector<std::string>& names) { return this; } -Benchmark* Benchmark::DenseRange(int start, int limit, int step) { +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 (int arg = start; arg <= limit; arg += step) { + for (int64_t arg = start; arg <= limit; arg += step) { args_.push_back({arg}); } return this; } -Benchmark* Benchmark::Args(const std::vector<int>& args) { +Benchmark* Benchmark::Args(const std::vector<int64_t>& args) { CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(args.size())); args_.push_back(args); return this; @@ -347,7 +348,6 @@ Benchmark* Benchmark::RangeMultiplier(int multiplier) { return this; } - Benchmark* Benchmark::MinTime(double t) { CHECK(t > 0.0); CHECK(iterations_ == 0); @@ -355,7 +355,6 @@ Benchmark* Benchmark::MinTime(double t) { return this; } - Benchmark* Benchmark::Iterations(size_t n) { CHECK(n > 0); CHECK(IsZero(min_time_)); @@ -399,6 +398,12 @@ Benchmark* Benchmark::Complexity(BigOFunc* complexity) { return this; } +Benchmark* Benchmark::ComputeStatistics(std::string name, + StatisticsFunc* statistics) { + statistics_.emplace_back(name, statistics); + return this; +} + Benchmark* Benchmark::Threads(int t) { CHECK_GT(t, 0); thread_counts_.push_back(t); @@ -427,8 +432,7 @@ Benchmark* Benchmark::DenseThreadRange(int min_threads, int max_threads, } Benchmark* Benchmark::ThreadPerCpu() { - static int num_cpus = NumCPUs(); - thread_counts_.push_back(num_cpus); + thread_counts_.push_back(CPUInfo::Get().num_cpus); return this; } @@ -449,4 +453,9 @@ int Benchmark::ArgsCnt() const { void FunctionBenchmark::Run(State& st) { func_(st); } } // end namespace internal + +void ClearRegisteredBenchmarks() { + internal::BenchmarkFamilies::GetInstance()->ClearBenchmarks(); +} + } // end namespace benchmark diff --git a/utils/google-benchmark/src/benchmark_register.h b/utils/google-benchmark/src/benchmark_register.h new file mode 100644 index 0000000000000..0705e219f2fa2 --- /dev/null +++ b/utils/google-benchmark/src/benchmark_register.h @@ -0,0 +1,33 @@ +#ifndef BENCHMARK_REGISTER_H +#define BENCHMARK_REGISTER_H + +#include <vector> + +#include "check.h" + +template <typename T> +void AddRange(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); + + 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) { + dst->push_back(i); + } + } + + // Add "hi" (if different from "lo") + if (hi != lo) { + dst->push_back(hi); + } +} + +#endif // BENCHMARK_REGISTER_H diff --git a/utils/google-benchmark/src/check.h b/utils/google-benchmark/src/check.h index 6f1fe0cf860cd..f5f8253f8040d 100644 --- a/utils/google-benchmark/src/check.h +++ b/utils/google-benchmark/src/check.h @@ -1,6 +1,7 @@ #ifndef CHECK_H_ #define CHECK_H_ +#include <cmath> #include <cstdlib> #include <ostream> @@ -61,6 +62,8 @@ class CheckHandler { #define CHECK(b) ::benchmark::internal::GetNullLogInstance() #endif +// clang-format off +// preserve whitespacing between operators for alignment #define CHECK_EQ(a, b) CHECK((a) == (b)) #define CHECK_NE(a, b) CHECK((a) != (b)) #define CHECK_GE(a, b) CHECK((a) >= (b)) @@ -68,4 +71,12 @@ class CheckHandler { #define CHECK_GT(a, b) CHECK((a) > (b)) #define CHECK_LT(a, b) CHECK((a) < (b)) +#define CHECK_FLOAT_EQ(a, b, eps) CHECK(std::fabs((a) - (b)) < (eps)) +#define CHECK_FLOAT_NE(a, b, eps) CHECK(std::fabs((a) - (b)) >= (eps)) +#define CHECK_FLOAT_GE(a, b, eps) CHECK((a) - (b) > -(eps)) +#define CHECK_FLOAT_LE(a, b, eps) CHECK((b) - (a) > -(eps)) +#define CHECK_FLOAT_GT(a, b, eps) CHECK((a) - (b) > (eps)) +#define CHECK_FLOAT_LT(a, b, eps) CHECK((b) - (a) > (eps)) +//clang-format on + #endif // CHECK_H_ diff --git a/utils/google-benchmark/src/colorprint.cc b/utils/google-benchmark/src/colorprint.cc index 513376b14b140..2dec4a8b28ba8 100644 --- a/utils/google-benchmark/src/colorprint.cc +++ b/utils/google-benchmark/src/colorprint.cc @@ -89,7 +89,7 @@ std::string FormatString(const char* msg, va_list args) { std::size_t size = 256; char local_buff[256]; - auto ret = std::vsnprintf(local_buff, size, msg, args_cp); + auto ret = vsnprintf(local_buff, size, msg, args_cp); va_end(args_cp); @@ -104,7 +104,7 @@ std::string FormatString(const char* msg, va_list args) { // we did not provide a long enough buffer on our first attempt. size = (size_t)ret + 1; // + 1 for the null byte std::unique_ptr<char[]> buff(new char[size]); - ret = std::vsnprintf(buff.get(), size, msg, args); + ret = vsnprintf(buff.get(), size, msg, args); CHECK(ret > 0 && ((size_t)ret) < size); return buff.get(); } diff --git a/utils/google-benchmark/src/commandlineflags.cc b/utils/google-benchmark/src/commandlineflags.cc index 72534e022a8a7..734e88bbec686 100644 --- a/utils/google-benchmark/src/commandlineflags.cc +++ b/utils/google-benchmark/src/commandlineflags.cc @@ -45,7 +45,7 @@ bool ParseInt32(const std::string& src_text, const char* str, int32_t* value) { // LONG_MAX or LONG_MIN when the input overflows.) result != long_value // The parsed value overflows as an Int32. - ) { + ) { std::cerr << src_text << " is expected to be a 32-bit integer, " << "but actually has value \"" << str << "\", " << "which overflows.\n"; @@ -209,9 +209,9 @@ bool IsFlag(const char* str, const char* flag) { return (ParseFlagValue(str, flag, true) != nullptr); } -bool IsTruthyFlagValue(const std::string& str) { - if (str.empty()) return true; - char ch = str[0]; +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'); } diff --git a/utils/google-benchmark/src/complexity.cc b/utils/google-benchmark/src/complexity.cc index 02adbef629262..aafd538df2159 100644 --- a/utils/google-benchmark/src/complexity.cc +++ b/utils/google-benchmark/src/complexity.cc @@ -15,32 +15,34 @@ // Source project : https://github.com/ismaelJimenez/cpp.leastsq // Adapted to be used with google benchmark -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include <algorithm> #include <cmath> #include "check.h" #include "complexity.h" -#include "stat.h" namespace benchmark { // Internal function to calculate the different scalability forms BigOFunc* FittingCurve(BigO complexity) { + static const double kLog2E = 1.44269504088896340736; switch (complexity) { case oN: - return [](int n) -> double { return n; }; + return [](int64_t n) -> double { return static_cast<double>(n); }; case oNSquared: - return [](int n) -> double { return std::pow(n, 2); }; + return [](int64_t n) -> double { return std::pow(n, 2); }; case oNCubed: - return [](int n) -> double { return std::pow(n, 3); }; + return [](int64_t n) -> double { return std::pow(n, 3); }; case oLogN: - return [](int n) { return std::log2(n); }; + /* Note: can't use log2 because Android's GNU STL lacks it */ + return [](int64_t n) { return kLog2E * log(static_cast<double>(n)); }; case oNLogN: - return [](int n) { return n * std::log2(n); }; + /* Note: can't use log2 because Android's GNU STL lacks it */ + return [](int64_t n) { return kLog2E * n * log(static_cast<double>(n)); }; case o1: default: - return [](int) { return 1.0; }; + return [](int64_t) { return 1.0; }; } } @@ -66,15 +68,15 @@ std::string GetBigOString(BigO complexity) { // Find the coefficient for the high-order term in the running time, by // minimizing the sum of squares of relative error, for the fitting curve -// given by the lambda expresion. +// given by the lambda expression. // - n : Vector containing the size of the benchmark tests. // - time : Vector containing the times for the benchmark tests. -// - fitting_curve : lambda expresion (e.g. [](int n) {return n; };). +// - fitting_curve : lambda expression (e.g. [](int64_t n) {return n; };). // For a deeper explanation on the algorithm logic, look the README file at // http://github.com/ismaelJimenez/Minimal-Cpp-Least-Squared-Fit -LeastSq MinimalLeastSq(const std::vector<int>& n, +LeastSq MinimalLeastSq(const std::vector<int64_t>& n, const std::vector<double>& time, BigOFunc* fitting_curve) { double sigma_gn = 0.0; @@ -118,7 +120,7 @@ LeastSq MinimalLeastSq(const std::vector<int>& n, // - complexity : If different than oAuto, the fitting curve will stick to // this one. If it is oAuto, it will be calculated the best // fitting curve. -LeastSq MinimalLeastSq(const std::vector<int>& n, +LeastSq MinimalLeastSq(const std::vector<int64_t>& n, const std::vector<double>& time, const BigO complexity) { CHECK_EQ(n.size(), time.size()); CHECK_GE(n.size(), 2); // Do not compute fitting curve is less than two @@ -150,109 +152,6 @@ LeastSq MinimalLeastSq(const std::vector<int>& n, return best_fit; } -std::vector<BenchmarkReporter::Run> ComputeStats( - const std::vector<BenchmarkReporter::Run>& reports) { - typedef BenchmarkReporter::Run Run; - std::vector<Run> results; - - auto error_count = - std::count_if(reports.begin(), reports.end(), - [](Run const& run) { return run.error_occurred; }); - - if (reports.size() - error_count < 2) { - // We don't report aggregated data if there was a single run. - return results; - } - // Accumulators. - Stat1_d real_accumulated_time_stat; - Stat1_d cpu_accumulated_time_stat; - Stat1_d bytes_per_second_stat; - Stat1_d items_per_second_stat; - // 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; - // create stats for user counters - struct CounterStat { - Counter c; - Stat1_d s; - }; - std::map< std::string, CounterStat > counter_stats; - for(Run const& r : reports) { - for(auto const& cnt : r.counters) { - auto it = counter_stats.find(cnt.first); - if(it == counter_stats.end()) { - counter_stats.insert({cnt.first, {cnt.second, Stat1_d{}}}); - } else { - CHECK_EQ(counter_stats[cnt.first].c.flags, cnt.second.flags); - } - } - } - - // Populate the accumulators. - for (Run const& run : reports) { - CHECK_EQ(reports[0].benchmark_name, run.benchmark_name); - CHECK_EQ(run_iterations, run.iterations); - if (run.error_occurred) continue; - real_accumulated_time_stat += - Stat1_d(run.real_accumulated_time / run.iterations, run.iterations); - cpu_accumulated_time_stat += - Stat1_d(run.cpu_accumulated_time / run.iterations, run.iterations); - items_per_second_stat += Stat1_d(run.items_per_second, run.iterations); - bytes_per_second_stat += Stat1_d(run.bytes_per_second, run.iterations); - // user counters - for(auto const& cnt : run.counters) { - auto it = counter_stats.find(cnt.first); - CHECK_NE(it, counter_stats.end()); - it->second.s += Stat1_d(cnt.second, run.iterations); - } - } - - // Get the data from the accumulator to BenchmarkReporter::Run's. - Run mean_data; - mean_data.benchmark_name = reports[0].benchmark_name + "_mean"; - mean_data.iterations = run_iterations; - mean_data.real_accumulated_time = - real_accumulated_time_stat.Mean() * run_iterations; - mean_data.cpu_accumulated_time = - cpu_accumulated_time_stat.Mean() * run_iterations; - mean_data.bytes_per_second = bytes_per_second_stat.Mean(); - mean_data.items_per_second = items_per_second_stat.Mean(); - mean_data.time_unit = reports[0].time_unit; - // user counters - for(auto const& kv : counter_stats) { - auto c = Counter(kv.second.s.Mean(), counter_stats[kv.first].c.flags); - mean_data.counters[kv.first] = c; - } - - // Only add label to mean/stddev if it is same for all runs - mean_data.report_label = reports[0].report_label; - for (std::size_t i = 1; i < reports.size(); i++) { - if (reports[i].report_label != reports[0].report_label) { - mean_data.report_label = ""; - break; - } - } - - Run stddev_data; - stddev_data.benchmark_name = reports[0].benchmark_name + "_stddev"; - stddev_data.report_label = mean_data.report_label; - stddev_data.iterations = 0; - stddev_data.real_accumulated_time = real_accumulated_time_stat.StdDev(); - stddev_data.cpu_accumulated_time = cpu_accumulated_time_stat.StdDev(); - stddev_data.bytes_per_second = bytes_per_second_stat.StdDev(); - stddev_data.items_per_second = items_per_second_stat.StdDev(); - stddev_data.time_unit = reports[0].time_unit; - // user counters - for(auto const& kv : counter_stats) { - auto c = Counter(kv.second.s.StdDev(), counter_stats[kv.first].c.flags); - stddev_data.counters[kv.first] = c; - } - - results.push_back(mean_data); - results.push_back(stddev_data); - return results; -} - std::vector<BenchmarkReporter::Run> ComputeBigO( const std::vector<BenchmarkReporter::Run>& reports) { typedef BenchmarkReporter::Run Run; @@ -261,7 +160,7 @@ std::vector<BenchmarkReporter::Run> ComputeBigO( if (reports.size() < 2) return results; // Accumulators. - std::vector<int> n; + std::vector<int64_t> n; std::vector<double> real_time; std::vector<double> cpu_time; diff --git a/utils/google-benchmark/src/complexity.h b/utils/google-benchmark/src/complexity.h index 23cd9bbc8c747..df29b48d29b4e 100644 --- a/utils/google-benchmark/src/complexity.h +++ b/utils/google-benchmark/src/complexity.h @@ -21,17 +21,10 @@ #include <string> #include <vector> -#include "benchmark/benchmark_api.h" -#include "benchmark/reporter.h" +#include "benchmark/benchmark.h" namespace benchmark { -// Return a vector containing the mean and standard devation information for -// the specified list of reports. If 'reports' contains less than two -// non-errored runs an empty vector is returned -std::vector<BenchmarkReporter::Run> ComputeStats( - const std::vector<BenchmarkReporter::Run>& reports); - // Return a vector containing the bigO and RMS information for the specified // list of reports. If 'reports.size() < 2' an empty vector is returned. std::vector<BenchmarkReporter::Run> ComputeBigO( @@ -58,4 +51,5 @@ struct LeastSq { std::string GetBigOString(BigO complexity); } // end namespace benchmark + #endif // COMPLEXITY_H_ diff --git a/utils/google-benchmark/src/console_reporter.cc b/utils/google-benchmark/src/console_reporter.cc index 3f3de02945a3e..48920ca782956 100644 --- a/utils/google-benchmark/src/console_reporter.cc +++ b/utils/google-benchmark/src/console_reporter.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/reporter.h" +#include "benchmark/benchmark.h" #include "complexity.h" #include "counter.h" @@ -36,15 +36,16 @@ namespace benchmark { bool ConsoleReporter::ReportContext(const Context& context) { name_field_width_ = context.name_field_width; printed_header_ = false; + prev_counters_.clear(); PrintBasicContext(&GetErrorStream(), context); #ifdef BENCHMARK_OS_WINDOWS - if (color_output_ && &std::cout != &GetOutputStream()) { + if ((output_options_ & OO_Color) && &std::cout != &GetOutputStream()) { GetErrorStream() << "Color printing is only supported for stdout on windows." " Disabling color printing\n"; - color_output_ = false; + output_options_ = static_cast< OutputOptions >(output_options_ & ~OO_Color); } #endif @@ -52,25 +53,39 @@ bool ConsoleReporter::ReportContext(const Context& context) { } void ConsoleReporter::PrintHeader(const Run& run) { - std::string str = - FormatString("%-*s %13s %13s %10s\n", static_cast<int>(name_field_width_), - "Benchmark", "Time", "CPU", "Iterations"); + std::string str = FormatString("%-*s %13s %13s %10s", static_cast<int>(name_field_width_), + "Benchmark", "Time", "CPU", "Iterations"); if(!run.counters.empty()) { - str += " UserCounters..."; + if(output_options_ & OO_Tabular) { + for(auto const& c : run.counters) { + str += FormatString(" %10s", c.first.c_str()); + } + } else { + str += " UserCounters..."; + } } + str += "\n"; std::string line = std::string(str.length(), '-'); GetOutputStream() << line << "\n" << str << line << "\n"; } void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) { for (const auto& run : reports) { - // print the header if none was printed yet - if (!printed_header_) { + // print the header: + // --- if none was printed yet + bool print_header = !printed_header_; + // --- or if the format is tabular and this run + // has different fields from the prev header + print_header |= (output_options_ & OO_Tabular) && + (!internal::SameNames(run.counters, prev_counters_)); + if (print_header) { printed_header_ = true; + prev_counters_ = run.counters; PrintHeader(run); } // As an alternative to printing the headers like this, we could sort - // the benchmarks by header and then print like that. + // the benchmarks by header and then print. But this would require + // waiting for the full results before printing, or printing twice. PrintRunData(run); } } @@ -86,8 +101,8 @@ static void IgnoreColorPrint(std::ostream& out, LogColor, const char* fmt, void ConsoleReporter::PrintRunData(const Run& result) { typedef void(PrinterFn)(std::ostream&, LogColor, const char*, ...); auto& Out = GetOutputStream(); - PrinterFn* printer = - color_output_ ? (PrinterFn*)ColorPrintf : IgnoreColorPrint; + PrinterFn* printer = (output_options_ & OO_Color) ? + (PrinterFn*)ColorPrintf : IgnoreColorPrint; auto name_color = (result.report_big_o || result.report_rms) ? COLOR_BLUE : COLOR_GREEN; printer(Out, name_color, "%-*s ", name_field_width_, @@ -133,8 +148,20 @@ void ConsoleReporter::PrintRunData(const Run& result) { } for (auto& c : result.counters) { - auto const& s = HumanReadableNumber(c.second.value); - printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str()); + const std::size_t cNameLen = std::max(std::string::size_type(10), + c.first.length()); + auto const& s = HumanReadableNumber(c.second.value, 1000); + 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(), + unit); + } } if (!rate.empty()) { diff --git a/utils/google-benchmark/src/counter.cc b/utils/google-benchmark/src/counter.cc index 307863d3c4d69..cb604e060b623 100644 --- a/utils/google-benchmark/src/counter.cc +++ b/utils/google-benchmark/src/counter.cc @@ -17,7 +17,8 @@ namespace benchmark { namespace internal { -double Finish(Counter const& c, double cpu_time, double num_threads) { +double Finish(Counter const& c, int64_t iterations, double cpu_time, + double num_threads) { double v = c.value; if (c.flags & Counter::kIsRate) { v /= cpu_time; @@ -25,25 +26,31 @@ double Finish(Counter const& c, double cpu_time, double num_threads) { if (c.flags & Counter::kAvgThreads) { v /= num_threads; } + if (c.flags & Counter::kIsIterationInvariant) { + v *= iterations; + } + if (c.flags & Counter::kAvgIterations) { + v /= iterations; + } return v; } -void Finish(UserCounters *l, double cpu_time, double num_threads) { - for (auto &c : *l) { - c.second = Finish(c.second, cpu_time, num_threads); +void Finish(UserCounters* l, int64_t iterations, double cpu_time, double num_threads) { + for (auto& c : *l) { + c.second.value = Finish(c.second, iterations, cpu_time, num_threads); } } -void Increment(UserCounters *l, UserCounters const& r) { +void Increment(UserCounters* l, UserCounters const& r) { // add counters present in both or just in *l - for (auto &c : *l) { + for (auto& c : *l) { auto it = r.find(c.first); if (it != r.end()) { - c.second = c.second + it->second; + c.second.value = c.second + it->second; } } // add counters present in r, but not in *l - for (auto const &tc : r) { + for (auto const& tc : r) { auto it = l->find(tc.first); if (it == l->end()) { (*l)[tc.first] = tc.second; @@ -57,12 +64,12 @@ bool SameNames(UserCounters const& l, UserCounters const& r) { return false; } for (auto const& c : l) { - if ( r.find(c.first) == r.end()) { + if (r.find(c.first) == r.end()) { return false; } } return true; } -} // end namespace internal -} // end namespace benchmark +} // end namespace internal +} // end namespace benchmark diff --git a/utils/google-benchmark/src/counter.h b/utils/google-benchmark/src/counter.h index bbb92d9a29839..d884e50aa12b6 100644 --- a/utils/google-benchmark/src/counter.h +++ b/utils/google-benchmark/src/counter.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" namespace benchmark { // these counter-related functions are hidden to reduce API surface. namespace internal { -void Finish(UserCounters *l, double time, double num_threads); -void Increment(UserCounters *l, UserCounters const& r); +void Finish(UserCounters* l, int64_t 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 internal -} //end namespace benchmark +} // end namespace benchmark diff --git a/utils/google-benchmark/src/csv_reporter.cc b/utils/google-benchmark/src/csv_reporter.cc index 6779815b3c37c..4a641909d808c 100644 --- a/utils/google-benchmark/src/csv_reporter.cc +++ b/utils/google-benchmark/src/csv_reporter.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/reporter.h" +#include "benchmark/benchmark.h" #include "complexity.h" #include <algorithm> @@ -22,9 +22,9 @@ #include <tuple> #include <vector> +#include "check.h" #include "string_util.h" #include "timers.h" -#include "check.h" // File format reference: http://edoceo.com/utilitas/csv-file-format. @@ -35,14 +35,14 @@ std::vector<std::string> elements = { "name", "iterations", "real_time", "cpu_time", "time_unit", "bytes_per_second", "items_per_second", "label", "error_occurred", "error_message"}; -} +} // namespace bool CSVReporter::ReportContext(const Context& context) { PrintBasicContext(&GetErrorStream(), context); return true; } -void CSVReporter::ReportRuns(const std::vector<Run> & reports) { +void CSVReporter::ReportRuns(const std::vector<Run>& reports) { std::ostream& Out = GetOutputStream(); if (!printed_header_) { @@ -58,7 +58,8 @@ void CSVReporter::ReportRuns(const std::vector<Run> & reports) { Out << *B++; if (B != elements.end()) Out << ","; } - for (auto B = user_counter_names_.begin(); B != user_counter_names_.end();) { + for (auto B = user_counter_names_.begin(); + B != user_counter_names_.end();) { Out << ",\"" << *B++ << "\""; } Out << "\n"; @@ -69,9 +70,9 @@ void CSVReporter::ReportRuns(const std::vector<Run> & reports) { for (const auto& run : reports) { for (const auto& cnt : run.counters) { CHECK(user_counter_names_.find(cnt.first) != user_counter_names_.end()) - << "All counters must be present in each run. " - << "Counter named \"" << cnt.first - << "\" was not in a run after being added to the header"; + << "All counters must be present in each run. " + << "Counter named \"" << cnt.first + << "\" was not in a run after being added to the header"; } } } @@ -80,10 +81,9 @@ void CSVReporter::ReportRuns(const std::vector<Run> & reports) { for (const auto& run : reports) { PrintRunData(run); } - } -void CSVReporter::PrintRunData(const Run & run) { +void CSVReporter::PrintRunData(const Run& run) { std::ostream& Out = GetOutputStream(); // Field with embedded double-quote characters must be doubled and the field @@ -135,10 +135,13 @@ void CSVReporter::PrintRunData(const Run & run) { Out << ",,"; // for error_occurred and error_message // Print user counters - for (const auto &ucn : user_counter_names_) { + for (const auto& ucn : user_counter_names_) { auto it = run.counters.find(ucn); - CHECK(it != run.counters.end()); - Out << "," << it->second; + if (it == run.counters.end()) { + Out << ","; + } else { + Out << "," << it->second; + } } Out << '\n'; } diff --git a/utils/google-benchmark/src/cycleclock.h b/utils/google-benchmark/src/cycleclock.h index e0f9b01f9d39c..00d576416760d 100644 --- a/utils/google-benchmark/src/cycleclock.h +++ b/utils/google-benchmark/src/cycleclock.h @@ -23,7 +23,7 @@ #include <cstdint> -#include "benchmark/macros.h" +#include "benchmark/benchmark.h" #include "internal_macros.h" #if defined(BENCHMARK_OS_MACOSX) @@ -121,7 +121,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { // because is provides nanosecond resolution (which is noticable at // least for PNaCl modules running on x86 Mac & Linux). // Initialize to always return 0 if clock_gettime fails. - struct timespec ts = { 0, 0 }; + struct timespec ts = {0, 0}; clock_gettime(CLOCK_MONOTONIC, &ts); return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec; #elif defined(__aarch64__) @@ -159,6 +159,11 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { 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; + asm("stck %0" : "=Q"(tsc) : : "cc"); + return tsc; #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 diff --git a/utils/google-benchmark/src/internal_macros.h b/utils/google-benchmark/src/internal_macros.h index ab9dd85c10238..b7e9203ff60eb 100644 --- a/utils/google-benchmark/src/internal_macros.h +++ b/utils/google-benchmark/src/internal_macros.h @@ -1,36 +1,51 @@ #ifndef BENCHMARK_INTERNAL_MACROS_H_ #define BENCHMARK_INTERNAL_MACROS_H_ -#include "benchmark/macros.h" +#include "benchmark/benchmark.h" + +/* Needed to detect STL */ +#include <cstdlib> + +// clang-format off #ifndef __has_feature #define __has_feature(x) 0 #endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif #if defined(__clang__) -#define COMPILER_CLANG + #if !defined(COMPILER_CLANG) + #define COMPILER_CLANG + #endif #elif defined(_MSC_VER) -#define COMPILER_MSVC + #if !defined(COMPILER_MSVC) + #define COMPILER_MSVC + #endif #elif defined(__GNUC__) -#define COMPILER_GCC + #if !defined(COMPILER_GCC) + #define COMPILER_GCC + #endif #endif #if __has_feature(cxx_attributes) -#define BENCHMARK_NORETURN [[noreturn]] + #define BENCHMARK_NORETURN [[noreturn]] #elif defined(__GNUC__) -#define BENCHMARK_NORETURN __attribute__((noreturn)) + #define BENCHMARK_NORETURN __attribute__((noreturn)) #elif defined(COMPILER_MSVC) -#define BENCHMARK_NORETURN __declspec(noreturn) + #define BENCHMARK_NORETURN __declspec(noreturn) #else -#define BENCHMARK_NORETURN + #define BENCHMARK_NORETURN #endif #if defined(__CYGWIN__) -#define BENCHMARK_OS_CYGWIN 1 + #define BENCHMARK_OS_CYGWIN 1 #elif defined(_WIN32) -#define BENCHMARK_OS_WINDOWS 1 + #define BENCHMARK_OS_WINDOWS 1 #elif defined(__APPLE__) -#include "TargetConditionals.h" + #define BENCHMARK_OS_APPLE 1 + #include "TargetConditionals.h" #if defined(TARGET_OS_MAC) #define BENCHMARK_OS_MACOSX 1 #if defined(TARGET_OS_IPHONE) @@ -38,18 +53,48 @@ #endif #endif #elif defined(__FreeBSD__) -#define BENCHMARK_OS_FREEBSD 1 + #define BENCHMARK_OS_FREEBSD 1 +#elif defined(__NetBSD__) + #define BENCHMARK_OS_NETBSD 1 +#elif defined(__OpenBSD__) + #define BENCHMARK_OS_OPENBSD 1 #elif defined(__linux__) -#define BENCHMARK_OS_LINUX 1 + #define BENCHMARK_OS_LINUX 1 #elif defined(__native_client__) -#define BENCHMARK_OS_NACL 1 -#elif defined(EMSCRIPTEN) -#define BENCHMARK_OS_EMSCRIPTEN 1 + #define BENCHMARK_OS_NACL 1 +#elif defined(__EMSCRIPTEN__) + #define BENCHMARK_OS_EMSCRIPTEN 1 +#elif defined(__rtems__) + #define BENCHMARK_OS_RTEMS 1 +#elif defined(__Fuchsia__) +#define BENCHMARK_OS_FUCHSIA 1 +#elif defined (__SVR4) && defined (__sun) +#define BENCHMARK_OS_SOLARIS 1 +#endif + +#if defined(__ANDROID__) && defined(__GLIBCXX__) +#define BENCHMARK_STL_ANDROID_GNUSTL 1 #endif #if !__has_feature(cxx_exceptions) && !defined(__cpp_exceptions) \ && !defined(__EXCEPTIONS) -#define BENCHMARK_HAS_NO_EXCEPTIONS + #define BENCHMARK_HAS_NO_EXCEPTIONS #endif +#if defined(COMPILER_CLANG) || defined(COMPILER_GCC) + #define BENCHMARK_MAYBE_UNUSED __attribute__((unused)) +#else + #define BENCHMARK_MAYBE_UNUSED +#endif + +#if defined(COMPILER_GCC) || __has_builtin(__builtin_unreachable) + #define BENCHMARK_UNREACHABLE() __builtin_unreachable() +#elif defined(COMPILER_MSVC) + #define BENCHMARK_UNREACHABLE() __assume(false) +#else + #define BENCHMARK_UNREACHABLE() ((void)0) +#endif + +// clang-format on + #endif // BENCHMARK_INTERNAL_MACROS_H_ diff --git a/utils/google-benchmark/src/json_reporter.cc b/utils/google-benchmark/src/json_reporter.cc index 5a653088e5bf1..611605af6b569 100644 --- a/utils/google-benchmark/src/json_reporter.cc +++ b/utils/google-benchmark/src/json_reporter.cc @@ -12,12 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/reporter.h" +#include "benchmark/benchmark.h" #include "complexity.h" #include <algorithm> #include <cstdint> +#include <iomanip> // for setprecision #include <iostream> +#include <limits> #include <string> #include <tuple> #include <vector> @@ -30,15 +32,15 @@ namespace benchmark { namespace { std::string FormatKV(std::string const& key, std::string const& value) { - return StringPrintF("\"%s\": \"%s\"", key.c_str(), value.c_str()); + return StrFormat("\"%s\": \"%s\"", key.c_str(), value.c_str()); } std::string FormatKV(std::string const& key, const char* value) { - return StringPrintF("\"%s\": \"%s\"", key.c_str(), value); + return StrFormat("\"%s\": \"%s\"", key.c_str(), value); } std::string FormatKV(std::string const& key, bool value) { - return StringPrintF("\"%s\": %s", key.c_str(), value ? "true" : "false"); + return StrFormat("\"%s\": %s", key.c_str(), value ? "true" : "false"); } std::string FormatKV(std::string const& key, int64_t value) { @@ -48,7 +50,14 @@ std::string FormatKV(std::string const& key, int64_t value) { } std::string FormatKV(std::string const& key, double value) { - return StringPrintF("\"%s\": %.2f", key.c_str(), value); + std::stringstream ss; + ss << '"' << key << "\": "; + + 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); } @@ -68,13 +77,41 @@ bool JSONReporter::ReportContext(const Context& context) { std::string walltime_value = LocalDateTimeString(); out << indent << FormatKV("date", walltime_value) << ",\n"; - out << indent << FormatKV("num_cpus", static_cast<int64_t>(context.num_cpus)) + if (Context::executable_name) { + out << indent << FormatKV("executable", Context::executable_name) << ",\n"; + } + + CPUInfo const& info = context.cpu_info; + out << indent << FormatKV("num_cpus", static_cast<int64_t>(info.num_cpus)) << ",\n"; - out << indent << FormatKV("mhz_per_cpu", RoundDouble(context.mhz_per_cpu)) + out << indent + << FormatKV("mhz_per_cpu", + RoundDouble(info.cycles_per_second / 1000000.0)) << ",\n"; - out << indent << FormatKV("cpu_scaling_enabled", context.cpu_scaling_enabled) + out << indent << FormatKV("cpu_scaling_enabled", info.scaling_enabled) << ",\n"; + out << indent << "\"caches\": [\n"; + indent = std::string(6, ' '); + std::string cache_indent(8, ' '); + for (size_t i = 0; i < info.caches.size(); ++i) { + auto& CI = info.caches[i]; + out << indent << "{\n"; + out << cache_indent << FormatKV("type", CI.type) << ",\n"; + 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"; + out << cache_indent + << FormatKV("num_sharing", static_cast<int64_t>(CI.num_sharing)) + << "\n"; + out << indent << "}"; + if (i != info.caches.size() - 1) out << ","; + out << "\n"; + } + indent = std::string(4, ' '); + out << indent << "],\n"; + #if defined(NDEBUG) const char build_type[] = "release"; #else @@ -124,40 +161,30 @@ void JSONReporter::PrintRunData(Run const& run) { } if (!run.report_big_o && !run.report_rms) { out << indent << FormatKV("iterations", run.iterations) << ",\n"; - out << indent - << FormatKV("real_time", RoundDouble(run.GetAdjustedRealTime())) - << ",\n"; - out << indent - << FormatKV("cpu_time", RoundDouble(run.GetAdjustedCPUTime())); + out << indent << FormatKV("real_time", run.GetAdjustedRealTime()) << ",\n"; + out << indent << FormatKV("cpu_time", run.GetAdjustedCPUTime()); out << ",\n" << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit)); } else if (run.report_big_o) { - out << indent - << FormatKV("cpu_coefficient", RoundDouble(run.GetAdjustedCPUTime())) + out << indent << FormatKV("cpu_coefficient", run.GetAdjustedCPUTime()) << ",\n"; - out << indent - << FormatKV("real_coefficient", RoundDouble(run.GetAdjustedRealTime())) + out << indent << FormatKV("real_coefficient", run.GetAdjustedRealTime()) << ",\n"; out << indent << FormatKV("big_o", GetBigOString(run.complexity)) << ",\n"; out << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit)); } else if (run.report_rms) { - out << indent - << FormatKV("rms", run.GetAdjustedCPUTime()); + out << indent << FormatKV("rms", run.GetAdjustedCPUTime()); } if (run.bytes_per_second > 0.0) { out << ",\n" - << indent - << FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second)); + << indent << FormatKV("bytes_per_second", run.bytes_per_second); } if (run.items_per_second > 0.0) { out << ",\n" - << indent - << FormatKV("items_per_second", RoundDouble(run.items_per_second)); + << indent << FormatKV("items_per_second", run.items_per_second); } - for(auto &c : run.counters) { - out << ",\n" - << indent - << FormatKV(c.first, RoundDouble(c.second)); + for (auto& c : run.counters) { + out << ",\n" << indent << FormatKV(c.first, c.second); } if (!run.report_label.empty()) { out << ",\n" << indent << FormatKV("label", run.report_label); @@ -165,4 +192,4 @@ void JSONReporter::PrintRunData(Run const& run) { out << '\n'; } -} // end namespace benchmark +} // end namespace benchmark diff --git a/utils/google-benchmark/src/log.h b/utils/google-benchmark/src/log.h index 978cb0b4c8cbe..47d0c35c01826 100644 --- a/utils/google-benchmark/src/log.h +++ b/utils/google-benchmark/src/log.h @@ -4,7 +4,7 @@ #include <iostream> #include <ostream> -#include "benchmark/macros.h" +#include "benchmark/benchmark.h" namespace benchmark { namespace internal { @@ -66,8 +66,9 @@ inline LogType& GetLogInstanceForLevel(int level) { } // end namespace internal } // end namespace benchmark +// clang-format off #define VLOG(x) \ (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \ " ") - -#endif
\ No newline at end of file +// clang-format on +#endif diff --git a/utils/google-benchmark/src/re.h b/utils/google-benchmark/src/re.h index 01e9736505e55..fbe25037b4638 100644 --- a/utils/google-benchmark/src/re.h +++ b/utils/google-benchmark/src/re.h @@ -17,22 +17,39 @@ #include "internal_macros.h" +// clang-format off + +#if !defined(HAVE_STD_REGEX) && \ + !defined(HAVE_GNU_POSIX_REGEX) && \ + !defined(HAVE_POSIX_REGEX) + // No explicit regex selection; detect based on builtin hints. + #if defined(BENCHMARK_OS_LINUX) || defined(BENCHMARK_OS_APPLE) + #define HAVE_POSIX_REGEX 1 + #elif __cplusplus >= 199711L + #define HAVE_STD_REGEX 1 + #endif +#endif + // Prefer C regex libraries when compiling w/o exceptions so that we can // correctly report errors. -#if defined(BENCHMARK_HAS_NO_EXCEPTIONS) && defined(HAVE_STD_REGEX) && \ +#if defined(BENCHMARK_HAS_NO_EXCEPTIONS) && \ + defined(BENCHMARK_HAVE_STD_REGEX) && \ (defined(HAVE_GNU_POSIX_REGEX) || defined(HAVE_POSIX_REGEX)) -#undef HAVE_STD_REGEX + #undef HAVE_STD_REGEX #endif #if defined(HAVE_STD_REGEX) -#include <regex> + #include <regex> #elif defined(HAVE_GNU_POSIX_REGEX) -#include <gnuregex.h> + #include <gnuregex.h> #elif defined(HAVE_POSIX_REGEX) -#include <regex.h> + #include <regex.h> #else #error No regular expression backend was found! #endif + +// clang-format on + #include <string> #include "check.h" @@ -72,20 +89,21 @@ class Regex { inline bool Regex::Init(const std::string& spec, std::string* error) { #ifdef BENCHMARK_HAS_NO_EXCEPTIONS - ((void)error); // suppress unused warning + ((void)error); // suppress unused warning #else try { #endif - re_ = std::regex(spec, std::regex_constants::extended); - init_ = true; + re_ = std::regex(spec, std::regex_constants::extended); + init_ = true; #ifndef BENCHMARK_HAS_NO_EXCEPTIONS - } catch (const std::regex_error& e) { - if (error) { - *error = e.what(); - } +} +catch (const std::regex_error& e) { + if (error) { + *error = e.what(); } +} #endif - return init_; +return init_; } inline Regex::~Regex() {} diff --git a/utils/google-benchmark/src/reporter.cc b/utils/google-benchmark/src/reporter.cc index 64742426cd3e2..541661a25f0a4 100644 --- a/utils/google-benchmark/src/reporter.cc +++ b/utils/google-benchmark/src/reporter.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "benchmark/reporter.h" +#include "benchmark/benchmark.h" #include "timers.h" #include <cstdlib> @@ -22,7 +22,6 @@ #include <vector> #include "check.h" -#include "stat.h" namespace benchmark { @@ -31,17 +30,32 @@ BenchmarkReporter::BenchmarkReporter() BenchmarkReporter::~BenchmarkReporter() {} -void BenchmarkReporter::PrintBasicContext(std::ostream *out_ptr, +void BenchmarkReporter::PrintBasicContext(std::ostream *out, Context const &context) { - CHECK(out_ptr) << "cannot be null"; - auto &Out = *out_ptr; - - Out << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu - << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n"; + CHECK(out) << "cannot be null"; + auto &Out = *out; Out << LocalDateTimeString() << "\n"; - if (context.cpu_scaling_enabled) { + if (context.executable_name) + Out << "Running " << context.executable_name << "\n"; + + const CPUInfo &info = context.cpu_info; + Out << "Run on (" << info.num_cpus << " X " + << (info.cycles_per_second / 1000000.0) << " MHz CPU " + << ((info.num_cpus > 1) ? "s" : "") << ")\n"; + if (info.caches.size() != 0) { + Out << "CPU Caches:\n"; + for (auto &CInfo : info.caches) { + Out << " L" << CInfo.level << " " << CInfo.type << " " + << (CInfo.size / 1000) << "K"; + if (CInfo.num_sharing != 0) + Out << " (x" << (info.num_cpus / CInfo.num_sharing) << ")"; + Out << "\n"; + } + } + + if (info.scaling_enabled) { Out << "***WARNING*** CPU scaling is enabled, the benchmark " "real time measurements may be noisy and will incur extra " "overhead.\n"; @@ -53,6 +67,11 @@ void BenchmarkReporter::PrintBasicContext(std::ostream *out_ptr, #endif } +// No initializer because it's already initialized to NULL. +const char *BenchmarkReporter::Context::executable_name; + +BenchmarkReporter::Context::Context() : cpu_info(CPUInfo::Get()) {} + double BenchmarkReporter::Run::GetAdjustedRealTime() const { double new_time = real_accumulated_time * GetTimeUnitMultiplier(time_unit); if (iterations != 0) new_time /= static_cast<double>(iterations); diff --git a/utils/google-benchmark/src/stat.h b/utils/google-benchmark/src/stat.h deleted file mode 100644 index 136c3aa8d61fd..0000000000000 --- a/utils/google-benchmark/src/stat.h +++ /dev/null @@ -1,306 +0,0 @@ -#ifndef BENCHMARK_STAT_H_ -#define BENCHMARK_STAT_H_ - -#include <cmath> -#include <limits> -#include <ostream> -#include <type_traits> - -namespace benchmark { - -template <typename VType, typename NumType> -class Stat1; - -template <typename VType, typename NumType> -class Stat1MinMax; - -typedef Stat1<float, int64_t> Stat1_f; -typedef Stat1<double, int64_t> Stat1_d; -typedef Stat1MinMax<float, int64_t> Stat1MinMax_f; -typedef Stat1MinMax<double, int64_t> Stat1MinMax_d; - -template <typename VType> -class Vector2; -template <typename VType> -class Vector3; -template <typename VType> -class Vector4; - -template <typename VType, typename NumType> -class Stat1 { - public: - typedef Stat1<VType, NumType> Self; - - Stat1() { Clear(); } - // Create a sample of value dat and weight 1 - explicit Stat1(const VType &dat) { - sum_ = dat; - sum_squares_ = Sqr(dat); - numsamples_ = 1; - } - // Create statistics for all the samples between begin (included) - // and end(excluded) - explicit Stat1(const VType *begin, const VType *end) { - Clear(); - for (const VType *item = begin; item < end; ++item) { - (*this) += Stat1(*item); - } - } - // Create a sample of value dat and weight w - Stat1(const VType &dat, const NumType &w) { - sum_ = w * dat; - sum_squares_ = w * Sqr(dat); - numsamples_ = w; - } - // Copy operator - Stat1(const Self &stat) { - sum_ = stat.sum_; - sum_squares_ = stat.sum_squares_; - numsamples_ = stat.numsamples_; - } - - void Clear() { - numsamples_ = NumType(); - sum_squares_ = sum_ = VType(); - } - - Self &operator=(const Self &stat) { - sum_ = stat.sum_; - sum_squares_ = stat.sum_squares_; - numsamples_ = stat.numsamples_; - return (*this); - } - // Merge statistics from two sample sets. - Self &operator+=(const Self &stat) { - sum_ += stat.sum_; - sum_squares_ += stat.sum_squares_; - numsamples_ += stat.numsamples_; - return (*this); - } - // The operation opposite to += - Self &operator-=(const Self &stat) { - sum_ -= stat.sum_; - sum_squares_ -= stat.sum_squares_; - numsamples_ -= stat.numsamples_; - return (*this); - } - // Multiply the weight of the set of samples by a factor k - Self &operator*=(const VType &k) { - sum_ *= k; - sum_squares_ *= k; - numsamples_ *= k; - return (*this); - } - - // Merge statistics from two sample sets. - Self operator+(const Self &stat) const { return Self(*this) += stat; } - - // The operation opposite to + - Self operator-(const Self &stat) const { return Self(*this) -= stat; } - - // Multiply the weight of the set of samples by a factor k - Self operator*(const VType &k) const { return Self(*this) *= k; } - - // Return the total weight of this sample set - NumType numSamples() const { return numsamples_; } - - // Return the sum of this sample set - VType Sum() const { return sum_; } - - // Return the mean of this sample set - VType Mean() const { - if (numsamples_ == 0) return VType(); - return sum_ * (1.0 / numsamples_); - } - - // Return the mean of this sample set and compute the standard deviation at - // the same time. - VType Mean(VType *stddev) const { - if (numsamples_ == 0) return VType(); - VType mean = sum_ * (1.0 / numsamples_); - if (stddev) { - VType avg_squares = sum_squares_ * (1.0 / numsamples_); - *stddev = Sqrt(avg_squares - Sqr(mean)); - } - return mean; - } - - // Return the standard deviation of the sample set - VType StdDev() const { - if (numsamples_ == 0) return VType(); - VType mean = Mean(); - VType avg_squares = sum_squares_ * (1.0 / numsamples_); - return Sqrt(avg_squares - Sqr(mean)); - } - - private: - static_assert(std::is_integral<NumType>::value && - !std::is_same<NumType, bool>::value, - "NumType must be an integral type that is not bool."); - // Let i be the index of the samples provided (using +=) - // and weight[i],value[i] be the data of sample #i - // then the variables have the following meaning: - NumType numsamples_; // sum of weight[i]; - VType sum_; // sum of weight[i]*value[i]; - VType sum_squares_; // sum of weight[i]*value[i]^2; - - // Template function used to square a number. - // For a vector we square all components - template <typename SType> - static inline SType Sqr(const SType &dat) { - return dat * dat; - } - - template <typename SType> - static inline Vector2<SType> Sqr(const Vector2<SType> &dat) { - return dat.MulComponents(dat); - } - - template <typename SType> - static inline Vector3<SType> Sqr(const Vector3<SType> &dat) { - return dat.MulComponents(dat); - } - - template <typename SType> - static inline Vector4<SType> Sqr(const Vector4<SType> &dat) { - return dat.MulComponents(dat); - } - - // Template function used to take the square root of a number. - // For a vector we square all components - template <typename SType> - static inline SType Sqrt(const SType &dat) { - // Avoid NaN due to imprecision in the calculations - if (dat < 0) return 0; - return sqrt(dat); - } - - template <typename SType> - static inline Vector2<SType> Sqrt(const Vector2<SType> &dat) { - // Avoid NaN due to imprecision in the calculations - return Max(dat, Vector2<SType>()).Sqrt(); - } - - template <typename SType> - static inline Vector3<SType> Sqrt(const Vector3<SType> &dat) { - // Avoid NaN due to imprecision in the calculations - return Max(dat, Vector3<SType>()).Sqrt(); - } - - template <typename SType> - static inline Vector4<SType> Sqrt(const Vector4<SType> &dat) { - // Avoid NaN due to imprecision in the calculations - return Max(dat, Vector4<SType>()).Sqrt(); - } -}; - -// Useful printing function -template <typename VType, typename NumType> -std::ostream &operator<<(std::ostream &out, const Stat1<VType, NumType> &s) { - out << "{ avg = " << s.Mean() << " std = " << s.StdDev() - << " nsamples = " << s.NumSamples() << "}"; - return out; -} - -// Stat1MinMax: same as Stat1, but it also -// keeps the Min and Max values; the "-" -// operator is disabled because it cannot be implemented -// efficiently -template <typename VType, typename NumType> -class Stat1MinMax : public Stat1<VType, NumType> { - public: - typedef Stat1MinMax<VType, NumType> Self; - - Stat1MinMax() { Clear(); } - // Create a sample of value dat and weight 1 - explicit Stat1MinMax(const VType &dat) : Stat1<VType, NumType>(dat) { - max_ = dat; - min_ = dat; - } - // Create statistics for all the samples between begin (included) - // and end(excluded) - explicit Stat1MinMax(const VType *begin, const VType *end) { - Clear(); - for (const VType *item = begin; item < end; ++item) { - (*this) += Stat1MinMax(*item); - } - } - // Create a sample of value dat and weight w - Stat1MinMax(const VType &dat, const NumType &w) - : Stat1<VType, NumType>(dat, w) { - max_ = dat; - min_ = dat; - } - // Copy operator - Stat1MinMax(const Self &stat) : Stat1<VType, NumType>(stat) { - max_ = stat.max_; - min_ = stat.min_; - } - - void Clear() { - Stat1<VType, NumType>::Clear(); - if (std::numeric_limits<VType>::has_infinity) { - min_ = std::numeric_limits<VType>::infinity(); - max_ = -std::numeric_limits<VType>::infinity(); - } else { - min_ = std::numeric_limits<VType>::max(); - max_ = std::numeric_limits<VType>::min(); - } - } - - Self &operator=(const Self &stat) { - this->Stat1<VType, NumType>::operator=(stat); - max_ = stat.max_; - min_ = stat.min_; - return (*this); - } - // Merge statistics from two sample sets. - Self &operator+=(const Self &stat) { - this->Stat1<VType, NumType>::operator+=(stat); - if (stat.max_ > max_) max_ = stat.max_; - if (stat.min_ < min_) min_ = stat.min_; - return (*this); - } - // Multiply the weight of the set of samples by a factor k - Self &operator*=(const VType &stat) { - this->Stat1<VType, NumType>::operator*=(stat); - return (*this); - } - // Merge statistics from two sample sets. - Self operator+(const Self &stat) const { return Self(*this) += stat; } - // Multiply the weight of the set of samples by a factor k - Self operator*(const VType &k) const { return Self(*this) *= k; } - - // Return the maximal value in this sample set - VType Max() const { return max_; } - // Return the minimal value in this sample set - VType Min() const { return min_; } - - private: - // The - operation makes no sense with Min/Max - // unless we keep the full list of values (but we don't) - // make it private, and let it undefined so nobody can call it - Self &operator-=(const Self &stat); // senseless. let it undefined. - - // The operation opposite to - - Self operator-(const Self &stat) const; // senseless. let it undefined. - - // Let i be the index of the samples provided (using +=) - // and weight[i],value[i] be the data of sample #i - // then the variables have the following meaning: - VType max_; // max of value[i] - VType min_; // min of value[i] -}; - -// Useful printing function -template <typename VType, typename NumType> -std::ostream &operator<<(std::ostream &out, - const Stat1MinMax<VType, NumType> &s) { - out << "{ avg = " << s.Mean() << " std = " << s.StdDev() - << " nsamples = " << s.NumSamples() << " min = " << s.Min() - << " max = " << s.Max() << "}"; - return out; -} -} // end namespace benchmark - -#endif // BENCHMARK_STAT_H_ diff --git a/utils/google-benchmark/src/statistics.cc b/utils/google-benchmark/src/statistics.cc new file mode 100644 index 0000000000000..612dda2d1a71c --- /dev/null +++ b/utils/google-benchmark/src/statistics.cc @@ -0,0 +1,177 @@ +// Copyright 2016 Ismael Jimenez Martinez. All rights reserved. +// Copyright 2017 Roman Lebedev. 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" + +#include <algorithm> +#include <cmath> +#include <numeric> +#include <string> +#include <vector> +#include "check.h" +#include "statistics.h" + +namespace benchmark { + +auto StatisticsSum = [](const std::vector<double>& v) { + return std::accumulate(v.begin(), v.end(), 0.0); +}; + +double StatisticsMean(const std::vector<double>& v) { + if (v.empty()) return 0.0; + return StatisticsSum(v) * (1.0 / v.size()); +} + +double StatisticsMedian(const std::vector<double>& v) { + if (v.size() < 3) return StatisticsMean(v); + std::vector<double> copy(v); + + auto center = copy.begin() + v.size() / 2; + std::nth_element(copy.begin(), center, copy.end()); + + // did we have an odd number of samples? + // if yes, then center is the median + // it no, then we are looking for the average between center and the value + // before + if (v.size() % 2 == 1) return *center; + auto center2 = copy.begin() + v.size() / 2 - 1; + std::nth_element(copy.begin(), center2, copy.end()); + return (*center + *center2) / 2.0; +} + +// Return the sum of the squares of this sample set +auto SumSquares = [](const std::vector<double>& v) { + return std::inner_product(v.begin(), v.end(), v.begin(), 0.0); +}; + +auto Sqr = [](const double dat) { return dat * dat; }; +auto Sqrt = [](const double dat) { + // Avoid NaN due to imprecision in the calculations + if (dat < 0.0) return 0.0; + return std::sqrt(dat); +}; + +double StatisticsStdDev(const std::vector<double>& v) { + const auto mean = StatisticsMean(v); + if (v.empty()) return mean; + + // Sample standard deviation is undefined for n = 1 + if (v.size() == 1) return 0.0; + + const double avg_squares = SumSquares(v) * (1.0 / v.size()); + return Sqrt(v.size() / (v.size() - 1.0) * (avg_squares - Sqr(mean))); +} + +std::vector<BenchmarkReporter::Run> ComputeStats( + const std::vector<BenchmarkReporter::Run>& reports) { + typedef BenchmarkReporter::Run Run; + std::vector<Run> results; + + auto error_count = + std::count_if(reports.begin(), reports.end(), + [](Run const& run) { return run.error_occurred; }); + + if (reports.size() - error_count < 2) { + // We don't report aggregated data if there was a single run. + return results; + } + + // Accumulators. + std::vector<double> real_accumulated_time_stat; + std::vector<double> cpu_accumulated_time_stat; + std::vector<double> bytes_per_second_stat; + std::vector<double> items_per_second_stat; + + real_accumulated_time_stat.reserve(reports.size()); + cpu_accumulated_time_stat.reserve(reports.size()); + bytes_per_second_stat.reserve(reports.size()); + items_per_second_stat.reserve(reports.size()); + + // 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; + // create stats for user counters + struct CounterStat { + Counter c; + std::vector<double> s; + }; + std::map<std::string, CounterStat> counter_stats; + for (Run const& r : reports) { + for (auto const& cnt : r.counters) { + auto it = counter_stats.find(cnt.first); + if (it == counter_stats.end()) { + counter_stats.insert({cnt.first, {cnt.second, std::vector<double>{}}}); + it = counter_stats.find(cnt.first); + it->second.s.reserve(reports.size()); + } else { + CHECK_EQ(counter_stats[cnt.first].c.flags, cnt.second.flags); + } + } + } + + // Populate the accumulators. + for (Run const& run : reports) { + CHECK_EQ(reports[0].benchmark_name, run.benchmark_name); + CHECK_EQ(run_iterations, run.iterations); + if (run.error_occurred) continue; + real_accumulated_time_stat.emplace_back(run.real_accumulated_time); + cpu_accumulated_time_stat.emplace_back(run.cpu_accumulated_time); + items_per_second_stat.emplace_back(run.items_per_second); + bytes_per_second_stat.emplace_back(run.bytes_per_second); + // user counters + for (auto const& cnt : run.counters) { + auto it = counter_stats.find(cnt.first); + CHECK_NE(it, counter_stats.end()); + it->second.s.emplace_back(cnt.second); + } + } + + // Only add label if it is same for all runs + std::string report_label = reports[0].report_label; + for (std::size_t i = 1; i < reports.size(); i++) { + if (reports[i].report_label != report_label) { + report_label = ""; + break; + } + } + + for (const auto& Stat : *reports[0].statistics) { + // Get the data from the accumulator to BenchmarkReporter::Run's. + Run data; + data.benchmark_name = reports[0].benchmark_name + "_" + Stat.name_; + data.report_label = report_label; + data.iterations = run_iterations; + + data.real_accumulated_time = Stat.compute_(real_accumulated_time_stat); + data.cpu_accumulated_time = Stat.compute_(cpu_accumulated_time_stat); + data.bytes_per_second = Stat.compute_(bytes_per_second_stat); + data.items_per_second = Stat.compute_(items_per_second_stat); + + data.time_unit = reports[0].time_unit; + + // user counters + for (auto const& kv : counter_stats) { + const auto uc_stat = Stat.compute_(kv.second.s); + auto c = Counter(uc_stat, counter_stats[kv.first].c.flags); + data.counters[kv.first] = c; + } + + results.push_back(data); + } + + return results; +} + +} // end namespace benchmark diff --git a/utils/google-benchmark/src/statistics.h b/utils/google-benchmark/src/statistics.h new file mode 100644 index 0000000000000..7eccc85536a5f --- /dev/null +++ b/utils/google-benchmark/src/statistics.h @@ -0,0 +1,37 @@ +// Copyright 2016 Ismael Jimenez Martinez. All rights reserved. +// Copyright 2017 Roman Lebedev. 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 STATISTICS_H_ +#define STATISTICS_H_ + +#include <vector> + +#include "benchmark/benchmark.h" + +namespace benchmark { + +// Return a vector containing the mean, median and standard devation information +// (and any user-specified info) for the specified list of reports. If 'reports' +// contains less than two non-errored runs an empty vector is returned +std::vector<BenchmarkReporter::Run> ComputeStats( + const std::vector<BenchmarkReporter::Run>& reports); + +double StatisticsMean(const std::vector<double>& v); +double StatisticsMedian(const std::vector<double>& v); +double StatisticsStdDev(const std::vector<double>& v); + +} // end namespace benchmark + +#endif // STATISTICS_H_ diff --git a/utils/google-benchmark/src/string_util.cc b/utils/google-benchmark/src/string_util.cc index cd4e7cfde57c1..05ac5b4ea367e 100644 --- a/utils/google-benchmark/src/string_util.cc +++ b/utils/google-benchmark/src/string_util.cc @@ -27,8 +27,6 @@ static_assert(arraysize(kSmallSIUnits) == arraysize(kBigSIUnits), static const int64_t kUnitsSize = arraysize(kBigSIUnits); -} // end anonymous namespace - void ToExponentAndMantissa(double val, double thresh, int precision, double one_k, std::string* mantissa, int64_t* exponent) { @@ -100,14 +98,16 @@ std::string ExponentToPrefix(int64_t exponent, bool iec) { } std::string ToBinaryStringFullySpecified(double value, double threshold, - int precision) { + int precision, double one_k = 1024.0) { std::string mantissa; int64_t exponent; - ToExponentAndMantissa(value, threshold, precision, 1024.0, &mantissa, + ToExponentAndMantissa(value, threshold, precision, one_k, &mantissa, &exponent); return mantissa + ExponentToPrefix(exponent, false); } +} // end namespace + void AppendHumanReadable(int n, std::string* str) { std::stringstream ss; // Round down to the nearest SI prefix. @@ -115,14 +115,14 @@ void AppendHumanReadable(int n, std::string* str) { *str += ss.str(); } -std::string HumanReadableNumber(double n) { +std::string HumanReadableNumber(double n, double one_k) { // 1.1 means that figures up to 1.1k should be shown with the next unit down; // this softens edge effects. // 1 means that we should show one decimal place of precision. - return ToBinaryStringFullySpecified(n, 1.1, 1); + return ToBinaryStringFullySpecified(n, 1.1, 1, one_k); } -std::string StringPrintFImp(const char* msg, va_list args) { +std::string StrFormatImp(const char* msg, va_list args) { // we might need a second shot at this, so pre-emptivly make a copy va_list args_cp; va_copy(args_cp, args); @@ -152,10 +152,10 @@ std::string StringPrintFImp(const char* msg, va_list args) { return std::string(buff_ptr.get()); } -std::string StringPrintF(const char* format, ...) { +std::string StrFormat(const char* format, ...) { va_list args; va_start(args, format); - std::string tmp = StringPrintFImp(format, args); + std::string tmp = StrFormatImp(format, args); va_end(args); return tmp; } @@ -169,4 +169,93 @@ void ReplaceAll(std::string* str, const std::string& from, } } +#ifdef BENCHMARK_STL_ANDROID_GNUSTL +/* + * GNU STL in Android NDK lacks support for some C++11 functions, including + * stoul, stoi, stod. We reimplement them here using C functions strtoul, + * strtol, strtod. Note that reimplemented functions are in benchmark:: + * namespace, not std:: namespace. + */ +unsigned long stoul(const std::string& str, size_t* pos, int base) { + /* Record previous errno */ + const int oldErrno = errno; + errno = 0; + + const char* strStart = str.c_str(); + char* strEnd = const_cast<char*>(strStart); + const unsigned long result = strtoul(strStart, &strEnd, base); + + const int strtoulErrno = errno; + /* Restore previous errno */ + errno = oldErrno; + + /* Check for errors and return */ + if (strtoulErrno == ERANGE) { + throw std::out_of_range( + "stoul failed: " + str + " is outside of range of unsigned long"); + } else if (strEnd == strStart || strtoulErrno != 0) { + throw std::invalid_argument( + "stoul failed: " + str + " is not an integer"); + } + if (pos != nullptr) { + *pos = static_cast<size_t>(strEnd - strStart); + } + return result; +} + +int stoi(const std::string& str, size_t* pos, int base) { + /* Record previous errno */ + const int oldErrno = errno; + errno = 0; + + const char* strStart = str.c_str(); + char* strEnd = const_cast<char*>(strStart); + const long result = strtol(strStart, &strEnd, base); + + const int strtolErrno = errno; + /* Restore previous errno */ + errno = oldErrno; + + /* Check for errors and return */ + if (strtolErrno == ERANGE || long(int(result)) != result) { + throw std::out_of_range( + "stoul failed: " + str + " is outside of range of int"); + } else if (strEnd == strStart || strtolErrno != 0) { + throw std::invalid_argument( + "stoul failed: " + str + " is not an integer"); + } + if (pos != nullptr) { + *pos = static_cast<size_t>(strEnd - strStart); + } + return int(result); +} + +double stod(const std::string& str, size_t* pos) { + /* Record previous errno */ + const int oldErrno = errno; + errno = 0; + + const char* strStart = str.c_str(); + char* strEnd = const_cast<char*>(strStart); + const double result = strtod(strStart, &strEnd); + + /* Restore previous errno */ + const int strtodErrno = errno; + errno = oldErrno; + + /* Check for errors and return */ + if (strtodErrno == ERANGE) { + throw std::out_of_range( + "stoul failed: " + str + " is outside of range of int"); + } else if (strEnd == strStart || strtodErrno != 0) { + throw std::invalid_argument( + "stoul failed: " + str + " is not an integer"); + } + if (pos != nullptr) { + *pos = static_cast<size_t>(strEnd - strStart); + } + return result; +} +#endif + } // end namespace benchmark diff --git a/utils/google-benchmark/src/string_util.h b/utils/google-benchmark/src/string_util.h index 0b190b91a16e9..4a5501273cf13 100644 --- a/utils/google-benchmark/src/string_util.h +++ b/utils/google-benchmark/src/string_util.h @@ -10,31 +10,47 @@ namespace benchmark { void AppendHumanReadable(int n, std::string* str); -std::string HumanReadableNumber(double n); +std::string HumanReadableNumber(double n, double one_k = 1024.0); -std::string StringPrintF(const char* format, ...); +std::string StrFormat(const char* format, ...); -inline std::ostream& StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT { +inline std::ostream& StrCatImp(std::ostream& out) BENCHMARK_NOEXCEPT { return out; } template <class First, class... Rest> -inline std::ostream& StringCatImp(std::ostream& out, First&& f, - Rest&&... rest) { +inline std::ostream& StrCatImp(std::ostream& out, First&& f, Rest&&... rest) { out << std::forward<First>(f); - return StringCatImp(out, std::forward<Rest>(rest)...); + return StrCatImp(out, std::forward<Rest>(rest)...); } template <class... Args> inline std::string StrCat(Args&&... args) { std::ostringstream ss; - StringCatImp(ss, std::forward<Args>(args)...); + StrCatImp(ss, std::forward<Args>(args)...); return ss.str(); } void ReplaceAll(std::string* str, const std::string& from, const std::string& to); +#ifdef BENCHMARK_STL_ANDROID_GNUSTL +/* + * GNU STL in Android NDK lacks support for some C++11 functions, including + * stoul, stoi, stod. We reimplement them here using C functions strtoul, + * strtol, strtod. Note that reimplemented functions are in benchmark:: + * namespace, not std:: namespace. + */ +unsigned long stoul(const std::string& str, size_t* pos = nullptr, + int base = 10); +int stoi(const std::string& str, size_t* pos = nullptr, int base = 10); +double stod(const std::string& str, size_t* pos = nullptr); +#else +using std::stoul; +using std::stoi; +using std::stod; +#endif + } // end namespace benchmark #endif // BENCHMARK_STRING_UTIL_H_ diff --git a/utils/google-benchmark/src/sysinfo.cc b/utils/google-benchmark/src/sysinfo.cc index 7feb79e65f208..73064b97ba220 100644 --- a/utils/google-benchmark/src/sysinfo.cc +++ b/utils/google-benchmark/src/sysinfo.cc @@ -12,34 +12,47 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "sysinfo.h" #include "internal_macros.h" #ifdef BENCHMARK_OS_WINDOWS #include <Shlwapi.h> +#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA #include <VersionHelpers.h> #include <Windows.h> #else #include <fcntl.h> +#ifndef BENCHMARK_OS_FUCHSIA #include <sys/resource.h> +#endif #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_MACOSX || \ + defined BENCHMARK_OS_NETBSD || defined BENCHMARK_OS_OPENBSD +#define BENCHMARK_HAS_SYSCTL #include <sys/sysctl.h> #endif #endif +#if defined(BENCHMARK_OS_SOLARIS) +#include <kstat.h> +#endif +#include <algorithm> +#include <array> +#include <bitset> #include <cerrno> +#include <climits> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> +#include <fstream> #include <iostream> +#include <iterator> #include <limits> -#include <mutex> +#include <memory> +#include <sstream> -#include "arraysize.h" #include "check.h" #include "cycleclock.h" #include "internal_macros.h" @@ -49,214 +62,466 @@ namespace benchmark { namespace { -std::once_flag cpuinfo_init; -double cpuinfo_cycles_per_second = 1.0; -int cpuinfo_num_cpus = 1; // Conservative guess -#if !defined BENCHMARK_OS_MACOSX -const int64_t estimate_time_ms = 1000; +void PrintImp(std::ostream& out) { out << std::endl; } -// Helper function estimates cycles/sec by observing cycles elapsed during -// sleep(). Using small sleep time decreases accuracy significantly. -int64_t EstimateCyclesPerSecond() { - const int64_t start_ticks = cycleclock::Now(); - SleepForMilliseconds(estimate_time_ms); - return cycleclock::Now() - start_ticks; +template <class First, class... Rest> +void PrintImp(std::ostream& out, First&& f, Rest&&... rest) { + out << std::forward<First>(f); + PrintImp(out, std::forward<Rest>(rest)...); } -#endif -#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN -// Helper function for reading an int from a file. Returns true if successful -// and the memory location pointed to by value is set to the value read. -bool ReadIntFromFile(const char* file, long* value) { - bool ret = false; - int fd = open(file, O_RDONLY); - if (fd != -1) { - char line[1024]; - char* err; - memset(line, '\0', sizeof(line)); - ssize_t read_err = read(fd, line, sizeof(line) - 1); - ((void)read_err); // prevent unused warning - CHECK(read_err >= 0); - const long temp_value = strtol(line, &err, 10); - if (line[0] != '\0' && (*err == '\n' || *err == '\0')) { - *value = temp_value; - ret = true; +template <class... Args> +BENCHMARK_NORETURN void PrintErrorAndDie(Args&&... args) { + PrintImp(std::cerr, std::forward<Args>(args)...); + std::exit(EXIT_FAILURE); +} + +#ifdef BENCHMARK_HAS_SYSCTL + +/// ValueUnion - A type used to correctly alias the byte-for-byte output of +/// `sysctl` with the result type it's to be interpreted as. +struct ValueUnion { + union DataT { + uint32_t uint32_value; + uint64_t uint64_value; + // For correct aliasing of union members from bytes. + char bytes[8]; + }; + using DataPtr = std::unique_ptr<DataT, decltype(&std::free)>; + + // The size of the data union member + its trailing array size. + size_t Size; + DataPtr Buff; + + public: + ValueUnion() : Size(0), Buff(nullptr, &std::free) {} + + explicit ValueUnion(size_t BuffSize) + : Size(sizeof(DataT) + BuffSize), + Buff(::new (std::malloc(Size)) DataT(), &std::free) {} + + ValueUnion(ValueUnion&& other) = default; + + explicit operator bool() const { return bool(Buff); } + + char* data() const { return Buff->bytes; } + + std::string GetAsString() const { return std::string(data()); } + + int64_t GetAsInteger() const { + if (Size == sizeof(Buff->uint32_value)) + return static_cast<int32_t>(Buff->uint32_value); + else if (Size == sizeof(Buff->uint64_value)) + return static_cast<int64_t>(Buff->uint64_value); + BENCHMARK_UNREACHABLE(); + } + + uint64_t GetAsUnsigned() const { + if (Size == sizeof(Buff->uint32_value)) + return Buff->uint32_value; + else if (Size == sizeof(Buff->uint64_value)) + return Buff->uint64_value; + BENCHMARK_UNREACHABLE(); + } + + template <class T, int N> + std::array<T, N> GetAsArray() { + const int ArrSize = sizeof(T) * N; + CHECK_LE(ArrSize, Size); + std::array<T, N> Arr; + std::memcpy(Arr.data(), data(), ArrSize); + return Arr; + } +}; + +ValueUnion GetSysctlImp(std::string const& Name) { +#if defined BENCHMARK_OS_OPENBSD + int mib[2]; + + mib[0] = CTL_HW; + if ((Name == "hw.ncpu") || (Name == "hw.cpuspeed")){ + ValueUnion buff(sizeof(int)); + + if (Name == "hw.ncpu") { + mib[1] = HW_NCPU; + } else { + mib[1] = HW_CPUSPEED; + } + + if (sysctl(mib, 2, buff.data(), &buff.Size, nullptr, 0) == -1) { + return ValueUnion(); } - close(fd); + return buff; } - return ret; + return ValueUnion(); +#else + size_t CurBuffSize = 0; + if (sysctlbyname(Name.c_str(), nullptr, &CurBuffSize, nullptr, 0) == -1) + return ValueUnion(); + + ValueUnion buff(CurBuffSize); + if (sysctlbyname(Name.c_str(), buff.data(), &buff.Size, nullptr, 0) == 0) + return buff; + return ValueUnion(); +#endif +} + +BENCHMARK_MAYBE_UNUSED +bool GetSysctl(std::string const& Name, std::string* Out) { + Out->clear(); + auto Buff = GetSysctlImp(Name); + if (!Buff) return false; + Out->assign(Buff.data()); + return true; +} + +template <class Tp, + class = typename std::enable_if<std::is_integral<Tp>::value>::type> +bool GetSysctl(std::string const& Name, Tp* Out) { + *Out = 0; + auto Buff = GetSysctlImp(Name); + if (!Buff) return false; + *Out = static_cast<Tp>(Buff.GetAsUnsigned()); + return true; +} + +template <class Tp, size_t N> +bool GetSysctl(std::string const& Name, std::array<Tp, N>* Out) { + auto Buff = GetSysctlImp(Name); + if (!Buff) return false; + *Out = Buff.GetAsArray<Tp, N>(); + return true; } #endif -#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN -static std::string convertToLowerCase(std::string s) { - for (auto& ch : s) - ch = std::tolower(ch); - return s; +template <class ArgT> +bool ReadFromFile(std::string const& fname, ArgT* arg) { + *arg = ArgT(); + std::ifstream f(fname.c_str()); + if (!f.is_open()) return false; + f >> *arg; + return f.good(); +} + +bool CpuScalingEnabled(int num_cpus) { + // We don't have a valid CPU count, so don't even bother. + if (num_cpus <= 0) return false; +#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 + // running on Linux, so we silently ignore all the read errors. + std::string res; + 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; + } +#endif + return false; } -static bool startsWithKey(std::string Value, std::string Key, - bool IgnoreCase = true) { - if (IgnoreCase) { - Key = convertToLowerCase(std::move(Key)); - Value = convertToLowerCase(std::move(Value)); + +int CountSetBitsInCPUMap(std::string Val) { + auto CountBits = [](std::string Part) { + using CPUMask = std::bitset<sizeof(std::uintptr_t) * CHAR_BIT>; + Part = "0x" + Part; + CPUMask Mask(benchmark::stoul(Part, nullptr, 16)); + return static_cast<int>(Mask.count()); + }; + size_t Pos; + int total = 0; + while ((Pos = Val.find(',')) != std::string::npos) { + total += CountBits(Val.substr(0, Pos)); + Val = Val.substr(Pos + 1); + } + if (!Val.empty()) { + total += CountBits(Val); + } + return total; +} + +BENCHMARK_MAYBE_UNUSED +std::vector<CPUInfo::CacheInfo> GetCacheSizesFromKVFS() { + std::vector<CPUInfo::CacheInfo> res; + std::string dir = "/sys/devices/system/cpu/cpu0/cache/"; + int Idx = 0; + while (true) { + CPUInfo::CacheInfo info; + std::string FPath = StrCat(dir, "index", Idx++, "/"); + std::ifstream f(StrCat(FPath, "size").c_str()); + if (!f.is_open()) break; + std::string suffix; + f >> info.size; + if (f.fail()) + PrintErrorAndDie("Failed while reading file '", FPath, "size'"); + if (f.good()) { + f >> suffix; + if (f.bad()) + PrintErrorAndDie( + "Invalid cache size format: failed to read size suffix"); + else if (f && suffix != "K") + PrintErrorAndDie("Invalid cache size format: Expected bytes ", suffix); + else if (suffix == "K") + info.size *= 1000; + } + if (!ReadFromFile(StrCat(FPath, "type"), &info.type)) + PrintErrorAndDie("Failed to read from file ", FPath, "type"); + if (!ReadFromFile(StrCat(FPath, "level"), &info.level)) + PrintErrorAndDie("Failed to read from file ", FPath, "level"); + std::string map_str; + if (!ReadFromFile(StrCat(FPath, "shared_cpu_map"), &map_str)) + PrintErrorAndDie("Failed to read from file ", FPath, "shared_cpu_map"); + info.num_sharing = CountSetBitsInCPUMap(map_str); + res.push_back(info); + } + + return res; +} + +#ifdef BENCHMARK_OS_MACOSX +std::vector<CPUInfo::CacheInfo> GetCacheSizesMacOSX() { + std::vector<CPUInfo::CacheInfo> res; + std::array<uint64_t, 4> CacheCounts{{0, 0, 0, 0}}; + GetSysctl("hw.cacheconfig", &CacheCounts); + + struct { + std::string name; + std::string type; + int level; + size_t num_sharing; + } Cases[] = {{"hw.l1dcachesize", "Data", 1, CacheCounts[1]}, + {"hw.l1icachesize", "Instruction", 1, CacheCounts[1]}, + {"hw.l2cachesize", "Unified", 2, CacheCounts[2]}, + {"hw.l3cachesize", "Unified", 3, CacheCounts[3]}}; + for (auto& C : Cases) { + int val; + if (!GetSysctl(C.name, &val)) continue; + CPUInfo::CacheInfo info; + info.type = C.type; + info.level = C.level; + info.size = val; + info.num_sharing = static_cast<int>(C.num_sharing); + res.push_back(std::move(info)); + } + return res; +} +#elif defined(BENCHMARK_OS_WINDOWS) +std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() { + std::vector<CPUInfo::CacheInfo> res; + DWORD buffer_size = 0; + using PInfo = SYSTEM_LOGICAL_PROCESSOR_INFORMATION; + using CInfo = CACHE_DESCRIPTOR; + + using UPtr = std::unique_ptr<PInfo, decltype(&std::free)>; + GetLogicalProcessorInformation(nullptr, &buffer_size); + UPtr buff((PInfo*)malloc(buffer_size), &std::free); + if (!GetLogicalProcessorInformation(buff.get(), &buffer_size)) + PrintErrorAndDie("Failed during call to GetLogicalProcessorInformation: ", + GetLastError()); + + PInfo* it = buff.get(); + PInfo* end = buff.get() + (buffer_size / sizeof(PInfo)); + + for (; it != end; ++it) { + if (it->Relationship != RelationCache) continue; + using BitSet = std::bitset<sizeof(ULONG_PTR) * CHAR_BIT>; + BitSet B(it->ProcessorMask); + // To prevent duplicates, only consider caches where CPU 0 is specified + if (!B.test(0)) continue; + CInfo* Cache = &it->Cache; + CPUInfo::CacheInfo C; + C.num_sharing = static_cast<int>(B.count()); + C.level = Cache->Level; + C.size = Cache->Size; + switch (Cache->Type) { + case CacheUnified: + C.type = "Unified"; + break; + case CacheInstruction: + C.type = "Instruction"; + break; + case CacheData: + C.type = "Data"; + break; + case CacheTrace: + C.type = "Trace"; + break; + default: + C.type = "Unknown"; + break; + } + res.push_back(C); } - return Value.compare(0, Key.size(), Key) == 0; + return res; +} +#endif + +std::vector<CPUInfo::CacheInfo> GetCacheSizes() { +#ifdef BENCHMARK_OS_MACOSX + return GetCacheSizesMacOSX(); +#elif defined(BENCHMARK_OS_WINDOWS) + return GetCacheSizesWindows(); +#else + return GetCacheSizesFromKVFS(); +#endif } + +int GetNumCPUs() { +#ifdef BENCHMARK_HAS_SYSCTL + int NumCPU = -1; + if (GetSysctl("hw.ncpu", &NumCPU)) return NumCPU; + fprintf(stderr, "Err: %s\n", strerror(errno)); + std::exit(EXIT_FAILURE); +#elif defined(BENCHMARK_OS_WINDOWS) + SYSTEM_INFO sysinfo; + // Use memset as opposed to = {} to avoid GCC missing initializer false + // positives. + std::memset(&sysinfo, 0, sizeof(SYSTEM_INFO)); + GetSystemInfo(&sysinfo); + return sysinfo.dwNumberOfProcessors; // number of logical + // processors in the current + // group +#elif defined(BENCHMARK_OS_SOLARIS) + // Returns -1 in case of a failure. + int NumCPU = sysconf(_SC_NPROCESSORS_ONLN); + if (NumCPU < 0) { + fprintf(stderr, + "sysconf(_SC_NPROCESSORS_ONLN) failed with error: %s\n", + strerror(errno)); + } + return NumCPU; +#else + int NumCPUs = 0; + int MaxID = -1; + std::ifstream f("/proc/cpuinfo"); + if (!f.is_open()) { + std::cerr << "failed to open /proc/cpuinfo\n"; + return -1; + } + const std::string Key = "processor"; + std::string ln; + while (std::getline(f, ln)) { + if (ln.empty()) continue; + size_t SplitIdx = ln.find(':'); + std::string value; + if (SplitIdx != std::string::npos) value = ln.substr(SplitIdx + 1); + if (ln.size() >= Key.size() && ln.compare(0, Key.size(), Key) == 0) { + NumCPUs++; + if (!value.empty()) { + int CurID = benchmark::stoi(value); + MaxID = std::max(CurID, MaxID); + } + } + } + if (f.bad()) { + std::cerr << "Failure reading /proc/cpuinfo\n"; + return -1; + } + if (!f.eof()) { + std::cerr << "Failed to read to end of /proc/cpuinfo\n"; + return -1; + } + f.close(); + + if ((MaxID + 1) != NumCPUs) { + fprintf(stderr, + "CPU ID assignments in /proc/cpuinfo seem messed up." + " This is usually caused by a bad BIOS.\n"); + } + return NumCPUs; #endif + BENCHMARK_UNREACHABLE(); +} -void InitializeSystemInfo() { +double GetCPUCyclesPerSecond() { #if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN - char line[1024]; - char* err; long freq; - bool saw_mhz = false; - // If the kernel is exporting the tsc frequency use that. There are issues // where cpuinfo_max_freq cannot be relied on because the BIOS may be // exporintg an invalid p-state (on x86) or p-states may be used to put the // processor in a new mode (turbo mode). Essentially, those frequencies // cannot always be relied upon. The same reasons apply to /proc/cpuinfo as // well. - if (!saw_mhz && - ReadIntFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) { + 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. + || 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 // 2GHz warpstation, the file contains the value "2000000". - cpuinfo_cycles_per_second = freq * 1000.0; - saw_mhz = true; + return freq * 1000.0; } - // 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 (!saw_mhz && - ReadIntFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", - &freq)) { - // The value is in kHz. For example, on a 2GHz warpstation, the file - // contains the value "2000000". - cpuinfo_cycles_per_second = freq * 1000.0; - saw_mhz = true; - } + const double error_value = -1; + double bogo_clock = error_value; - // Read /proc/cpuinfo for other values, and if there is no cpuinfo_max_freq. - const char* pname = "/proc/cpuinfo"; - int fd = open(pname, O_RDONLY); - if (fd == -1) { - perror(pname); - if (!saw_mhz) { - cpuinfo_cycles_per_second = - static_cast<double>(EstimateCyclesPerSecond()); - } - return; + std::ifstream f("/proc/cpuinfo"); + if (!f.is_open()) { + std::cerr << "failed to open /proc/cpuinfo\n"; + return error_value; } - double bogo_clock = 1.0; - bool saw_bogo = false; - long max_cpu_id = 0; - int num_cpus = 0; - line[0] = line[1] = '\0'; - size_t chars_read = 0; - do { // we'll exit when the last read didn't read anything - // Move the next line to the beginning of the buffer - const size_t oldlinelen = strlen(line); - if (sizeof(line) == oldlinelen + 1) // oldlinelen took up entire line - line[0] = '\0'; - else // still other lines left to save - memmove(line, line + oldlinelen + 1, sizeof(line) - (oldlinelen + 1)); - // Terminate the new line, reading more if we can't find the newline - char* newline = strchr(line, '\n'); - if (newline == nullptr) { - const size_t linelen = strlen(line); - const size_t bytes_to_read = sizeof(line) - 1 - linelen; - CHECK(bytes_to_read > 0); // because the memmove recovered >=1 bytes - chars_read = read(fd, line + linelen, bytes_to_read); - line[linelen + chars_read] = '\0'; - newline = strchr(line, '\n'); - } - if (newline != nullptr) *newline = '\0'; + auto startsWithKey = [](std::string const& Value, std::string const& Key) { + if (Key.size() > Value.size()) return false; + auto Cmp = [&](char X, char Y) { + return std::tolower(X) == std::tolower(Y); + }; + return std::equal(Key.begin(), Key.end(), Value.begin(), Cmp); + }; + std::string ln; + while (std::getline(f, ln)) { + if (ln.empty()) continue; + size_t SplitIdx = ln.find(':'); + std::string value; + if (SplitIdx != std::string::npos) value = ln.substr(SplitIdx + 1); // When parsing the "cpu MHz" and "bogomips" (fallback) entries, we only - // accept postive values. Some environments (virtual machines) report zero, + // accept positive values. Some environments (virtual machines) report zero, // which would cause infinite looping in WallTime_Init. - if (!saw_mhz && startsWithKey(line, "cpu MHz")) { - const char* freqstr = strchr(line, ':'); - if (freqstr) { - cpuinfo_cycles_per_second = strtod(freqstr + 1, &err) * 1000000.0; - if (freqstr[1] != '\0' && *err == '\0' && cpuinfo_cycles_per_second > 0) - saw_mhz = true; + if (startsWithKey(ln, "cpu MHz")) { + if (!value.empty()) { + double cycles_per_second = benchmark::stod(value) * 1000000.0; + if (cycles_per_second > 0) return cycles_per_second; } - } else if (startsWithKey(line, "bogomips")) { - const char* freqstr = strchr(line, ':'); - if (freqstr) { - bogo_clock = strtod(freqstr + 1, &err) * 1000000.0; - if (freqstr[1] != '\0' && *err == '\0' && bogo_clock > 0) - saw_bogo = true; - } - } else if (startsWithKey(line, "processor", /*IgnoreCase*/false)) { - // The above comparison is case-sensitive because ARM kernels often - // include a "Processor" line that tells you about the CPU, distinct - // from the usual "processor" lines that give you CPU ids. No current - // Linux architecture is using "Processor" for CPU ids. - num_cpus++; // count up every time we see an "processor :" entry - const char* id_str = strchr(line, ':'); - if (id_str) { - const long cpu_id = strtol(id_str + 1, &err, 10); - if (id_str[1] != '\0' && *err == '\0' && max_cpu_id < cpu_id) - max_cpu_id = cpu_id; + } else if (startsWithKey(ln, "bogomips")) { + if (!value.empty()) { + bogo_clock = benchmark::stod(value) * 1000000.0; + if (bogo_clock < 0.0) bogo_clock = error_value; } } - } while (chars_read > 0); - close(fd); - - if (!saw_mhz) { - if (saw_bogo) { - // If we didn't find anything better, we'll use bogomips, but - // we're not happy about it. - cpuinfo_cycles_per_second = bogo_clock; - } else { - // If we don't even have bogomips, we'll use the slow estimation. - cpuinfo_cycles_per_second = - static_cast<double>(EstimateCyclesPerSecond()); - } } - if (num_cpus == 0) { - fprintf(stderr, "Failed to read num. CPUs correctly from /proc/cpuinfo\n"); - } else { - if ((max_cpu_id + 1) != num_cpus) { - fprintf(stderr, - "CPU ID assignments in /proc/cpuinfo seem messed up." - " This is usually caused by a bad BIOS.\n"); - } - cpuinfo_num_cpus = num_cpus; + if (f.bad()) { + std::cerr << "Failure reading /proc/cpuinfo\n"; + return error_value; } + if (!f.eof()) { + std::cerr << "Failed to read to end of /proc/cpuinfo\n"; + return error_value; + } + f.close(); + // If we found the bogomips clock, but nothing better, we'll use it (but + // we're not happy about it); otherwise, fallback to the rough estimation + // below. + if (bogo_clock >= 0.0) return bogo_clock; -#elif defined BENCHMARK_OS_FREEBSD -// For this sysctl to work, the machine must be configured without -// SMP, APIC, or APM support. hz should be 64-bit in freebsd 7.0 -// and later. Before that, it's a 32-bit quantity (and gives the -// wrong answer on machines faster than 2^32 Hz). See -// http://lists.freebsd.org/pipermail/freebsd-i386/2004-November/001846.html -// But also compare FreeBSD 7.0: -// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG70#L223 -// 231 error = sysctl_handle_quad(oidp, &freq, 0, req); -// To FreeBSD 6.3 (it's the same in 6-STABLE): -// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG6#L131 -// 139 error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); -#if __FreeBSD__ >= 7 - uint64_t hz = 0; +#elif defined BENCHMARK_HAS_SYSCTL + constexpr auto* FreqStr = +#if defined(BENCHMARK_OS_FREEBSD) || defined(BENCHMARK_OS_NETBSD) + "machdep.tsc_freq"; +#elif defined BENCHMARK_OS_OPENBSD + "hw.cpuspeed"; #else - unsigned int hz = 0; + "hw.cpufrequency"; #endif - size_t sz = sizeof(hz); - const char* sysctl_path = "machdep.tsc_freq"; - if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) { - fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n", - sysctl_path, strerror(errno)); - cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); - } else { - cpuinfo_cycles_per_second = hz; - } -// TODO: also figure out cpuinfo_num_cpus + unsigned long long hz = 0; +#if defined BENCHMARK_OS_OPENBSD + if (GetSysctl(FreqStr, &hz)) return hz * 1000000; +#else + if (GetSysctl(FreqStr, &hz)) return hz; +#endif + fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n", + FreqStr, strerror(errno)); #elif defined BENCHMARK_OS_WINDOWS // In NT, read MHz from the registry. If we fail to do so or we're in win9x @@ -267,89 +532,56 @@ void InitializeSystemInfo() { SHGetValueA(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "~MHz", nullptr, &data, &data_size))) - cpuinfo_cycles_per_second = - static_cast<double>((int64_t)data * (int64_t)(1000 * 1000)); // was mhz - else - cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); - - SYSTEM_INFO sysinfo; - // Use memset as opposed to = {} to avoid GCC missing initializer false - // positives. - std::memset(&sysinfo, 0, sizeof(SYSTEM_INFO)); - GetSystemInfo(&sysinfo); - cpuinfo_num_cpus = sysinfo.dwNumberOfProcessors; // number of logical - // processors in the current - // group - -#elif defined BENCHMARK_OS_MACOSX - int32_t num_cpus = 0; - size_t size = sizeof(num_cpus); - if (::sysctlbyname("hw.ncpu", &num_cpus, &size, nullptr, 0) == 0 && - (size == sizeof(num_cpus))) { - cpuinfo_num_cpus = num_cpus; - } else { - fprintf(stderr, "%s\n", strerror(errno)); - std::exit(EXIT_FAILURE); + return static_cast<double>((int64_t)data * + (int64_t)(1000 * 1000)); // was mhz +#elif defined (BENCHMARK_OS_SOLARIS) + kstat_ctl_t *kc = kstat_open(); + if (!kc) { + std::cerr << "failed to open /dev/kstat\n"; + return -1; } - int64_t cpu_freq = 0; - size = sizeof(cpu_freq); - if (::sysctlbyname("hw.cpufrequency", &cpu_freq, &size, nullptr, 0) == 0 && - (size == sizeof(cpu_freq))) { - cpuinfo_cycles_per_second = cpu_freq; - } else { - #if defined BENCHMARK_OS_IOS - fprintf(stderr, "CPU frequency cannot be detected. \n"); - cpuinfo_cycles_per_second = 0; - #else - fprintf(stderr, "%s\n", strerror(errno)); - std::exit(EXIT_FAILURE); - #endif + kstat_t *ksp = kstat_lookup(kc, (char*)"cpu_info", -1, (char*)"cpu_info0"); + if (!ksp) { + std::cerr << "failed to lookup in /dev/kstat\n"; + return -1; } -#else - // Generic cycles per second counter - cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond()); + if (kstat_read(kc, ksp, NULL) < 0) { + std::cerr << "failed to read from /dev/kstat\n"; + return -1; + } + kstat_named_t *knp = + (kstat_named_t*)kstat_data_lookup(ksp, (char*)"current_clock_Hz"); + if (!knp) { + std::cerr << "failed to lookup data in /dev/kstat\n"; + return -1; + } + if (knp->data_type != KSTAT_DATA_UINT64) { + std::cerr << "current_clock_Hz is of unexpected data type: " + << knp->data_type << "\n"; + return -1; + } + double clock_hz = knp->value.ui64; + kstat_close(kc); + return clock_hz; #endif + // If we've fallen through, attempt to roughly estimate the CPU clock rate. + const int estimate_time_ms = 1000; + const auto start_ticks = cycleclock::Now(); + SleepForMilliseconds(estimate_time_ms); + return static_cast<double>(cycleclock::Now() - start_ticks); } } // end namespace -double CyclesPerSecond(void) { - std::call_once(cpuinfo_init, InitializeSystemInfo); - return cpuinfo_cycles_per_second; -} - -int NumCPUs(void) { - std::call_once(cpuinfo_init, InitializeSystemInfo); - return cpuinfo_num_cpus; +const CPUInfo& CPUInfo::Get() { + static const CPUInfo* info = new CPUInfo(); + return *info; } -// The ""'s catch people who don't pass in a literal for "str" -#define strliterallen(str) (sizeof("" str "") - 1) - -// Must use a string literal for prefix. -#define memprefix(str, len, prefix) \ - ((((len) >= strliterallen(prefix)) && \ - std::memcmp(str, prefix, strliterallen(prefix)) == 0) \ - ? str + strliterallen(prefix) \ - : nullptr) - -bool CpuScalingEnabled() { -#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 - // running on Linux, so we silently ignore all the read errors. - for (int cpu = 0, num_cpus = NumCPUs(); cpu < num_cpus; ++cpu) { - std::string governor_file = - StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor"); - FILE* file = fopen(governor_file.c_str(), "r"); - if (!file) break; - char buff[16]; - size_t bytes_read = fread(buff, 1, sizeof(buff), file); - fclose(file); - if (memprefix(buff, bytes_read, "performance") == nullptr) return true; - } -#endif - return false; -} +CPUInfo::CPUInfo() + : num_cpus(GetNumCPUs()), + cycles_per_second(GetCPUCyclesPerSecond()), + caches(GetCacheSizes()), + scaling_enabled(CpuScalingEnabled(num_cpus)) {} } // end namespace benchmark diff --git a/utils/google-benchmark/src/sysinfo.h b/utils/google-benchmark/src/sysinfo.h deleted file mode 100644 index c5d9916d2ddea..0000000000000 --- a/utils/google-benchmark/src/sysinfo.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef BENCHMARK_SYSINFO_H_ -#define BENCHMARK_SYSINFO_H_ - -namespace benchmark { -int NumCPUs(); -double CyclesPerSecond(); -bool CpuScalingEnabled(); -} // end namespace benchmark - -#endif // BENCHMARK_SYSINFO_H_ diff --git a/utils/google-benchmark/src/thread_manager.h b/utils/google-benchmark/src/thread_manager.h new file mode 100644 index 0000000000000..82b4d72b62fbe --- /dev/null +++ b/utils/google-benchmark/src/thread_manager.h @@ -0,0 +1,66 @@ +#ifndef BENCHMARK_THREAD_MANAGER_H +#define BENCHMARK_THREAD_MANAGER_H + +#include <atomic> + +#include "benchmark/benchmark.h" +#include "mutex.h" + +namespace benchmark { +namespace internal { + +class ThreadManager { + public: + ThreadManager(int num_threads) + : alive_threads_(num_threads), start_stop_barrier_(num_threads) {} + + Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) { + return benchmark_mutex_; + } + + bool StartStopBarrier() EXCLUDES(end_cond_mutex_) { + return start_stop_barrier_.wait(); + } + + void NotifyThreadComplete() EXCLUDES(end_cond_mutex_) { + start_stop_barrier_.removeThread(); + if (--alive_threads_ == 0) { + MutexLock lock(end_cond_mutex_); + end_condition_.notify_all(); + } + } + + void WaitForAllThreads() EXCLUDES(end_cond_mutex_) { + MutexLock lock(end_cond_mutex_); + end_condition_.wait(lock.native_handle(), + [this]() { return alive_threads_ == 0; }); + } + + public: + struct Result { + int64_t iterations = 0; + double real_time_used = 0; + double cpu_time_used = 0; + double manual_time_used = 0; + int64_t bytes_processed = 0; + int64_t items_processed = 0; + int64_t complexity_n = 0; + std::string report_label_; + std::string error_message_; + bool has_error_ = false; + UserCounters counters; + }; + GUARDED_BY(GetBenchmarkMutex()) Result results; + + private: + mutable Mutex benchmark_mutex_; + std::atomic<int> alive_threads_; + Barrier start_stop_barrier_; + Mutex end_cond_mutex_; + Condition end_condition_; +}; + +} // namespace internal +} // namespace benchmark + +#endif // BENCHMARK_THREAD_MANAGER_H diff --git a/utils/google-benchmark/src/thread_timer.h b/utils/google-benchmark/src/thread_timer.h new file mode 100644 index 0000000000000..eaf108e017dc5 --- /dev/null +++ b/utils/google-benchmark/src/thread_timer.h @@ -0,0 +1,69 @@ +#ifndef BENCHMARK_THREAD_TIMER_H +#define BENCHMARK_THREAD_TIMER_H + +#include "check.h" +#include "timers.h" + +namespace benchmark { +namespace internal { + +class ThreadTimer { + public: + ThreadTimer() = default; + + // Called by each thread + void StartTimer() { + running_ = true; + start_real_time_ = ChronoClockNow(); + start_cpu_time_ = ThreadCPUUsage(); + } + + // Called by each thread + void StopTimer() { + CHECK(running_); + running_ = false; + 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); + } + + // Called by each thread + void SetIterationTime(double seconds) { manual_time_used_ += seconds; } + + bool running() const { return running_; } + + // REQUIRES: timer is not running + double real_time_used() { + CHECK(!running_); + return real_time_used_; + } + + // REQUIRES: timer is not running + double cpu_time_used() { + CHECK(!running_); + return cpu_time_used_; + } + + // REQUIRES: timer is not running + double manual_time_used() { + CHECK(!running_); + return manual_time_used_; + } + + private: + bool running_ = false; // Is the timer running + double start_real_time_ = 0; // If running_ + double start_cpu_time_ = 0; // If running_ + + // Accumulated time so far (does not contain current slice if running_) + double real_time_used_ = 0; + double cpu_time_used_ = 0; + // Manually set iteration time. User sets this with SetIterationTime(seconds). + double manual_time_used_ = 0; +}; + +} // namespace internal +} // namespace benchmark + +#endif // BENCHMARK_THREAD_TIMER_H diff --git a/utils/google-benchmark/src/timers.cc b/utils/google-benchmark/src/timers.cc index 8d56e8adf8d4c..2010e2450b4ad 100644 --- a/utils/google-benchmark/src/timers.cc +++ b/utils/google-benchmark/src/timers.cc @@ -17,11 +17,14 @@ #ifdef BENCHMARK_OS_WINDOWS #include <Shlwapi.h> +#undef StrCat // Don't let StrCat in string_util.h be renamed to lstrcatA #include <VersionHelpers.h> #include <Windows.h> #else #include <fcntl.h> +#ifndef BENCHMARK_OS_FUCHSIA #include <sys/resource.h> +#endif #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> @@ -74,7 +77,7 @@ double MakeTime(FILETIME const& kernel_time, FILETIME const& user_time) { static_cast<double>(user.QuadPart)) * 1e-7; } -#else +#elif !defined(BENCHMARK_OS_FUCHSIA) double MakeTime(struct rusage const& ru) { return (static_cast<double>(ru.ru_utime.tv_sec) + static_cast<double>(ru.ru_utime.tv_usec) * 1e-6 + @@ -158,6 +161,14 @@ double ThreadCPUUsage() { #elif defined(BENCHMARK_OS_EMSCRIPTEN) // Emscripten doesn't support traditional threads return ProcessCPUUsage(); +#elif defined(BENCHMARK_OS_RTEMS) + // RTEMS doesn't support CLOCK_THREAD_CPUTIME_ID. See + // https://github.com/RTEMS/rtems/blob/master/cpukit/posix/src/clockgettime.c + return ProcessCPUUsage(); +#elif defined(BENCHMARK_OS_SOLARIS) + struct rusage ru; + if (getrusage(RUSAGE_LWP, &ru) == 0) return MakeTime(ru); + DiagnoseAndExit("getrusage(RUSAGE_LWP, ...) failed"); #elif defined(CLOCK_THREAD_CPUTIME_ID) struct timespec ts; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) return MakeTime(ts); @@ -182,7 +193,6 @@ std::string DateTimeString(bool local) { std::strftime(storage, sizeof(storage), "%x %X", ::localtime(&now)); #else std::tm timeinfo; - std::memset(&timeinfo, 0, sizeof(std::tm)); ::localtime_r(&now, &timeinfo); written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo); #endif @@ -191,7 +201,6 @@ std::string DateTimeString(bool local) { written = std::strftime(storage, sizeof(storage), "%x %X", ::gmtime(&now)); #else std::tm timeinfo; - std::memset(&timeinfo, 0, sizeof(std::tm)); ::gmtime_r(&now, &timeinfo); written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo); #endif diff --git a/utils/google-benchmark/test/CMakeLists.txt b/utils/google-benchmark/test/CMakeLists.txt index 14ba7a6e2da79..f49ca5148f487 100644 --- a/utils/google-benchmark/test/CMakeLists.txt +++ b/utils/google-benchmark/test/CMakeLists.txt @@ -1,6 +1,7 @@ # Enable the tests find_package(Threads REQUIRED) +include(CheckCXXCompilerFlag) # NOTE: Some tests use `<cassert>` to perform the test. Therefore we must # strip -DNDEBUG from the default CMake flags in DEBUG mode. @@ -21,19 +22,29 @@ if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) endforeach() endif() +check_cxx_compiler_flag(-O3 BENCHMARK_HAS_O3_FLAG) +set(BENCHMARK_O3_FLAG "") +if (BENCHMARK_HAS_O3_FLAG) + set(BENCHMARK_O3_FLAG "-O3") +endif() + # NOTE: These flags must be added after find_package(Threads REQUIRED) otherwise # they will break the configuration check. if (DEFINED BENCHMARK_CXX_LINKER_FLAGS) list(APPEND CMAKE_EXE_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}) endif() -add_library(output_test_helper STATIC output_test_helper.cc) +add_library(output_test_helper STATIC output_test_helper.cc output_test.h) macro(compile_benchmark_test name) add_executable(${name} "${name}.cc") target_link_libraries(${name} 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) +endmacro(compile_benchmark_test_with_main) macro(compile_output_test name) add_executable(${name} "${name}.cc" output_test.h) @@ -41,7 +52,6 @@ macro(compile_output_test name) ${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) @@ -53,14 +63,23 @@ macro(add_filter_test name filter expect) endmacro(add_filter_test) add_filter_test(filter_simple "Foo" 3) +add_filter_test(filter_simple_negative "-Foo" 2) add_filter_test(filter_suffix "BM_.*" 4) +add_filter_test(filter_suffix_negative "-BM_.*" 1) add_filter_test(filter_regex_all ".*" 5) +add_filter_test(filter_regex_all_negative "-.*" 0) add_filter_test(filter_regex_blank "" 5) +add_filter_test(filter_regex_blank_negative "-" 0) add_filter_test(filter_regex_none "monkey" 0) +add_filter_test(filter_regex_none_negative "-monkey" 5) add_filter_test(filter_regex_wildcard ".*Foo.*" 3) +add_filter_test(filter_regex_wildcard_negative "-.*Foo.*" 2) add_filter_test(filter_regex_begin "^BM_.*" 4) +add_filter_test(filter_regex_begin_negative "-^BM_.*" 1) add_filter_test(filter_regex_begin2 "^N" 1) +add_filter_test(filter_regex_begin2_negative "-^N" 4) add_filter_test(filter_regex_end ".*Ba$" 1) +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) @@ -75,6 +94,11 @@ compile_benchmark_test(skip_with_error_test) add_test(skip_with_error_test 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 +check_cxx_compiler_flag(-O3 BENCHMARK_HAS_O3_FLAG) +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) compile_benchmark_test(fixture_test) @@ -89,18 +113,37 @@ add_test(map_test 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) +compile_benchmark_test_with_main(link_main_test) +add_test(link_main_test 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) +compile_output_test(templated_fixture_test) +add_test(templated_fixture_test 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) + +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) + check_cxx_compiler_flag(-std=c++03 BENCHMARK_HAS_CXX03_FLAG) if (BENCHMARK_HAS_CXX03_FLAG) - set(CXX03_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE "-std=c++11" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}") - string(REPLACE "-std=c++0x" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}") - compile_benchmark_test(cxx03_test) set_target_properties(cxx03_test - PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}") + PROPERTIES + COMPILE_FLAGS "-std=c++03") + # 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 + # the warning. + check_cxx_compiler_flag(-Wno-odr BENCHMARK_HAS_WNO_ODR) + if (BENCHMARK_ENABLE_LTO AND BENCHMARK_HAS_WNO_ODR) + set_target_properties(cxx03_test + PROPERTIES + LINK_FLAGS "-Wno-odr") + endif() add_test(cxx03 cxx03_test --benchmark_min_time=0.01) endif() @@ -113,6 +156,53 @@ endif() compile_output_test(complexity_test) add_test(complexity_benchmark 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}) + endmacro(compile_gtest) + + macro(add_gtest name) + compile_gtest(${name}) + add_test(${name} ${name}) + endmacro() + + add_gtest(benchmark_gtest) + add_gtest(statistics_gtest) + add_gtest(string_util_gtest) +endif(BENCHMARK_ENABLE_GTEST_TESTS) + +############################################################################### +# Assembly Unit Tests +############################################################################### + +if (BENCHMARK_ENABLE_ASSEMBLY_TESTS) + if (NOT LLVM_FILECHECK_EXE) + message(FATAL_ERROR "LLVM FileCheck is required when including this file") + endif() + include(AssemblyTests.cmake) + add_filecheck_test(donotoptimize_assembly_test) + add_filecheck_test(state_assembly_test) + add_filecheck_test(clobber_memory_assembly_test) +endif() + + + +############################################################################### +# Code Coverage Configuration +############################################################################### + # Add the coverage command(s) if(CMAKE_BUILD_TYPE) string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) diff --git a/utils/google-benchmark/test/basic_test.cc b/utils/google-benchmark/test/basic_test.cc index 22de007cb6dd2..d07fbc00b1516 100644 --- a/utils/google-benchmark/test/basic_test.cc +++ b/utils/google-benchmark/test/basic_test.cc @@ -1,10 +1,10 @@ -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #define BASIC_BENCHMARK_TEST(x) BENCHMARK(x)->Arg(8)->Arg(512)->Arg(8192) void BM_empty(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { benchmark::DoNotOptimize(state.iterations()); } } @@ -12,7 +12,7 @@ BENCHMARK(BM_empty); BENCHMARK(BM_empty)->ThreadPerCpu(); void BM_spin_empty(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { for (int x = 0; x < state.range(0); ++x) { benchmark::DoNotOptimize(x); } @@ -25,7 +25,7 @@ void BM_spin_pause_before(benchmark::State& state) { for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); } - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); } @@ -35,7 +35,7 @@ BASIC_BENCHMARK_TEST(BM_spin_pause_before); BASIC_BENCHMARK_TEST(BM_spin_pause_before)->ThreadPerCpu(); void BM_spin_pause_during(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { state.PauseTiming(); for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); @@ -50,7 +50,7 @@ BASIC_BENCHMARK_TEST(BM_spin_pause_during); BASIC_BENCHMARK_TEST(BM_spin_pause_during)->ThreadPerCpu(); void BM_pause_during(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { state.PauseTiming(); state.ResumeTiming(); } @@ -61,7 +61,7 @@ BENCHMARK(BM_pause_during)->UseRealTime(); BENCHMARK(BM_pause_during)->UseRealTime()->ThreadPerCpu(); void BM_spin_pause_after(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); } @@ -77,7 +77,7 @@ void BM_spin_pause_before_and_after(benchmark::State& state) { for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); } - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = 0; i < state.range(0); ++i) { benchmark::DoNotOptimize(i); } @@ -90,10 +90,47 @@ BASIC_BENCHMARK_TEST(BM_spin_pause_before_and_after); BASIC_BENCHMARK_TEST(BM_spin_pause_before_and_after)->ThreadPerCpu(); void BM_empty_stop_start(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_empty_stop_start); BENCHMARK(BM_empty_stop_start)->ThreadPerCpu(); -BENCHMARK_MAIN() + +void BM_KeepRunning(benchmark::State& state) { + size_t iter_count = 0; + assert(iter_count == state.iterations()); + while (state.KeepRunning()) { + ++iter_count; + } + assert(iter_count == state.iterations()); +} +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; + while (state.KeepRunningBatch(batch_size)) { + iter_count += batch_size; + } + assert(state.iterations() == iter_count); +} +BENCHMARK(BM_KeepRunningBatch); + +void BM_RangedFor(benchmark::State& state) { + size_t iter_count = 0; + for (auto _ : state) { + ++iter_count; + } + assert(iter_count == state.max_iterations); +} +BENCHMARK(BM_RangedFor); + +// Ensure that StateIterator provides all the necessary typedefs required to +// instantiate std::iterator_traits. +static_assert(std::is_same< + typename std::iterator_traits<benchmark::State::StateIterator>::value_type, + typename benchmark::State::StateIterator::value_type>::value, ""); + +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/benchmark_gtest.cc b/utils/google-benchmark/test/benchmark_gtest.cc new file mode 100644 index 0000000000000..10683b433ab54 --- /dev/null +++ b/utils/google-benchmark/test/benchmark_gtest.cc @@ -0,0 +1,33 @@ +#include <vector> + +#include "../src/benchmark_register.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +namespace { + +TEST(AddRangeTest, Simple) { + std::vector<int> dst; + AddRange(&dst, 1, 2, 2); + EXPECT_THAT(dst, testing::ElementsAre(1, 2)); +} + +TEST(AddRangeTest, Simple64) { + std::vector<int64_t> dst; + AddRange(&dst, static_cast<int64_t>(1), static_cast<int64_t>(2), 2); + EXPECT_THAT(dst, testing::ElementsAre(1, 2)); +} + +TEST(AddRangeTest, Advanced) { + std::vector<int> dst; + AddRange(&dst, 5, 15, 2); + EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15)); +} + +TEST(AddRangeTest, Advanced64) { + std::vector<int64_t> dst; + AddRange(&dst, static_cast<int64_t>(5), static_cast<int64_t>(15), 2); + EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15)); +} + +} // end namespace diff --git a/utils/google-benchmark/test/benchmark_test.cc b/utils/google-benchmark/test/benchmark_test.cc index 57731331e6d05..3cd4f5565fa1c 100644 --- a/utils/google-benchmark/test/benchmark_test.cc +++ b/utils/google-benchmark/test/benchmark_test.cc @@ -40,9 +40,9 @@ double CalculatePi(int depth) { return (pi - 1.0) * 4; } -std::set<int> ConstructRandomSet(int size) { - std::set<int> s; - for (int i = 0; i < size; ++i) s.insert(i); +std::set<int64_t> ConstructRandomSet(int64_t size) { + std::set<int64_t> s; + for (int i = 0; i < size; ++i) s.insert(s.end(), i); return s; } @@ -53,7 +53,7 @@ std::vector<int>* test_vector = nullptr; static void BM_Factorial(benchmark::State& state) { int fac_42 = 0; - while (state.KeepRunning()) fac_42 = Factorial(8); + for (auto _ : state) fac_42 = Factorial(8); // Prevent compiler optimizations std::stringstream ss; ss << fac_42; @@ -64,7 +64,7 @@ BENCHMARK(BM_Factorial)->UseRealTime(); static void BM_CalculatePiRange(benchmark::State& state) { double pi = 0.0; - while (state.KeepRunning()) pi = CalculatePi(state.range(0)); + for (auto _ : state) pi = CalculatePi(static_cast<int>(state.range(0))); std::stringstream ss; ss << pi; state.SetLabel(ss.str()); @@ -73,8 +73,8 @@ BENCHMARK_RANGE(BM_CalculatePiRange, 1, 1024 * 1024); static void BM_CalculatePi(benchmark::State& state) { static const int depth = 1024; - while (state.KeepRunning()) { - benchmark::DoNotOptimize(CalculatePi(depth)); + for (auto _ : state) { + benchmark::DoNotOptimize(CalculatePi(static_cast<int>(depth))); } } BENCHMARK(BM_CalculatePi)->Threads(8); @@ -82,26 +82,30 @@ BENCHMARK(BM_CalculatePi)->ThreadRange(1, 32); BENCHMARK(BM_CalculatePi)->ThreadPerCpu(); static void BM_SetInsert(benchmark::State& state) { - while (state.KeepRunning()) { + std::set<int64_t> data; + for (auto _ : state) { state.PauseTiming(); - std::set<int> data = ConstructRandomSet(state.range(0)); + data = ConstructRandomSet(state.range(0)); state.ResumeTiming(); for (int j = 0; j < state.range(1); ++j) data.insert(rand()); } state.SetItemsProcessed(state.iterations() * state.range(1)); state.SetBytesProcessed(state.iterations() * state.range(1) * sizeof(int)); } -BENCHMARK(BM_SetInsert)->Ranges({{1 << 10, 8 << 10}, {1, 10}}); + +// Test many inserts at once to reduce the total iterations needed. Otherwise, the slower, +// non-timed part of each iteration will make the benchmark take forever. +BENCHMARK(BM_SetInsert)->Ranges({{1 << 10, 8 << 10}, {128, 512}}); template <typename Container, typename ValueType = typename Container::value_type> static void BM_Sequential(benchmark::State& state) { ValueType v = 42; - while (state.KeepRunning()) { + for (auto _ : state) { Container c; - for (int i = state.range(0); --i;) c.push_back(v); + for (int64_t i = state.range(0); --i;) c.push_back(v); } - const size_t items_processed = state.iterations() * state.range(0); + const int64_t items_processed = state.iterations() * state.range(0); state.SetItemsProcessed(items_processed); state.SetBytesProcessed(items_processed * sizeof(v)); } @@ -109,14 +113,15 @@ BENCHMARK_TEMPLATE2(BM_Sequential, std::vector<int>, int) ->Range(1 << 0, 1 << 10); BENCHMARK_TEMPLATE(BM_Sequential, std::list<int>)->Range(1 << 0, 1 << 10); // Test the variadic version of BENCHMARK_TEMPLATE in C++11 and beyond. -#if __cplusplus >= 201103L +#ifdef BENCHMARK_HAS_CXX11 BENCHMARK_TEMPLATE(BM_Sequential, std::vector<int>, int)->Arg(512); #endif static void BM_StringCompare(benchmark::State& state) { - std::string s1(state.range(0), '-'); - std::string s2(state.range(0), '-'); - while (state.KeepRunning()) benchmark::DoNotOptimize(s1.compare(s2)); + size_t len = static_cast<size_t>(state.range(0)); + std::string s1(len, '-'); + std::string s2(len, '-'); + for (auto _ : state) benchmark::DoNotOptimize(s1.compare(s2)); } BENCHMARK(BM_StringCompare)->Range(1, 1 << 20); @@ -126,7 +131,7 @@ static void BM_SetupTeardown(benchmark::State& state) { test_vector = new std::vector<int>(); } int i = 0; - while (state.KeepRunning()) { + for (auto _ : state) { std::lock_guard<std::mutex> l(test_vector_mu); if (i % 2 == 0) test_vector->push_back(i); @@ -142,7 +147,7 @@ BENCHMARK(BM_SetupTeardown)->ThreadPerCpu(); static void BM_LongTest(benchmark::State& state) { double tracker = 0.0; - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = 0; i < state.range(0); ++i) benchmark::DoNotOptimize(tracker += i); } @@ -150,16 +155,16 @@ static void BM_LongTest(benchmark::State& state) { BENCHMARK(BM_LongTest)->Range(1 << 16, 1 << 28); static void BM_ParallelMemset(benchmark::State& state) { - int size = state.range(0) / static_cast<int>(sizeof(int)); - int thread_size = size / state.threads; + int64_t size = state.range(0) / static_cast<int64_t>(sizeof(int)); + int thread_size = static_cast<int>(size) / state.threads; int from = thread_size * state.thread_index; int to = from + thread_size; if (state.thread_index == 0) { - test_vector = new std::vector<int>(size); + test_vector = new std::vector<int>(static_cast<size_t>(size)); } - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = from; i < to; i++) { // No need to lock test_vector_mu as ranges // do not overlap between threads. @@ -174,12 +179,12 @@ static void BM_ParallelMemset(benchmark::State& state) { BENCHMARK(BM_ParallelMemset)->Arg(10 << 20)->ThreadRange(1, 4); static void BM_ManualTiming(benchmark::State& state) { - size_t slept_for = 0; - int microseconds = state.range(0); + int64_t slept_for = 0; + int64_t microseconds = state.range(0); std::chrono::duration<double, std::micro> sleep_duration{ static_cast<double>(microseconds)}; - while (state.KeepRunning()) { + for (auto _ : state) { auto start = std::chrono::high_resolution_clock::now(); // Simulate some useful workload with a sleep std::this_thread::sleep_for( @@ -197,11 +202,11 @@ static void BM_ManualTiming(benchmark::State& state) { BENCHMARK(BM_ManualTiming)->Range(1, 1 << 14)->UseRealTime(); BENCHMARK(BM_ManualTiming)->Range(1, 1 << 14)->UseManualTime(); -#if __cplusplus >= 201103L +#ifdef BENCHMARK_HAS_CXX11 template <class... Args> void BM_with_args(benchmark::State& state, Args&&...) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK_CAPTURE(BM_with_args, int_test, 42, 43, 44); @@ -213,24 +218,7 @@ void BM_non_template_args(benchmark::State& state, int, double) { } BENCHMARK_CAPTURE(BM_non_template_args, basic_test, 0, 0); -static void BM_UserCounter(benchmark::State& state) { - static const int depth = 1024; - while (state.KeepRunning()) { - benchmark::DoNotOptimize(CalculatePi(depth)); - } - state.counters["Foo"] = 1; - state.counters["Bar"] = 2; - state.counters["Baz"] = 3; - state.counters["Bat"] = 5; -#ifdef BENCHMARK_HAS_CXX11 - state.counters.insert({{"Foo", 2}, {"Bar", 3}, {"Baz", 5}, {"Bat", 6}}); -#endif -} -BENCHMARK(BM_UserCounter)->Threads(8); -BENCHMARK(BM_UserCounter)->ThreadRange(1, 32); -BENCHMARK(BM_UserCounter)->ThreadPerCpu(); - -#endif // __cplusplus >= 201103L +#endif // BENCHMARK_HAS_CXX11 static void BM_DenseThreadRanges(benchmark::State& st) { switch (st.range(0)) { @@ -254,4 +242,4 @@ BENCHMARK(BM_DenseThreadRanges)->Arg(1)->DenseThreadRange(1, 3); BENCHMARK(BM_DenseThreadRanges)->Arg(2)->DenseThreadRange(1, 4, 2); BENCHMARK(BM_DenseThreadRanges)->Arg(3)->DenseThreadRange(5, 14, 3); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/clobber_memory_assembly_test.cc b/utils/google-benchmark/test/clobber_memory_assembly_test.cc new file mode 100644 index 0000000000000..f41911a39ce73 --- /dev/null +++ b/utils/google-benchmark/test/clobber_memory_assembly_test.cc @@ -0,0 +1,64 @@ +#include <benchmark/benchmark.h> + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wreturn-type" +#endif + +extern "C" { + +extern int ExternInt; +extern int ExternInt2; +extern int ExternInt3; + +} + +// CHECK-LABEL: test_basic: +extern "C" void test_basic() { + int x; + benchmark::DoNotOptimize(&x); + x = 101; + benchmark::ClobberMemory(); + // CHECK: leaq [[DEST:[^,]+]], %rax + // CHECK: movl $101, [[DEST]] + // CHECK: ret +} + +// CHECK-LABEL: test_redundant_store: +extern "C" void test_redundant_store() { + ExternInt = 3; + benchmark::ClobberMemory(); + ExternInt = 51; + // CHECK-DAG: ExternInt + // CHECK-DAG: movl $3 + // CHECK: movl $51 +} + +// CHECK-LABEL: test_redundant_read: +extern "C" void test_redundant_read() { + int x; + benchmark::DoNotOptimize(&x); + x = ExternInt; + benchmark::ClobberMemory(); + x = ExternInt2; + // CHECK: leaq [[DEST:[^,]+]], %rax + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, [[DEST]] + // CHECK-NOT: ExternInt2 + // CHECK: ret +} + +// CHECK-LABEL: test_redundant_read2: +extern "C" void test_redundant_read2() { + int x; + benchmark::DoNotOptimize(&x); + x = ExternInt; + benchmark::ClobberMemory(); + x = ExternInt2; + benchmark::ClobberMemory(); + // CHECK: leaq [[DEST:[^,]+]], %rax + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, [[DEST]] + // CHECK: ExternInt2(%rip) + // CHECK: movl %eax, [[DEST]] + // CHECK: ret +} diff --git a/utils/google-benchmark/test/complexity_test.cc b/utils/google-benchmark/test/complexity_test.cc index 14e03b06eb1ac..5f91660898bec 100644 --- a/utils/google-benchmark/test/complexity_test.cc +++ b/utils/google-benchmark/test/complexity_test.cc @@ -25,8 +25,8 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name, {"^%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\",$"}, - {"\"cpu_coefficient\": [0-9]+,$", MR_Next}, - {"\"real_coefficient\": [0-9]{1,5},$", MR_Next}, + {"\"cpu_coefficient\": %float,$", MR_Next}, + {"\"real_coefficient\": %float,$", MR_Next}, {"\"big_o\": \"%bigo\",$", MR_Next}, {"\"time_unit\": \"ns\"$", MR_Next}, {"}", MR_Next}, @@ -46,7 +46,7 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name, // ========================================================================= // void BM_Complexity_O1(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { for (int i = 0; i < 1024; ++i) { benchmark::DoNotOptimize(&i); } @@ -55,7 +55,7 @@ void BM_Complexity_O1(benchmark::State& state) { } 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([](int) { +BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity([](int64_t) { return 1.0; }); @@ -81,20 +81,20 @@ ADD_COMPLEXITY_CASES(big_o_1_test_name, rms_o_1_test_name, lambda_big_o_1); // --------------------------- Testing BigO O(N) --------------------------- // // ========================================================================= // -std::vector<int> ConstructRandomVector(int size) { +std::vector<int> ConstructRandomVector(int64_t size) { std::vector<int> v; - v.reserve(size); + v.reserve(static_cast<int>(size)); for (int i = 0; i < size; ++i) { - v.push_back(std::rand() % size); + v.push_back(static_cast<int>(std::rand() % size)); } return v; } void BM_Complexity_O_N(benchmark::State& state) { auto v = ConstructRandomVector(state.range(0)); - const int item_not_in_vector = - state.range(0) * 2; // Test worst case scenario (item not in vector) - while (state.KeepRunning()) { + // Test worst case scenario (item not in vector) + const int64_t item_not_in_vector = state.range(0) * 2; + for (auto _ : state) { benchmark::DoNotOptimize(std::find(v.begin(), v.end(), item_not_in_vector)); } state.SetComplexityN(state.range(0)); @@ -106,7 +106,7 @@ BENCHMARK(BM_Complexity_O_N) BENCHMARK(BM_Complexity_O_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) - ->Complexity([](int n) -> double { return n; }); + ->Complexity([](int64_t n) -> double { return static_cast<double>(n); }); BENCHMARK(BM_Complexity_O_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) @@ -129,11 +129,12 @@ ADD_COMPLEXITY_CASES(big_o_n_test_name, rms_o_n_test_name, lambda_big_o_n); static void BM_Complexity_O_N_log_N(benchmark::State& state) { auto v = ConstructRandomVector(state.range(0)); - while (state.KeepRunning()) { + for (auto _ : state) { std::sort(v.begin(), v.end()); } state.SetComplexityN(state.range(0)); } +static const double kLog2E = 1.44269504088896340736; BENCHMARK(BM_Complexity_O_N_log_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) @@ -141,7 +142,7 @@ BENCHMARK(BM_Complexity_O_N_log_N) BENCHMARK(BM_Complexity_O_N_log_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) - ->Complexity([](int n) { return n * std::log2(n); }); + ->Complexity([](int64_t n) { return kLog2E * n * log(static_cast<double>(n)); }); BENCHMARK(BM_Complexity_O_N_log_N) ->RangeMultiplier(2) ->Range(1 << 10, 1 << 16) diff --git a/utils/google-benchmark/test/cxx03_test.cc b/utils/google-benchmark/test/cxx03_test.cc index a79d964e17bdc..baa9ed9262baa 100644 --- a/utils/google-benchmark/test/cxx03_test.cc +++ b/utils/google-benchmark/test/cxx03_test.cc @@ -8,6 +8,10 @@ #error C++11 or greater detected. Should be C++03. #endif +#ifdef BENCHMARK_HAS_CXX11 +#error C++11 or greater detected by the library. BENCHMARK_HAS_CXX11 is defined. +#endif + void BM_empty(benchmark::State& state) { while (state.KeepRunning()) { volatile std::size_t x = state.iterations(); @@ -39,10 +43,21 @@ void BM_template1(benchmark::State& state) { BENCHMARK_TEMPLATE(BM_template1, long); BENCHMARK_TEMPLATE1(BM_template1, int); +template <class T> +struct BM_Fixture : public ::benchmark::Fixture { +}; + +BENCHMARK_TEMPLATE_F(BM_Fixture, BM_template1, long)(benchmark::State& state) { + BM_empty(state); +} +BENCHMARK_TEMPLATE1_F(BM_Fixture, BM_template2, int)(benchmark::State& state) { + BM_empty(state); +} + void BM_counters(benchmark::State& state) { BM_empty(state); state.counters["Foo"] = 2; } BENCHMARK(BM_counters); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/diagnostics_test.cc b/utils/google-benchmark/test/diagnostics_test.cc index 1046730b0fc1c..dd64a33655315 100644 --- a/utils/google-benchmark/test/diagnostics_test.cc +++ b/utils/google-benchmark/test/diagnostics_test.cc @@ -11,7 +11,7 @@ #include <stdexcept> #include "../src/check.h" -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #if defined(__GNUC__) && !defined(__EXCEPTIONS) #define TEST_HAS_NO_EXCEPTIONS @@ -47,7 +47,7 @@ void BM_diagnostic_test(benchmark::State& state) { if (called_once == false) try_invalid_pause_resume(state); - while (state.KeepRunning()) { + for (auto _ : state) { benchmark::DoNotOptimize(state.iterations()); } @@ -57,6 +57,22 @@ void BM_diagnostic_test(benchmark::State& state) { } BENCHMARK(BM_diagnostic_test); + +void BM_diagnostic_test_keep_running(benchmark::State& state) { + static bool called_once = false; + + if (called_once == false) try_invalid_pause_resume(state); + + while(state.KeepRunning()) { + benchmark::DoNotOptimize(state.iterations()); + } + + if (called_once == false) try_invalid_pause_resume(state); + + called_once = true; +} +BENCHMARK(BM_diagnostic_test_keep_running); + int main(int argc, char* argv[]) { benchmark::internal::GetAbortHandler() = &TestHandler; benchmark::Initialize(&argc, argv); diff --git a/utils/google-benchmark/test/donotoptimize_assembly_test.cc b/utils/google-benchmark/test/donotoptimize_assembly_test.cc new file mode 100644 index 0000000000000..d4b0bab70e773 --- /dev/null +++ b/utils/google-benchmark/test/donotoptimize_assembly_test.cc @@ -0,0 +1,163 @@ +#include <benchmark/benchmark.h> + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wreturn-type" +#endif + +extern "C" { + +extern int ExternInt; +extern int ExternInt2; +extern int ExternInt3; + +inline int Add42(int x) { return x + 42; } + +struct NotTriviallyCopyable { + NotTriviallyCopyable(); + explicit NotTriviallyCopyable(int x) : value(x) {} + NotTriviallyCopyable(NotTriviallyCopyable const&); + int value; +}; + +struct Large { + int value; + int data[2]; +}; + +} +// CHECK-LABEL: test_with_rvalue: +extern "C" void test_with_rvalue() { + benchmark::DoNotOptimize(Add42(0)); + // CHECK: movl $42, %eax + // CHECK: ret +} + +// CHECK-LABEL: test_with_large_rvalue: +extern "C" void test_with_large_rvalue() { + benchmark::DoNotOptimize(Large{ExternInt, {ExternInt, ExternInt}}); + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG:[a-z]+]] + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: ret +} + +// CHECK-LABEL: test_with_non_trivial_rvalue: +extern "C" void test_with_non_trivial_rvalue() { + benchmark::DoNotOptimize(NotTriviallyCopyable(ExternInt)); + // CHECK: mov{{l|q}} ExternInt(%rip) + // CHECK: ret +} + +// CHECK-LABEL: test_with_lvalue: +extern "C" void test_with_lvalue() { + int x = 101; + benchmark::DoNotOptimize(x); + // CHECK-GNU: movl $101, %eax + // CHECK-CLANG: movl $101, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: ret +} + +// CHECK-LABEL: test_with_large_lvalue: +extern "C" void test_with_large_lvalue() { + Large L{ExternInt, {ExternInt, ExternInt}}; + benchmark::DoNotOptimize(L); + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: ret +} + +// CHECK-LABEL: test_with_non_trivial_lvalue: +extern "C" void test_with_non_trivial_lvalue() { + NotTriviallyCopyable NTC(ExternInt); + benchmark::DoNotOptimize(NTC); + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: ret +} + +// CHECK-LABEL: test_with_const_lvalue: +extern "C" void test_with_const_lvalue() { + const int x = 123; + benchmark::DoNotOptimize(x); + // CHECK: movl $123, %eax + // CHECK: ret +} + +// CHECK-LABEL: test_with_large_const_lvalue: +extern "C" void test_with_large_const_lvalue() { + const Large L{ExternInt, {ExternInt, ExternInt}}; + benchmark::DoNotOptimize(L); + // CHECK: ExternInt(%rip) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: movl %eax, -{{[0-9]+}}(%[[REG]]) + // CHECK: ret +} + +// CHECK-LABEL: test_with_non_trivial_const_lvalue: +extern "C" void test_with_non_trivial_const_lvalue() { + const NotTriviallyCopyable Obj(ExternInt); + benchmark::DoNotOptimize(Obj); + // CHECK: mov{{q|l}} ExternInt(%rip) + // CHECK: ret +} + +// CHECK-LABEL: test_div_by_two: +extern "C" int test_div_by_two(int input) { + int divisor = 2; + benchmark::DoNotOptimize(divisor); + return input / divisor; + // CHECK: movl $2, [[DEST:.*]] + // CHECK: idivl [[DEST]] + // CHECK: ret +} + +// CHECK-LABEL: test_inc_integer: +extern "C" int test_inc_integer() { + int x = 0; + for (int i=0; i < 5; ++i) + benchmark::DoNotOptimize(++x); + // CHECK: movl $1, [[DEST:.*]] + // CHECK: {{(addl \$1,|incl)}} [[DEST]] + // CHECK: {{(addl \$1,|incl)}} [[DEST]] + // CHECK: {{(addl \$1,|incl)}} [[DEST]] + // CHECK: {{(addl \$1,|incl)}} [[DEST]] + // CHECK-CLANG: movl [[DEST]], %eax + // CHECK: ret + return x; +} + +// CHECK-LABEL: test_pointer_rvalue +extern "C" void test_pointer_rvalue() { + // CHECK: movl $42, [[DEST:.*]] + // CHECK: leaq [[DEST]], %rax + // CHECK-CLANG: movq %rax, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: ret + int x = 42; + benchmark::DoNotOptimize(&x); +} + +// CHECK-LABEL: test_pointer_const_lvalue: +extern "C" void test_pointer_const_lvalue() { + // CHECK: movl $42, [[DEST:.*]] + // CHECK: leaq [[DEST]], %rax + // CHECK-CLANG: movq %rax, -{{[0-9]+}}(%[[REG:[a-z]+]]) + // CHECK: ret + int x = 42; + int * const xp = &x; + benchmark::DoNotOptimize(xp); +} + +// CHECK-LABEL: test_pointer_lvalue: +extern "C" void test_pointer_lvalue() { + // CHECK: movl $42, [[DEST:.*]] + // CHECK: leaq [[DEST]], %rax + // CHECK-CLANG: movq %rax, -{{[0-9]+}}(%[[REG:[a-z+]+]]) + // CHECK: ret + int x = 42; + int *xp = &x; + benchmark::DoNotOptimize(xp); +} diff --git a/utils/google-benchmark/test/donotoptimize_test.cc b/utils/google-benchmark/test/donotoptimize_test.cc index b21187aadc217..2ce92d1c72bed 100644 --- a/utils/google-benchmark/test/donotoptimize_test.cc +++ b/utils/google-benchmark/test/donotoptimize_test.cc @@ -9,16 +9,32 @@ std::uint64_t double_up(const std::uint64_t x) __attribute__((const)); std::uint64_t double_up(const std::uint64_t x) { return x * 2; } } +// Using DoNotOptimize on types like BitRef seem to cause a lot of problems +// with the inline assembly on both GCC and Clang. +struct BitRef { + int index; + unsigned char &byte; + +public: + static BitRef Make() { + static unsigned char arr[2] = {}; + BitRef b(1, arr[0]); + return b; + } +private: + BitRef(int i, unsigned char& b) : index(i), byte(b) {} +}; + int main(int, char*[]) { // this test verifies compilation of DoNotOptimize() for some types - char buffer8[8]; + char buffer8[8] = ""; benchmark::DoNotOptimize(buffer8); - char buffer20[20]; + char buffer20[20] = ""; benchmark::DoNotOptimize(buffer20); - char buffer1024[1024]; + char buffer1024[1024] = ""; benchmark::DoNotOptimize(buffer1024); benchmark::DoNotOptimize(&buffer1024[0]); @@ -29,5 +45,8 @@ int main(int, char*[]) { benchmark::DoNotOptimize(double_up(x)); - return 0; + // These tests are to e + benchmark::DoNotOptimize(BitRef::Make()); + BitRef lval = BitRef::Make(); + benchmark::DoNotOptimize(lval); } diff --git a/utils/google-benchmark/test/filter_test.cc b/utils/google-benchmark/test/filter_test.cc index 3a205295f0919..0e27065c1558e 100644 --- a/utils/google-benchmark/test/filter_test.cc +++ b/utils/google-benchmark/test/filter_test.cc @@ -36,31 +36,31 @@ class TestReporter : public benchmark::ConsoleReporter { } // end namespace static void NoPrefix(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(NoPrefix); static void BM_Foo(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_Foo); static void BM_Bar(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_Bar); static void BM_FooBar(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_FooBar); static void BM_FooBa(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_FooBa); diff --git a/utils/google-benchmark/test/fixture_test.cc b/utils/google-benchmark/test/fixture_test.cc index bbc2f9579023c..1462b10f02f96 100644 --- a/utils/google-benchmark/test/fixture_test.cc +++ b/utils/google-benchmark/test/fixture_test.cc @@ -28,7 +28,7 @@ class MyFixture : public ::benchmark::Fixture { BENCHMARK_F(MyFixture, Foo)(benchmark::State &st) { assert(data.get() != nullptr); assert(*data == 42); - while (st.KeepRunning()) { + for (auto _ : st) { } } @@ -37,7 +37,7 @@ BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) { assert(data.get() != nullptr); assert(*data == 42); } - while (st.KeepRunning()) { + for (auto _ : st) { assert(data.get() != nullptr); assert(*data == 42); } @@ -46,4 +46,4 @@ BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) { BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42); BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu(); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/link_main_test.cc b/utils/google-benchmark/test/link_main_test.cc new file mode 100644 index 0000000000000..241ad5c3905e9 --- /dev/null +++ b/utils/google-benchmark/test/link_main_test.cc @@ -0,0 +1,8 @@ +#include "benchmark/benchmark.h" + +void BM_empty(benchmark::State& state) { + for (auto _ : state) { + benchmark::DoNotOptimize(state.iterations()); + } +} +BENCHMARK(BM_empty); diff --git a/utils/google-benchmark/test/map_test.cc b/utils/google-benchmark/test/map_test.cc index 83457c9981cde..dbf7982a3686e 100644 --- a/utils/google-benchmark/test/map_test.cc +++ b/utils/google-benchmark/test/map_test.cc @@ -8,7 +8,7 @@ namespace { std::map<int, int> ConstructRandomMap(int size) { std::map<int, int> m; for (int i = 0; i < size; ++i) { - m.insert(std::make_pair(rand() % size, rand() % size)); + m.insert(std::make_pair(std::rand() % size, std::rand() % size)); } return m; } @@ -17,13 +17,14 @@ std::map<int, int> ConstructRandomMap(int size) { // Basic version. static void BM_MapLookup(benchmark::State& state) { - const int size = state.range(0); - while (state.KeepRunning()) { + const int size = static_cast<int>(state.range(0)); + std::map<int, int> m; + for (auto _ : state) { state.PauseTiming(); - std::map<int, int> m = ConstructRandomMap(size); + m = ConstructRandomMap(size); state.ResumeTiming(); for (int i = 0; i < size; ++i) { - benchmark::DoNotOptimize(m.find(rand() % size)); + benchmark::DoNotOptimize(m.find(std::rand() % size)); } } state.SetItemsProcessed(state.iterations() * size); @@ -34,7 +35,7 @@ BENCHMARK(BM_MapLookup)->Range(1 << 3, 1 << 12); class MapFixture : public ::benchmark::Fixture { public: void SetUp(const ::benchmark::State& st) { - m = ConstructRandomMap(st.range(0)); + m = ConstructRandomMap(static_cast<int>(st.range(0))); } void TearDown(const ::benchmark::State&) { m.clear(); } @@ -43,14 +44,14 @@ class MapFixture : public ::benchmark::Fixture { }; BENCHMARK_DEFINE_F(MapFixture, Lookup)(benchmark::State& state) { - const int size = state.range(0); - while (state.KeepRunning()) { + const int size = static_cast<int>(state.range(0)); + for (auto _ : state) { for (int i = 0; i < size; ++i) { - benchmark::DoNotOptimize(m.find(rand() % size)); + benchmark::DoNotOptimize(m.find(std::rand() % size)); } } state.SetItemsProcessed(state.iterations() * size); } BENCHMARK_REGISTER_F(MapFixture, Lookup)->Range(1 << 3, 1 << 12); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/multiple_ranges_test.cc b/utils/google-benchmark/test/multiple_ranges_test.cc index 8e67b3b2a99cf..c64acabc25c98 100644 --- a/utils/google-benchmark/test/multiple_ranges_test.cc +++ b/utils/google-benchmark/test/multiple_ranges_test.cc @@ -1,7 +1,9 @@ #include "benchmark/benchmark.h" #include <cassert> +#include <iostream> #include <set> +#include <vector> class MultipleRangesFixture : public ::benchmark::Fixture { public: @@ -27,25 +29,46 @@ class MultipleRangesFixture : public ::benchmark::Fixture { {7, 6, 3}}) {} void SetUp(const ::benchmark::State& state) { - std::vector<int> ranges = {state.range(0), state.range(1), state.range(2)}; + std::vector<int64_t> ranges = {state.range(0), state.range(1), + state.range(2)}; 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 ~MultipleRangesFixture() { assert(actualValues.size() == expectedValues.size()); + if (actualValues.size() != expectedValues.size()) { + 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<int>> expectedValues; - std::set<std::vector<int>> actualValues; + std::set<std::vector<int64_t>> expectedValues; + std::set<std::vector<int64_t>> actualValues; }; BENCHMARK_DEFINE_F(MultipleRangesFixture, Empty)(benchmark::State& state) { - while (state.KeepRunning()) { - int product = state.range(0) * state.range(1) * state.range(2); - for (int x = 0; x < product; x++) { + for (auto _ : state) { + int64_t product = state.range(0) * state.range(1) * state.range(2); + for (int64_t x = 0; x < product; x++) { benchmark::DoNotOptimize(x); } } @@ -60,15 +83,15 @@ void BM_CheckDefaultArgument(benchmark::State& state) { // Test that the 'range()' without an argument is the same as 'range(0)'. assert(state.range() == state.range(0)); assert(state.range() != state.range(1)); - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_CheckDefaultArgument)->Ranges({{1, 5}, {6, 10}}); static void BM_MultipleRanges(benchmark::State& st) { - while (st.KeepRunning()) { + for (auto _ : st) { } } BENCHMARK(BM_MultipleRanges)->Ranges({{5, 5}, {6, 6}}); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/options_test.cc b/utils/google-benchmark/test/options_test.cc index bbbed28839881..fdec69174eec0 100644 --- a/utils/google-benchmark/test/options_test.cc +++ b/utils/google-benchmark/test/options_test.cc @@ -1,4 +1,4 @@ -#include "benchmark/benchmark_api.h" +#include "benchmark/benchmark.h" #include <chrono> #include <thread> @@ -8,13 +8,13 @@ #include <cassert> void BM_basic(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } void BM_basic_slow(benchmark::State& state) { std::chrono::milliseconds sleep_duration(state.range(0)); - while (state.KeepRunning()) { + for (auto _ : state) { std::this_thread::sleep_for( std::chrono::duration_cast<std::chrono::nanoseconds>(sleep_duration)); } @@ -44,7 +44,7 @@ void CustomArgs(benchmark::internal::Benchmark* b) { BENCHMARK(BM_basic)->Apply(CustomArgs); -void BM_explicit_iteration_count(benchmark::State& st) { +void BM_explicit_iteration_count(benchmark::State& state) { // Test that benchmarks specified with an explicit iteration count are // only run once. static bool invoked_before = false; @@ -52,14 +52,14 @@ void BM_explicit_iteration_count(benchmark::State& st) { invoked_before = true; // Test that the requested iteration count is respected. - assert(st.max_iterations == 42); + assert(state.max_iterations == 42); size_t actual_iterations = 0; - while (st.KeepRunning()) + for (auto _ : state) ++actual_iterations; - assert(st.iterations() == st.max_iterations); - assert(st.iterations() == 42); + assert(state.iterations() == state.max_iterations); + assert(state.iterations() == 42); } BENCHMARK(BM_explicit_iteration_count)->Iterations(42); -BENCHMARK_MAIN() +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/output_test.h b/utils/google-benchmark/test/output_test.h index 57d4397ad5db5..31a919991f7c5 100644 --- a/utils/google-benchmark/test/output_test.h +++ b/utils/google-benchmark/test/output_test.h @@ -2,8 +2,10 @@ #define TEST_OUTPUT_TEST_H #undef NDEBUG +#include <functional> #include <initializer_list> #include <memory> +#include <sstream> #include <string> #include <utility> #include <vector> @@ -59,6 +61,139 @@ int SetSubstitutions( void RunOutputTests(int argc, char* argv[]); // ========================================================================= // +// ------------------------- Results checking ------------------------------ // +// ========================================================================= // + +// Call this macro to register a benchmark for checking its results. This +// should be all that's needed. It subscribes a function to check the (CSV) +// results of a benchmark. This is done only after verifying that the output +// strings are really as expected. +// bm_name_pattern: a name or a regex pattern which will be matched against +// all the benchmark names. Matching benchmarks +// will be the subject of a call to checker_function +// checker_function: should be of type ResultsCheckFn (see below) +#define CHECK_BENCHMARK_RESULTS(bm_name_pattern, checker_function) \ + size_t CONCAT(dummy, __LINE__) = AddChecker(bm_name_pattern, checker_function) + +struct Results; +typedef std::function<void(Results const&)> ResultsCheckFn; + +size_t AddChecker(const char* bm_name_pattern, ResultsCheckFn fn); + +// Class holding the results of a benchmark. +// It is passed in calls to checker functions. +struct Results { + // the benchmark name + std::string name; + // the benchmark fields + std::map<std::string, std::string> values; + + Results(const std::string& n) : name(n) {} + + int NumThreads() const; + + double NumIterations() const; + + typedef enum { kCpuTime, kRealTime } BenchmarkTime; + + // get cpu_time or real_time in seconds + double GetTime(BenchmarkTime which) const; + + // get the real_time duration of the benchmark in seconds. + // it is better to use fuzzy float checks for this, as the float + // ASCII formatting is lossy. + double DurationRealTime() const { + return NumIterations() * GetTime(kRealTime); + } + // get the cpu_time duration of the benchmark in seconds + double DurationCPUTime() const { + return NumIterations() * GetTime(kCpuTime); + } + + // get the string for a result by name, or nullptr if the name + // is not found + const std::string* Get(const char* entry_name) const { + auto it = values.find(entry_name); + if (it == values.end()) return nullptr; + return &it->second; + } + + // get a result by name, parsed as a specific type. + // NOTE: for counters, use GetCounterAs instead. + template <class T> + T GetAs(const char* entry_name) const; + + // counters are written as doubles, so they have to be read first + // as a double, and only then converted to the asked type. + template <class T> + T GetCounterAs(const char* entry_name) const { + double dval = GetAs<double>(entry_name); + T tval = static_cast<T>(dval); + return tval; + } +}; + +template <class T> +T Results::GetAs(const char* entry_name) const { + auto* sv = Get(entry_name); + CHECK(sv != nullptr && !sv->empty()); + std::stringstream ss; + ss << *sv; + T out; + ss >> out; + CHECK(!ss.fail()); + return out; +} + +//---------------------------------- +// Macros to help in result checking. Do not use them with arguments causing +// side-effects. + +// clang-format off + +#define _CHECK_RESULT_VALUE(entry, getfn, var_type, var_name, relationship, value) \ + CONCAT(CHECK_, relationship) \ + (entry.getfn< var_type >(var_name), (value)) << "\n" \ + << __FILE__ << ":" << __LINE__ << ": " << (entry).name << ":\n" \ + << __FILE__ << ":" << __LINE__ << ": " \ + << "expected (" << #var_type << ")" << (var_name) \ + << "=" << (entry).getfn< var_type >(var_name) \ + << " to be " #relationship " to " << (value) << "\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) \ + CONCAT(CHECK_FLOAT_, relationship) \ + (entry.getfn< var_type >(var_name), (value), (eps_factor) * (value)) << "\n" \ + << __FILE__ << ":" << __LINE__ << ": " << (entry).name << ":\n" \ + << __FILE__ << ":" << __LINE__ << ": " \ + << "expected (" << #var_type << ")" << (var_name) \ + << "=" << (entry).getfn< var_type >(var_name) \ + << " to be " #relationship " to " << (value) << "\n" \ + << __FILE__ << ":" << __LINE__ << ": " \ + << "with tolerance of " << (eps_factor) * (value) \ + << " (" << (eps_factor)*100. << "%), " \ + << "but delta was " << ((entry).getfn< var_type >(var_name) - (value)) \ + << " (" << (((entry).getfn< var_type >(var_name) - (value)) \ + / \ + ((value) > 1.e-5 || value < -1.e-5 ? value : 1.e-5)*100.) \ + << "%)" + +#define CHECK_RESULT_VALUE(entry, var_type, var_name, relationship, value) \ + _CHECK_RESULT_VALUE(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) + +#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) + +#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) + +// clang-format on + +// ========================================================================= // // --------------------------- Misc Utilities ------------------------------ // // ========================================================================= // diff --git a/utils/google-benchmark/test/output_test_helper.cc b/utils/google-benchmark/test/output_test_helper.cc index 54c028a67ba3b..394c4f5d1a26e 100644 --- a/utils/google-benchmark/test/output_test_helper.cc +++ b/utils/google-benchmark/test/output_test_helper.cc @@ -1,8 +1,10 @@ +#include <cstring> #include <iostream> #include <map> #include <memory> #include <sstream> +#include "../src/benchmark_api_internal.h" #include "../src/check.h" // NOTE: check.h is for internal use only! #include "../src/re.h" // NOTE: re.h is for internal use only #include "output_test.h" @@ -31,22 +33,32 @@ TestCaseList& GetTestCaseList(TestCaseID ID) { SubMap& GetSubstitutions() { // Don't use 'dec_re' from header because it may not yet be initialized. + // clang-format off static std::string safe_dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?"; static SubMap map = { {"%float", "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?"}, + // human-readable float + {"%hrfloat", "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?[kMGTPEZYmunpfazy]?"}, {"%int", "[ ]*[0-9]+"}, {" %s ", "[ ]+"}, - {"%time", "[ ]*[0-9]{1,5} ns"}, - {"%console_report", "[ ]*[0-9]{1,5} ns [ ]*[0-9]{1,5} ns [ ]*[0-9]+"}, + {"%time", "[ ]*[0-9]{1,6} ns"}, + {"%console_report", "[ ]*[0-9]{1,6} ns [ ]*[0-9]{1,6} ns [ ]*[0-9]+"}, {"%console_us_report", "[ ]*[0-9] us [ ]*[0-9] us [ ]*[0-9]+"}, + {"%csv_header", + "name,iterations,real_time,cpu_time,time_unit,bytes_per_second," + "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_bytes_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns," + safe_dec_re + ",,,,"}, {"%csv_items_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,," + safe_dec_re + ",,,"}, + {"%csv_bytes_items_report", + "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns," + safe_dec_re + + "," + safe_dec_re + ",,,"}, {"%csv_label_report_begin", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,,,"}, {"%csv_label_report_end", ",,"}}; + // clang-format on return map; } @@ -137,11 +149,182 @@ class TestReporter : public benchmark::BenchmarkReporter { } private: - std::vector<benchmark::BenchmarkReporter *> reporters_; + std::vector<benchmark::BenchmarkReporter*> reporters_; }; +} // namespace + +} // end namespace internal + +// ========================================================================= // +// -------------------------- Results checking ----------------------------- // +// ========================================================================= // + +namespace internal { + +// Utility class to manage subscribers for checking benchmark results. +// It works by parsing the CSV output to read the results. +class ResultsChecker { + public: + struct PatternAndFn : public TestCase { // reusing TestCase for its regexes + PatternAndFn(const std::string& rx, ResultsCheckFn fn_) + : TestCase(rx), fn(fn_) {} + ResultsCheckFn fn; + }; + + std::vector<PatternAndFn> check_patterns; + std::vector<Results> results; + std::vector<std::string> field_names; + + void Add(const std::string& entry_pattern, ResultsCheckFn fn); + + void CheckResults(std::stringstream& output); + + private: + void SetHeader_(const std::string& csv_header); + void SetValues_(const std::string& entry_csv_line); + + std::vector<std::string> SplitCsv_(const std::string& line); +}; + +// store the static ResultsChecker in a function to prevent initialization +// order problems +ResultsChecker& GetResultsChecker() { + static ResultsChecker rc; + return rc; +} + +// add a results checker for a benchmark +void ResultsChecker::Add(const std::string& entry_pattern, ResultsCheckFn fn) { + check_patterns.emplace_back(entry_pattern, fn); +} + +// check the results of all subscribed benchmarks +void ResultsChecker::CheckResults(std::stringstream& output) { + // first reset the stream to the start + { + auto start = std::ios::streampos(0); + // clear before calling tellg() + output.clear(); + // seek to zero only when needed + if (output.tellg() > start) output.seekg(start); + // and just in case + output.clear(); + } + // now go over every line and publish it to the ResultsChecker + std::string line; + bool on_first = true; + while (output.eof() == false) { + CHECK(output.good()); + std::getline(output, line); + if (on_first) { + SetHeader_(line); // this is important + on_first = false; + continue; + } + SetValues_(line); + } + // finally we can call the subscribed check functions + for (const auto& p : check_patterns) { + VLOG(2) << "--------------------------------\n"; + VLOG(2) << "checking for benchmarks matching " << p.regex_str << "...\n"; + for (const auto& r : results) { + if (!p.regex->Match(r.name)) { + VLOG(2) << p.regex_str << " is not matched by " << r.name << "\n"; + continue; + } else { + VLOG(2) << p.regex_str << " is matched by " << r.name << "\n"; + } + VLOG(1) << "Checking results of " << r.name << ": ... \n"; + p.fn(r); + VLOG(1) << "Checking results of " << r.name << ": OK.\n"; + } + } +} + +// prepare for the names in this header +void ResultsChecker::SetHeader_(const std::string& csv_header) { + field_names = SplitCsv_(csv_header); +} + +// set the values for a benchmark +void ResultsChecker::SetValues_(const std::string& entry_csv_line) { + if (entry_csv_line.empty()) return; // some lines are empty + CHECK(!field_names.empty()); + auto vals = SplitCsv_(entry_csv_line); + CHECK_EQ(vals.size(), field_names.size()); + results.emplace_back(vals[0]); // vals[0] is the benchmark name + auto& entry = results.back(); + for (size_t i = 1, e = vals.size(); i < e; ++i) { + entry.values[field_names[i]] = vals[i]; + } +} + +// a quick'n'dirty csv splitter (eliminating quotes) +std::vector<std::string> ResultsChecker::SplitCsv_(const std::string& line) { + std::vector<std::string> out; + if (line.empty()) return out; + if (!field_names.empty()) out.reserve(field_names.size()); + size_t prev = 0, pos = line.find_first_of(','), curr = pos; + while (pos != line.npos) { + CHECK(curr > 0); + if (line[prev] == '"') ++prev; + if (line[curr - 1] == '"') --curr; + out.push_back(line.substr(prev, curr - prev)); + prev = pos + 1; + pos = line.find_first_of(',', pos + 1); + curr = pos; + } + curr = line.size(); + if (line[prev] == '"') ++prev; + if (line[curr - 1] == '"') --curr; + out.push_back(line.substr(prev, curr - prev)); + return out; } + } // end namespace internal +size_t AddChecker(const char* bm_name, ResultsCheckFn fn) { + auto& rc = internal::GetResultsChecker(); + rc.Add(bm_name, fn); + return rc.results.size(); +} + +int Results::NumThreads() const { + auto pos = name.find("/threads:"); + if (pos == name.npos) return 1; + auto end = name.find('/', pos + 9); + std::stringstream ss; + ss << name.substr(pos + 9, end); + int num = 1; + ss >> num; + CHECK(!ss.fail()); + return num; +} + +double Results::NumIterations() const { + return GetAs<double>("iterations"); +} + +double Results::GetTime(BenchmarkTime which) const { + CHECK(which == kCpuTime || which == kRealTime); + const char* which_str = which == kCpuTime ? "cpu_time" : "real_time"; + double val = GetAs<double>(which_str); + auto unit = Get("time_unit"); + CHECK(unit); + if (*unit == "ns") { + return val * 1.e-9; + } else if (*unit == "us") { + return val * 1.e-6; + } else if (*unit == "ms") { + return val * 1.e-3; + } else if (*unit == "s") { + return val; + } else { + CHECK(1 == 0) << "unknown time unit: " << *unit; + return 0; + } +} + // ========================================================================= // // -------------------------- Public API Definitions------------------------ // // ========================================================================= // @@ -152,7 +335,7 @@ TestCase::TestCase(std::string re, int rule) substituted_regex(internal::PerformSubstitutions(regex_str)), regex(std::make_shared<benchmark::Regex>()) { std::string err_str; - regex->Init(substituted_regex,& err_str); + regex->Init(substituted_regex, &err_str); CHECK(err_str.empty()) << "Could not construct regex \"" << substituted_regex << "\"" << "\n originally \"" << regex_str << "\"" @@ -186,7 +369,8 @@ int SetSubstitutions( void RunOutputTests(int argc, char* argv[]) { using internal::GetTestCaseList; benchmark::Initialize(&argc, argv); - benchmark::ConsoleReporter CR(benchmark::ConsoleReporter::OO_None); + auto options = benchmark::internal::GetOutputOptions(/*force_no_color*/ true); + benchmark::ConsoleReporter CR(options); benchmark::JSONReporter JR; benchmark::CSVReporter CSVR; struct ReporterTest { @@ -231,4 +415,11 @@ void RunOutputTests(int argc, char* argv[]) { std::cout << "\n"; } + + // now that we know the output is as expected, we can dispatch + // the checks to subscribees. + auto& csv = TestCases[2]; + // would use == but gcc spits a warning + CHECK(std::strcmp(csv.name, "CSVReporter") == 0); + internal::GetResultsChecker().CheckResults(csv.out_stream); } diff --git a/utils/google-benchmark/test/register_benchmark_test.cc b/utils/google-benchmark/test/register_benchmark_test.cc index e9f8ea530c100..18de6d68e210b 100644 --- a/utils/google-benchmark/test/register_benchmark_test.cc +++ b/utils/google-benchmark/test/register_benchmark_test.cc @@ -29,6 +29,7 @@ struct TestCase { typedef benchmark::BenchmarkReporter::Run Run; void CheckRun(Run const& run) const { + // clang-format off CHECK(name == run.benchmark_name) << "expected " << name << " got " << run.benchmark_name; if (label) { @@ -37,6 +38,7 @@ struct TestCase { } else { CHECK(run.report_label == ""); } + // clang-format on } }; @@ -61,7 +63,7 @@ typedef benchmark::internal::Benchmark* ReturnVal; // Test RegisterBenchmark with no additional arguments //----------------------------------------------------------------------------// void BM_function(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_function); @@ -77,7 +79,7 @@ ADD_CASES({"BM_function"}, {"BM_function_manual_registration"}); #ifndef BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK void BM_extra_args(benchmark::State& st, const char* label) { - while (st.KeepRunning()) { + for (auto _ : st) { } st.SetLabel(label); } @@ -99,7 +101,7 @@ ADD_CASES({"test1", "One"}, {"test2", "Two"}, {"test3", "Three"}); struct CustomFixture { void operator()(benchmark::State& st) { - while (st.KeepRunning()) { + for (auto _ : st) { } } }; @@ -114,23 +116,23 @@ void TestRegistrationAtRuntime() { #endif #ifndef BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK { - int x = 42; + const char* x = "42"; auto capturing_lam = [=](benchmark::State& st) { - while (st.KeepRunning()) { + for (auto _ : st) { } - st.SetLabel(std::to_string(x)); + st.SetLabel(x); }; benchmark::RegisterBenchmark("lambda_benchmark", capturing_lam); - AddCases({{"lambda_benchmark", "42"}}); + AddCases({{"lambda_benchmark", x}}); } #endif } -int main(int argc, char* argv[]) { +// Test that all benchmarks, registered at either during static init or runtime, +// are run and the results are passed to the reported. +void RunTestOne() { TestRegistrationAtRuntime(); - benchmark::Initialize(&argc, argv); - TestReporter test_reporter; benchmark::RunSpecifiedBenchmarks(&test_reporter); @@ -143,6 +145,40 @@ int main(int argc, char* argv[]) { ++EB; } assert(EB == ExpectedResults.end()); +} - return 0; +// Test that ClearRegisteredBenchmarks() clears all previously registered +// benchmarks. +// Also test that new benchmarks can be registered and ran afterwards. +void RunTestTwo() { + assert(ExpectedResults.size() != 0 && + "must have at least one registered benchmark"); + ExpectedResults.clear(); + benchmark::ClearRegisteredBenchmarks(); + + TestReporter test_reporter; + size_t num_ran = benchmark::RunSpecifiedBenchmarks(&test_reporter); + assert(num_ran == 0); + assert(test_reporter.all_runs_.begin() == test_reporter.all_runs_.end()); + + TestRegistrationAtRuntime(); + num_ran = benchmark::RunSpecifiedBenchmarks(&test_reporter); + assert(num_ran == ExpectedResults.size()); + + typedef benchmark::BenchmarkReporter::Run Run; + auto EB = ExpectedResults.begin(); + + for (Run const& run : test_reporter.all_runs_) { + assert(EB != ExpectedResults.end()); + EB->CheckRun(run); + ++EB; + } + assert(EB == ExpectedResults.end()); +} + +int main(int argc, char* argv[]) { + benchmark::Initialize(&argc, argv); + + RunTestOne(); + RunTestTwo(); } diff --git a/utils/google-benchmark/test/reporter_output_test.cc b/utils/google-benchmark/test/reporter_output_test.cc index cb52aec0c0820..1662fcb8b5433 100644 --- a/utils/google-benchmark/test/reporter_output_test.cc +++ b/utils/google-benchmark/test/reporter_output_test.cc @@ -9,20 +9,55 @@ // ---------------------- Testing Prologue Output -------------------------- // // ========================================================================= // -ADD_CASES(TC_ConsoleOut, - {{"^[-]+$", MR_Next}, - {"^Benchmark %s Time %s CPU %s Iterations$", MR_Next}, - {"^[-]+$", MR_Next}}); -ADD_CASES(TC_CSVOut, - {{"name,iterations,real_time,cpu_time,time_unit,bytes_per_second," - "items_per_second,label,error_occurred,error_message"}}); +ADD_CASES(TC_ConsoleOut, {{"^[-]+$", MR_Next}, + {"^Benchmark %s Time %s CPU %s Iterations$", MR_Next}, + {"^[-]+$", MR_Next}}); +static int AddContextCases() { + AddCases(TC_ConsoleErr, + { + {"%int[-/]%int[-/]%int %int:%int:%int$", MR_Default}, + {"Running .*/reporter_output_test(\\.exe)?$", MR_Next}, + {"Run on \\(%int X %float MHz CPU s\\)", MR_Next}, + }); + AddCases(TC_JSONOut, + {{"^\\{", MR_Default}, + {"\"context\":", MR_Next}, + {"\"date\": \"", MR_Next}, + {"\"executable\": \".*/reporter_output_test(\\.exe)?\",", MR_Next}, + {"\"num_cpus\": %int,$", MR_Next}, + {"\"mhz_per_cpu\": %float,$", MR_Next}, + {"\"cpu_scaling_enabled\": ", MR_Next}, + {"\"caches\": \\[$", MR_Next}}); + auto const& Caches = benchmark::CPUInfo::Get().caches; + if (!Caches.empty()) { + AddCases(TC_ConsoleErr, {{"CPU Caches:$", MR_Next}}); + } + 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_JSONOut, {{"\\{$", MR_Next}, + {"\"type\": \"", MR_Next}, + {"\"level\": %int,$", MR_Next}, + {"\"size\": %int,$", MR_Next}, + {"\"num_sharing\": %int$", MR_Next}, + {"}[,]{0,1}$", MR_Next}}); + } + + AddCases(TC_JSONOut, {{"],$"}}); + return 0; +} +int dummy_register = AddContextCases(); +ADD_CASES(TC_CSVOut, {{"%csv_header"}}); // ========================================================================= // // ------------------------ Testing Basic Output --------------------------- // // ========================================================================= // void BM_basic(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_basic); @@ -30,8 +65,8 @@ BENCHMARK(BM_basic); ADD_CASES(TC_ConsoleOut, {{"^BM_basic %console_report$"}}); ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_basic\",$"}, {"\"iterations\": %int,$", MR_Next}, - {"\"real_time\": %int,$", MR_Next}, - {"\"cpu_time\": %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_basic\",%csv_report$"}}); @@ -41,20 +76,20 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_basic\",%csv_report$"}}); // ========================================================================= // void BM_bytes_per_second(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } state.SetBytesProcessed(1); } BENCHMARK(BM_bytes_per_second); ADD_CASES(TC_ConsoleOut, - {{"^BM_bytes_per_second %console_report +%floatB/s$"}}); + {{"^BM_bytes_per_second %console_report +%float[kM]{0,1}B/s$"}}); ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_bytes_per_second\",$"}, {"\"iterations\": %int,$", MR_Next}, - {"\"real_time\": %int,$", MR_Next}, - {"\"cpu_time\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, {"\"time_unit\": \"ns\",$", MR_Next}, - {"\"bytes_per_second\": %int$", MR_Next}, + {"\"bytes_per_second\": %float$", MR_Next}, {"}", MR_Next}}); ADD_CASES(TC_CSVOut, {{"^\"BM_bytes_per_second\",%csv_bytes_report$"}}); @@ -63,20 +98,20 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_bytes_per_second\",%csv_bytes_report$"}}); // ========================================================================= // void BM_items_per_second(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } state.SetItemsProcessed(1); } BENCHMARK(BM_items_per_second); ADD_CASES(TC_ConsoleOut, - {{"^BM_items_per_second %console_report +%float items/s$"}}); + {{"^BM_items_per_second %console_report +%float[kM]{0,1} items/s$"}}); ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_items_per_second\",$"}, {"\"iterations\": %int,$", MR_Next}, - {"\"real_time\": %int,$", MR_Next}, - {"\"cpu_time\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, {"\"time_unit\": \"ns\",$", MR_Next}, - {"\"items_per_second\": %int$", MR_Next}, + {"\"items_per_second\": %float$", MR_Next}, {"}", MR_Next}}); ADD_CASES(TC_CSVOut, {{"^\"BM_items_per_second\",%csv_items_report$"}}); @@ -85,7 +120,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_items_per_second\",%csv_items_report$"}}); // ========================================================================= // void BM_label(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } state.SetLabel("some label"); } @@ -94,8 +129,8 @@ BENCHMARK(BM_label); ADD_CASES(TC_ConsoleOut, {{"^BM_label %console_report some label$"}}); ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_label\",$"}, {"\"iterations\": %int,$", MR_Next}, - {"\"real_time\": %int,$", MR_Next}, - {"\"cpu_time\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, {"\"time_unit\": \"ns\",$", MR_Next}, {"\"label\": \"some label\"$", MR_Next}, {"}", MR_Next}}); @@ -108,7 +143,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_label\",%csv_label_report_begin\"some " void BM_error(benchmark::State& state) { state.SkipWithError("message"); - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_error); @@ -125,7 +160,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_error\",,,,,,,,true,\"message\"$"}}); // ========================================================================= // void BM_no_arg_name(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_no_arg_name)->Arg(3); @@ -138,7 +173,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_no_arg_name/3\",%csv_report$"}}); // ========================================================================= // void BM_arg_name(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_arg_name)->ArgName("first")->Arg(3); @@ -151,7 +186,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_arg_name/first:3\",%csv_report$"}}); // ========================================================================= // void BM_arg_names(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_arg_names)->Args({2, 5, 4})->ArgNames({"first", "", "third"}); @@ -165,7 +200,7 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_arg_names/first:2/5/third:4\",%csv_report$"}}); // ========================================================================= // void BM_Complexity_O1(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } state.SetComplexityN(state.range(0)); } @@ -181,30 +216,74 @@ ADD_CASES(TC_ConsoleOut, {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"}, // Test that non-aggregate data is printed by default void BM_Repeat(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } +// need two repetitions min to be able to output any aggregate output +BENCHMARK(BM_Repeat)->Repetitions(2); +ADD_CASES(TC_ConsoleOut, {{"^BM_Repeat/repeats:2 %console_report$"}, + {"^BM_Repeat/repeats:2 %console_report$"}, + {"^BM_Repeat/repeats:2_mean %console_report$"}, + {"^BM_Repeat/repeats:2_median %console_report$"}, + {"^BM_Repeat/repeats:2_stddev %console_report$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:2\",$"}, + {"\"name\": \"BM_Repeat/repeats:2\",$"}, + {"\"name\": \"BM_Repeat/repeats:2_mean\",$"}, + {"\"name\": \"BM_Repeat/repeats:2_median\",$"}, + {"\"name\": \"BM_Repeat/repeats:2_stddev\",$"}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:2\",%csv_report$"}, + {"^\"BM_Repeat/repeats:2\",%csv_report$"}, + {"^\"BM_Repeat/repeats:2_mean\",%csv_report$"}, + {"^\"BM_Repeat/repeats:2_median\",%csv_report$"}, + {"^\"BM_Repeat/repeats:2_stddev\",%csv_report$"}}); +// but for two repetitions, mean and median is the same, so let's repeat.. BENCHMARK(BM_Repeat)->Repetitions(3); ADD_CASES(TC_ConsoleOut, {{"^BM_Repeat/repeats:3 %console_report$"}, {"^BM_Repeat/repeats:3 %console_report$"}, {"^BM_Repeat/repeats:3 %console_report$"}, {"^BM_Repeat/repeats:3_mean %console_report$"}, + {"^BM_Repeat/repeats:3_median %console_report$"}, {"^BM_Repeat/repeats:3_stddev %console_report$"}}); ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:3\",$"}, {"\"name\": \"BM_Repeat/repeats:3\",$"}, {"\"name\": \"BM_Repeat/repeats:3\",$"}, {"\"name\": \"BM_Repeat/repeats:3_mean\",$"}, + {"\"name\": \"BM_Repeat/repeats:3_median\",$"}, {"\"name\": \"BM_Repeat/repeats:3_stddev\",$"}}); ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:3\",%csv_report$"}, {"^\"BM_Repeat/repeats:3\",%csv_report$"}, {"^\"BM_Repeat/repeats:3\",%csv_report$"}, {"^\"BM_Repeat/repeats:3_mean\",%csv_report$"}, + {"^\"BM_Repeat/repeats:3_median\",%csv_report$"}, {"^\"BM_Repeat/repeats:3_stddev\",%csv_report$"}}); +// median differs between even/odd number of repetitions, so just to be sure +BENCHMARK(BM_Repeat)->Repetitions(4); +ADD_CASES(TC_ConsoleOut, {{"^BM_Repeat/repeats:4 %console_report$"}, + {"^BM_Repeat/repeats:4 %console_report$"}, + {"^BM_Repeat/repeats:4 %console_report$"}, + {"^BM_Repeat/repeats:4 %console_report$"}, + {"^BM_Repeat/repeats:4_mean %console_report$"}, + {"^BM_Repeat/repeats:4_median %console_report$"}, + {"^BM_Repeat/repeats:4_stddev %console_report$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Repeat/repeats:4\",$"}, + {"\"name\": \"BM_Repeat/repeats:4\",$"}, + {"\"name\": \"BM_Repeat/repeats:4\",$"}, + {"\"name\": \"BM_Repeat/repeats:4\",$"}, + {"\"name\": \"BM_Repeat/repeats:4_mean\",$"}, + {"\"name\": \"BM_Repeat/repeats:4_median\",$"}, + {"\"name\": \"BM_Repeat/repeats:4_stddev\",$"}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_Repeat/repeats:4\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4_mean\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4_median\",%csv_report$"}, + {"^\"BM_Repeat/repeats:4_stddev\",%csv_report$"}}); // Test that a non-repeated test still prints non-aggregate results even when // only-aggregate reports have been requested void BM_RepeatOnce(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_RepeatOnce)->Repetitions(1)->ReportAggregatesOnly(); @@ -214,23 +293,26 @@ ADD_CASES(TC_CSVOut, {{"^\"BM_RepeatOnce/repeats:1\",%csv_report$"}}); // Test that non-aggregate data is not reported void BM_SummaryRepeat(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_SummaryRepeat)->Repetitions(3)->ReportAggregatesOnly(); ADD_CASES(TC_ConsoleOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not}, {"^BM_SummaryRepeat/repeats:3_mean %console_report$"}, + {"^BM_SummaryRepeat/repeats:3_median %console_report$"}, {"^BM_SummaryRepeat/repeats:3_stddev %console_report$"}}); ADD_CASES(TC_JSONOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not}, {"\"name\": \"BM_SummaryRepeat/repeats:3_mean\",$"}, + {"\"name\": \"BM_SummaryRepeat/repeats:3_median\",$"}, {"\"name\": \"BM_SummaryRepeat/repeats:3_stddev\",$"}}); ADD_CASES(TC_CSVOut, {{".*BM_SummaryRepeat/repeats:3 ", MR_Not}, {"^\"BM_SummaryRepeat/repeats:3_mean\",%csv_report$"}, + {"^\"BM_SummaryRepeat/repeats:3_median\",%csv_report$"}, {"^\"BM_SummaryRepeat/repeats:3_stddev\",%csv_report$"}}); void BM_RepeatTimeUnit(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { } } BENCHMARK(BM_RepeatTimeUnit) @@ -240,18 +322,63 @@ BENCHMARK(BM_RepeatTimeUnit) ADD_CASES(TC_ConsoleOut, {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not}, {"^BM_RepeatTimeUnit/repeats:3_mean %console_us_report$"}, + {"^BM_RepeatTimeUnit/repeats:3_median %console_us_report$"}, {"^BM_RepeatTimeUnit/repeats:3_stddev %console_us_report$"}}); ADD_CASES(TC_JSONOut, {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not}, {"\"name\": \"BM_RepeatTimeUnit/repeats:3_mean\",$"}, {"\"time_unit\": \"us\",?$"}, + {"\"name\": \"BM_RepeatTimeUnit/repeats:3_median\",$"}, + {"\"time_unit\": \"us\",?$"}, {"\"name\": \"BM_RepeatTimeUnit/repeats:3_stddev\",$"}, {"\"time_unit\": \"us\",?$"}}); ADD_CASES(TC_CSVOut, {{".*BM_RepeatTimeUnit/repeats:3 ", MR_Not}, {"^\"BM_RepeatTimeUnit/repeats:3_mean\",%csv_us_report$"}, + {"^\"BM_RepeatTimeUnit/repeats:3_median\",%csv_us_report$"}, {"^\"BM_RepeatTimeUnit/repeats:3_stddev\",%csv_us_report$"}}); // ========================================================================= // +// -------------------- Testing user-provided statistics ------------------- // +// ========================================================================= // + +const auto UserStatistics = [](const std::vector<double>& v) { + return v.back(); +}; +void BM_UserStats(benchmark::State& state) { + for (auto _ : state) { + } +} +// clang-format off +BENCHMARK(BM_UserStats) + ->Repetitions(3) + ->ComputeStatistics("", UserStatistics); +// clang-format on + +// check that user-provided stats is calculated, and is after the default-ones +// empty string as name is intentional, it would sort before anything else +ADD_CASES(TC_ConsoleOut, {{"^BM_UserStats/repeats:3 %console_report$"}, + {"^BM_UserStats/repeats:3 %console_report$"}, + {"^BM_UserStats/repeats:3 %console_report$"}, + {"^BM_UserStats/repeats:3_mean %console_report$"}, + {"^BM_UserStats/repeats:3_median %console_report$"}, + {"^BM_UserStats/repeats:3_stddev %console_report$"}, + {"^BM_UserStats/repeats:3_ %console_report$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_UserStats/repeats:3\",$"}, + {"\"name\": \"BM_UserStats/repeats:3\",$"}, + {"\"name\": \"BM_UserStats/repeats:3\",$"}, + {"\"name\": \"BM_UserStats/repeats:3_mean\",$"}, + {"\"name\": \"BM_UserStats/repeats:3_median\",$"}, + {"\"name\": \"BM_UserStats/repeats:3_stddev\",$"}, + {"\"name\": \"BM_UserStats/repeats:3_\",$"}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_UserStats/repeats:3\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3_mean\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3_median\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3_stddev\",%csv_report$"}, + {"^\"BM_UserStats/repeats:3_\",%csv_report$"}}); + +// ========================================================================= // // --------------------------- TEST CASES END ------------------------------ // // ========================================================================= // diff --git a/utils/google-benchmark/test/skip_with_error_test.cc b/utils/google-benchmark/test/skip_with_error_test.cc index b74d33c5899c4..39785fb7f6d8f 100644 --- a/utils/google-benchmark/test/skip_with_error_test.cc +++ b/utils/google-benchmark/test/skip_with_error_test.cc @@ -33,8 +33,8 @@ struct TestCase { typedef benchmark::BenchmarkReporter::Run Run; void CheckRun(Run const& run) const { - CHECK(name == run.benchmark_name) << "expected " << name << " got " - << run.benchmark_name; + CHECK(name == run.benchmark_name) + << "expected " << name << " got " << run.benchmark_name; CHECK(error_occurred == run.error_occurred); CHECK(error_message == run.error_message); if (error_occurred) { @@ -70,6 +70,24 @@ void BM_error_before_running(benchmark::State& state) { BENCHMARK(BM_error_before_running); ADD_CASES("BM_error_before_running", {{"", true, "error message"}}); +void BM_error_before_running_batch(benchmark::State& state) { + state.SkipWithError("error message"); + while (state.KeepRunningBatch(17)) { + assert(false); + } +} +BENCHMARK(BM_error_before_running_batch); +ADD_CASES("BM_error_before_running_batch", {{"", true, "error message"}}); + +void BM_error_before_running_range_for(benchmark::State& state) { + state.SkipWithError("error message"); + for (auto _ : state) { + assert(false); + } +} +BENCHMARK(BM_error_before_running_range_for); +ADD_CASES("BM_error_before_running_range_for", {{"", true, "error message"}}); + void BM_error_during_running(benchmark::State& state) { int first_iter = true; while (state.KeepRunning()) { @@ -93,8 +111,29 @@ ADD_CASES("BM_error_during_running", {{"/1/threads:1", true, "error message"}, {"/2/threads:4", false, ""}, {"/2/threads:8", false, ""}}); +void BM_error_during_running_ranged_for(benchmark::State& state) { + assert(state.max_iterations > 3 && "test requires at least a few iterations"); + int first_iter = true; + // NOTE: Users should not write the for loop explicitly. + for (auto It = state.begin(), End = state.end(); It != End; ++It) { + if (state.range(0) == 1) { + assert(first_iter); + first_iter = false; + state.SkipWithError("error message"); + // Test the unfortunate but documented behavior that the ranged-for loop + // doesn't automatically terminate when SkipWithError is set. + assert(++It != End); + break; // Required behavior + } + } +} +BENCHMARK(BM_error_during_running_ranged_for)->Arg(1)->Arg(2)->Iterations(5); +ADD_CASES("BM_error_during_running_ranged_for", + {{"/1/iterations:5", true, "error message"}, + {"/2/iterations:5", false, ""}}); + void BM_error_after_running(benchmark::State& state) { - while (state.KeepRunning()) { + for (auto _ : state) { benchmark::DoNotOptimize(state.iterations()); } if (state.thread_index <= (state.threads / 2)) diff --git a/utils/google-benchmark/test/state_assembly_test.cc b/utils/google-benchmark/test/state_assembly_test.cc new file mode 100644 index 0000000000000..abe9a4ddb56dd --- /dev/null +++ b/utils/google-benchmark/test/state_assembly_test.cc @@ -0,0 +1,68 @@ +#include <benchmark/benchmark.h> + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wreturn-type" +#endif + +// clang-format off +extern "C" { + extern int ExternInt; + benchmark::State& GetState(); + void Fn(); +} +// clang-format on + +using benchmark::State; + +// CHECK-LABEL: test_for_auto_loop: +extern "C" int test_for_auto_loop() { + State& S = GetState(); + int x = 42; + // CHECK: [[CALL:call(q)*]] _ZN9benchmark5State16StartKeepRunningEv + // CHECK-NEXT: testq %rbx, %rbx + // CHECK-NEXT: je [[LOOP_END:.*]] + + 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-NEXT: jne .L[[LOOP_HEAD]] + benchmark::DoNotOptimize(x); + } + // CHECK: [[LOOP_END]]: + // CHECK: [[CALL]] _ZN9benchmark5State17FinishKeepRunningEv + + // CHECK: movl $101, %eax + // CHECK: ret + return 101; +} + +// CHECK-LABEL: test_while_loop: +extern "C" int test_while_loop() { + State& S = GetState(); + int x = 42; + + // CHECK: j{{(e|mp)}} .L[[LOOP_HEADER:[a-zA-Z0-9_]+]] + // CHECK-NEXT: .L[[LOOP_BODY:[a-zA-Z0-9_]+]]: + while (S.KeepRunning()) { + // CHECK-GNU-NEXT: subq $1, %[[IREG:[a-z]+]] + // CHECK-CLANG-NEXT: {{(addq \$-1,|decq)}} %[[IREG:[a-z]+]] + // CHECK: movq %[[IREG]], [[DEST:.*]] + benchmark::DoNotOptimize(x); + } + // CHECK-DAG: movq [[DEST]], %[[IREG]] + // CHECK-DAG: testq %[[IREG]], %[[IREG]] + // CHECK-DAG: jne .L[[LOOP_BODY]] + // CHECK-DAG: .L[[LOOP_HEADER]]: + + // CHECK: cmpb $0 + // CHECK-NEXT: jne .L[[LOOP_END:[a-zA-Z0-9_]+]] + // CHECK: [[CALL:call(q)*]] _ZN9benchmark5State16StartKeepRunningEv + + // CHECK: .L[[LOOP_END]]: + // CHECK: [[CALL]] _ZN9benchmark5State17FinishKeepRunningEv + + // CHECK: movl $101, %eax + // CHECK: ret + return 101; +} diff --git a/utils/google-benchmark/test/statistics_gtest.cc b/utils/google-benchmark/test/statistics_gtest.cc new file mode 100644 index 0000000000000..99e314920c55c --- /dev/null +++ b/utils/google-benchmark/test/statistics_gtest.cc @@ -0,0 +1,28 @@ +//===---------------------------------------------------------------------===// +// statistics_test - Unit tests for src/statistics.cc +//===---------------------------------------------------------------------===// + +#include "../src/statistics.h" +#include "gtest/gtest.h" + +namespace { +TEST(StatisticsTest, Mean) { + EXPECT_DOUBLE_EQ(benchmark::StatisticsMean({42, 42, 42, 42}), 42.0); + EXPECT_DOUBLE_EQ(benchmark::StatisticsMean({1, 2, 3, 4}), 2.5); + EXPECT_DOUBLE_EQ(benchmark::StatisticsMean({1, 2, 5, 10, 10, 14}), 7.0); +} + +TEST(StatisticsTest, Median) { + EXPECT_DOUBLE_EQ(benchmark::StatisticsMedian({42, 42, 42, 42}), 42.0); + EXPECT_DOUBLE_EQ(benchmark::StatisticsMedian({1, 2, 3, 4}), 2.5); + EXPECT_DOUBLE_EQ(benchmark::StatisticsMedian({1, 2, 5, 10, 10}), 5.0); +} + +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); +} + +} // end namespace diff --git a/utils/google-benchmark/test/string_util_gtest.cc b/utils/google-benchmark/test/string_util_gtest.cc new file mode 100644 index 0000000000000..4c81734cf8a33 --- /dev/null +++ b/utils/google-benchmark/test/string_util_gtest.cc @@ -0,0 +1,146 @@ +//===---------------------------------------------------------------------===// +// statistics_test - Unit tests for src/statistics.cc +//===---------------------------------------------------------------------===// + +#include "../src/string_util.h" +#include "gtest/gtest.h" + +namespace { +TEST(StringUtilTest, stoul) { + { + size_t pos = 0; + EXPECT_EQ(0, benchmark::stoul("0", &pos)); + EXPECT_EQ(1, pos); + } + { + size_t pos = 0; + EXPECT_EQ(7, benchmark::stoul("7", &pos)); + EXPECT_EQ(1, pos); + } + { + size_t pos = 0; + EXPECT_EQ(135, benchmark::stoul("135", &pos)); + EXPECT_EQ(3, pos); + } +#if ULONG_MAX == 0xFFFFFFFFul + { + size_t pos = 0; + EXPECT_EQ(0xFFFFFFFFul, benchmark::stoul("4294967295", &pos)); + EXPECT_EQ(10, pos); + } +#elif ULONG_MAX == 0xFFFFFFFFFFFFFFFFul + { + size_t pos = 0; + EXPECT_EQ(0xFFFFFFFFFFFFFFFFul, benchmark::stoul("18446744073709551615", &pos)); + EXPECT_EQ(20, pos); + } +#endif + { + size_t pos = 0; + EXPECT_EQ(10, benchmark::stoul("1010", &pos, 2)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(520, benchmark::stoul("1010", &pos, 8)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(1010, benchmark::stoul("1010", &pos, 10)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(4112, benchmark::stoul("1010", &pos, 16)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(0xBEEF, benchmark::stoul("BEEF", &pos, 16)); + EXPECT_EQ(4, pos); + } + { + ASSERT_THROW(benchmark::stoul("this is a test"), std::invalid_argument); + } +} + +TEST(StringUtilTest, stoi) { + { + size_t pos = 0; + EXPECT_EQ(0, benchmark::stoi("0", &pos)); + EXPECT_EQ(1, pos); + } + { + size_t pos = 0; + EXPECT_EQ(-17, benchmark::stoi("-17", &pos)); + EXPECT_EQ(3, pos); + } + { + size_t pos = 0; + EXPECT_EQ(1357, benchmark::stoi("1357", &pos)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(10, benchmark::stoi("1010", &pos, 2)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(520, benchmark::stoi("1010", &pos, 8)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(1010, benchmark::stoi("1010", &pos, 10)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(4112, benchmark::stoi("1010", &pos, 16)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(0xBEEF, benchmark::stoi("BEEF", &pos, 16)); + EXPECT_EQ(4, pos); + } + { + ASSERT_THROW(benchmark::stoi("this is a test"), std::invalid_argument); + } +} + +TEST(StringUtilTest, stod) { + { + size_t pos = 0; + EXPECT_EQ(0.0, benchmark::stod("0", &pos)); + EXPECT_EQ(1, pos); + } + { + size_t pos = 0; + EXPECT_EQ(-84.0, benchmark::stod("-84", &pos)); + EXPECT_EQ(3, pos); + } + { + size_t pos = 0; + EXPECT_EQ(1234.0, benchmark::stod("1234", &pos)); + EXPECT_EQ(4, pos); + } + { + size_t pos = 0; + EXPECT_EQ(1.5, benchmark::stod("1.5", &pos)); + EXPECT_EQ(3, pos); + } + { + size_t pos = 0; + /* Note: exactly representable as double */ + EXPECT_EQ(-1.25e+9, benchmark::stod("-1.25e+9", &pos)); + EXPECT_EQ(8, pos); + } + { + ASSERT_THROW(benchmark::stod("this is a test"), std::invalid_argument); + } +} + +} // end namespace diff --git a/utils/google-benchmark/test/templated_fixture_test.cc b/utils/google-benchmark/test/templated_fixture_test.cc new file mode 100644 index 0000000000000..fe9865cc776f3 --- /dev/null +++ b/utils/google-benchmark/test/templated_fixture_test.cc @@ -0,0 +1,28 @@ + +#include "benchmark/benchmark.h" + +#include <cassert> +#include <memory> + +template <typename T> +class MyFixture : public ::benchmark::Fixture { + public: + MyFixture() : data(0) {} + + T data; +}; + +BENCHMARK_TEMPLATE_F(MyFixture, Foo, int)(benchmark::State& st) { + for (auto _ : st) { + data += 1; + } +} + +BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, Bar, double)(benchmark::State& st) { + for (auto _ : st) { + data += 1.0; + } +} +BENCHMARK_REGISTER_F(MyFixture, Bar); + +BENCHMARK_MAIN(); diff --git a/utils/google-benchmark/test/user_counters_tabular_test.cc b/utils/google-benchmark/test/user_counters_tabular_test.cc new file mode 100644 index 0000000000000..4f126b6d978c3 --- /dev/null +++ b/utils/google-benchmark/test/user_counters_tabular_test.cc @@ -0,0 +1,252 @@ + +#undef NDEBUG + +#include "benchmark/benchmark.h" +#include "output_test.h" + +// @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 + {"^[-]+$", 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_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_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}, + {"^[-]+$", MR_Next}, + {"^Benchmark %s Time %s CPU %s Iterations %s Bar %s Baz %s Foo$", MR_Next}, + {"^[-]+$", MR_Next}, + {"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet0_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^BM_CounterSet1_Tabular/threads:%int %console_report [ ]*%hrfloat [ ]*%hrfloat [ ]*%hrfloat$", MR_Next}, + {"^[-]+$", MR_Next}, + {"^Benchmark %s Time %s CPU %s Iterations %s Bat %s Baz %s Foo$", MR_Next}, + {"^[-]+$", 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$", 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 + }); +ADD_CASES(TC_CSVOut, {{"%csv_header," + "\"Bar\",\"Bat\",\"Baz\",\"Foo\",\"Frob\",\"Lob\""}}); + +// ========================================================================= // +// ------------------------- Tabular Counters Output ----------------------- // +// ========================================================================= // + +void BM_Counters_Tabular(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters.insert({ + {"Foo", {1, bm::Counter::kAvgThreads}}, + {"Bar", {2, bm::Counter::kAvgThreads}}, + {"Baz", {4, bm::Counter::kAvgThreads}}, + {"Bat", {8, bm::Counter::kAvgThreads}}, + {"Frob", {16, bm::Counter::kAvgThreads}}, + {"Lob", {32, bm::Counter::kAvgThreads}}, + }); +} +BENCHMARK(BM_Counters_Tabular)->ThreadRange(1, 16); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Tabular/threads:%int\",$"}, + {"\"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/threads:%int\",%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, "Foo", EQ, 1); + CHECK_COUNTER_VALUE(e, int, "Bar", EQ, 2); + CHECK_COUNTER_VALUE(e, int, "Baz", EQ, 4); + CHECK_COUNTER_VALUE(e, int, "Bat", EQ, 8); + 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); + +// ========================================================================= // +// -------------------- Tabular+Rate Counters Output ----------------------- // +// ========================================================================= // + +void BM_CounterRates_Tabular(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters.insert({ + {"Foo", {1, bm::Counter::kAvgThreadsRate}}, + {"Bar", {2, bm::Counter::kAvgThreadsRate}}, + {"Baz", {4, bm::Counter::kAvgThreadsRate}}, + {"Bat", {8, bm::Counter::kAvgThreadsRate}}, + {"Frob", {16, bm::Counter::kAvgThreadsRate}}, + {"Lob", {32, bm::Counter::kAvgThreadsRate}}, + }); +} +BENCHMARK(BM_CounterRates_Tabular)->ThreadRange(1, 16); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_CounterRates_Tabular/threads:%int\",$"}, + {"\"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_CounterRates_Tabular/threads:%int\",%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 CheckTabularRate(Results const& e) { + double t = e.DurationCPUTime(); + CHECK_FLOAT_COUNTER_VALUE(e, "Foo", EQ, 1. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "Bar", EQ, 2. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "Baz", EQ, 4. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "Bat", EQ, 8. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "Frob", EQ, 16. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "Lob", EQ, 32. / t, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_CounterRates_Tabular/threads:%int", + &CheckTabularRate); + +// ========================================================================= // +// ------------------------- Tabular Counters Output ----------------------- // +// ========================================================================= // + +// set only some of the counters +void BM_CounterSet0_Tabular(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters.insert({ + {"Foo", {10, bm::Counter::kAvgThreads}}, + {"Bar", {20, bm::Counter::kAvgThreads}}, + {"Baz", {40, bm::Counter::kAvgThreads}}, + }); +} +BENCHMARK(BM_CounterSet0_Tabular)->ThreadRange(1, 16); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_CounterSet0_Tabular/threads:%int\",$"}, + {"\"iterations\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, + {"\"time_unit\": \"ns\",$", MR_Next}, + {"\"Bar\": %float,$", MR_Next}, + {"\"Baz\": %float,$", MR_Next}, + {"\"Foo\": %float$", MR_Next}, + {"}", MR_Next}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_CounterSet0_Tabular/threads:%int\",%csv_report," + "%float,,%float,%float,,"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckSet0(Results const& e) { + CHECK_COUNTER_VALUE(e, int, "Foo", EQ, 10); + CHECK_COUNTER_VALUE(e, int, "Bar", EQ, 20); + CHECK_COUNTER_VALUE(e, int, "Baz", EQ, 40); +} +CHECK_BENCHMARK_RESULTS("BM_CounterSet0_Tabular", &CheckSet0); + +// again. +void BM_CounterSet1_Tabular(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters.insert({ + {"Foo", {15, bm::Counter::kAvgThreads}}, + {"Bar", {25, bm::Counter::kAvgThreads}}, + {"Baz", {45, bm::Counter::kAvgThreads}}, + }); +} +BENCHMARK(BM_CounterSet1_Tabular)->ThreadRange(1, 16); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_CounterSet1_Tabular/threads:%int\",$"}, + {"\"iterations\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, + {"\"time_unit\": \"ns\",$", MR_Next}, + {"\"Bar\": %float,$", MR_Next}, + {"\"Baz\": %float,$", MR_Next}, + {"\"Foo\": %float$", MR_Next}, + {"}", MR_Next}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_CounterSet1_Tabular/threads:%int\",%csv_report," + "%float,,%float,%float,,"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckSet1(Results const& e) { + CHECK_COUNTER_VALUE(e, int, "Foo", EQ, 15); + CHECK_COUNTER_VALUE(e, int, "Bar", EQ, 25); + CHECK_COUNTER_VALUE(e, int, "Baz", EQ, 45); +} +CHECK_BENCHMARK_RESULTS("BM_CounterSet1_Tabular/threads:%int", &CheckSet1); + +// ========================================================================= // +// ------------------------- Tabular Counters Output ----------------------- // +// ========================================================================= // + +// set only some of the counters, different set now. +void BM_CounterSet2_Tabular(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters.insert({ + {"Foo", {10, bm::Counter::kAvgThreads}}, + {"Bat", {30, bm::Counter::kAvgThreads}}, + {"Baz", {40, bm::Counter::kAvgThreads}}, + }); +} +BENCHMARK(BM_CounterSet2_Tabular)->ThreadRange(1, 16); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_CounterSet2_Tabular/threads:%int\",$"}, + {"\"iterations\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, + {"\"time_unit\": \"ns\",$", MR_Next}, + {"\"Bat\": %float,$", MR_Next}, + {"\"Baz\": %float,$", MR_Next}, + {"\"Foo\": %float$", MR_Next}, + {"}", MR_Next}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_CounterSet2_Tabular/threads:%int\",%csv_report," + ",%float,%float,%float,,"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckSet2(Results const& e) { + CHECK_COUNTER_VALUE(e, int, "Foo", EQ, 10); + CHECK_COUNTER_VALUE(e, int, "Bat", EQ, 30); + CHECK_COUNTER_VALUE(e, int, "Baz", EQ, 40); +} +CHECK_BENCHMARK_RESULTS("BM_CounterSet2_Tabular", &CheckSet2); + +// ========================================================================= // +// --------------------------- TEST CASES END ------------------------------ // +// ========================================================================= // + +int main(int argc, char* argv[]) { RunOutputTests(argc, argv); } diff --git a/utils/google-benchmark/test/user_counters_test.cc b/utils/google-benchmark/test/user_counters_test.cc new file mode 100644 index 0000000000000..7f7ccb9f77a3a --- /dev/null +++ b/utils/google-benchmark/test/user_counters_test.cc @@ -0,0 +1,380 @@ + +#undef NDEBUG + +#include "benchmark/benchmark.h" +#include "output_test.h" + +// ========================================================================= // +// ---------------------- Testing Prologue Output -------------------------- // +// ========================================================================= // + +// clang-format off + +ADD_CASES(TC_ConsoleOut, + {{"^[-]+$", MR_Next}, + {"^Benchmark %s Time %s CPU %s Iterations UserCounters...$", MR_Next}, + {"^[-]+$", MR_Next}}); +ADD_CASES(TC_CSVOut, {{"%csv_header,\"bar\",\"foo\""}}); + +// clang-format on + +// ========================================================================= // +// ------------------------- Simple Counters Output ------------------------ // +// ========================================================================= // + +void BM_Counters_Simple(benchmark::State& state) { + for (auto _ : state) { + } + state.counters["foo"] = 1; + state.counters["bar"] = 2 * (double)state.iterations(); +} +BENCHMARK(BM_Counters_Simple); +ADD_CASES(TC_ConsoleOut, + {{"^BM_Counters_Simple %console_report bar=%hrfloat foo=%hrfloat$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Simple\",$"}, + {"\"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_Simple\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckSimple(Results const& e) { + double its = e.NumIterations(); + CHECK_COUNTER_VALUE(e, int, "foo", EQ, 1); + // check that the value of bar is within 0.1% of the expected value + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. * its, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_Simple", &CheckSimple); + +// ========================================================================= // +// --------------------- Counters+Items+Bytes/s Output --------------------- // +// ========================================================================= // + +namespace { +int num_calls1 = 0; +} +void BM_Counters_WithBytesAndItemsPSec(benchmark::State& state) { + for (auto _ : state) { + } + state.counters["foo"] = 1; + state.counters["bar"] = ++num_calls1; + state.SetBytesProcessed(364); + state.SetItemsProcessed(150); +} +BENCHMARK(BM_Counters_WithBytesAndItemsPSec); +ADD_CASES(TC_ConsoleOut, + {{"^BM_Counters_WithBytesAndItemsPSec %console_report " + "bar=%hrfloat foo=%hrfloat +%hrfloatB/s +%hrfloat items/s$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_WithBytesAndItemsPSec\",$"}, + {"\"iterations\": %int,$", MR_Next}, + {"\"real_time\": %float,$", MR_Next}, + {"\"cpu_time\": %float,$", MR_Next}, + {"\"time_unit\": \"ns\",$", MR_Next}, + {"\"bytes_per_second\": %float,$", MR_Next}, + {"\"items_per_second\": %float,$", MR_Next}, + {"\"bar\": %float,$", MR_Next}, + {"\"foo\": %float$", MR_Next}, + {"}", MR_Next}}); +ADD_CASES(TC_CSVOut, {{"^\"BM_Counters_WithBytesAndItemsPSec\"," + "%csv_bytes_items_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckBytesAndItemsPSec(Results const& e) { + double t = e.DurationCPUTime(); // this (and not real time) is the time used + CHECK_COUNTER_VALUE(e, int, "foo", EQ, 1); + CHECK_COUNTER_VALUE(e, int, "bar", EQ, num_calls1); + // check that the values are within 0.1% of the expected values + CHECK_FLOAT_RESULT_VALUE(e, "bytes_per_second", EQ, 364. / t, 0.001); + CHECK_FLOAT_RESULT_VALUE(e, "items_per_second", EQ, 150. / t, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_WithBytesAndItemsPSec", + &CheckBytesAndItemsPSec); + +// ========================================================================= // +// ------------------------- Rate Counters Output -------------------------- // +// ========================================================================= // + +void BM_Counters_Rate(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kIsRate}; + state.counters["bar"] = bm::Counter{2, bm::Counter::kIsRate}; +} +BENCHMARK(BM_Counters_Rate); +ADD_CASES( + TC_ConsoleOut, + {{"^BM_Counters_Rate %console_report bar=%hrfloat/s foo=%hrfloat/s$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Rate\",$"}, + {"\"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_Rate\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckRate(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, 1. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. / t, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_Rate", &CheckRate); + +// ========================================================================= // +// ------------------------- Thread Counters Output ------------------------ // +// ========================================================================= // + +void BM_Counters_Threads(benchmark::State& state) { + for (auto _ : state) { + } + state.counters["foo"] = 1; + state.counters["bar"] = 2; +} +BENCHMARK(BM_Counters_Threads)->ThreadRange(1, 8); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_Threads/threads:%int %console_report " + "bar=%hrfloat foo=%hrfloat$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_Threads/threads:%int\",$"}, + {"\"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_Threads/threads:%int\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckThreads(Results const& e) { + CHECK_COUNTER_VALUE(e, int, "foo", EQ, e.NumThreads()); + CHECK_COUNTER_VALUE(e, int, "bar", EQ, 2 * e.NumThreads()); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_Threads/threads:%int", &CheckThreads); + +// ========================================================================= // +// ---------------------- ThreadAvg Counters Output ------------------------ // +// ========================================================================= // + +void BM_Counters_AvgThreads(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgThreads}; + state.counters["bar"] = bm::Counter{2, bm::Counter::kAvgThreads}; +} +BENCHMARK(BM_Counters_AvgThreads)->ThreadRange(1, 8); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_AvgThreads/threads:%int " + "%console_report bar=%hrfloat foo=%hrfloat$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_AvgThreads/threads:%int\",$"}, + {"\"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_AvgThreads/threads:%int\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckAvgThreads(Results const& e) { + CHECK_COUNTER_VALUE(e, int, "foo", EQ, 1); + CHECK_COUNTER_VALUE(e, int, "bar", EQ, 2); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_AvgThreads/threads:%int", + &CheckAvgThreads); + +// ========================================================================= // +// ---------------------- ThreadAvg Counters Output ------------------------ // +// ========================================================================= // + +void BM_Counters_AvgThreadsRate(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgThreadsRate}; + state.counters["bar"] = bm::Counter{2, bm::Counter::kAvgThreadsRate}; +} +BENCHMARK(BM_Counters_AvgThreadsRate)->ThreadRange(1, 8); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_AvgThreadsRate/threads:%int " + "%console_report bar=%hrfloat/s foo=%hrfloat/s$"}}); +ADD_CASES(TC_JSONOut, + {{"\"name\": \"BM_Counters_AvgThreadsRate/threads:%int\",$"}, + {"\"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_AvgThreadsRate/" + "threads:%int\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckAvgThreadsRate(Results const& e) { + CHECK_FLOAT_COUNTER_VALUE(e, "foo", EQ, 1. / e.DurationCPUTime(), 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. / e.DurationCPUTime(), 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_AvgThreadsRate/threads:%int", + &CheckAvgThreadsRate); + +// ========================================================================= // +// ------------------- IterationInvariant Counters Output ------------------ // +// ========================================================================= // + +void BM_Counters_IterationInvariant(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kIsIterationInvariant}; + state.counters["bar"] = bm::Counter{2, bm::Counter::kIsIterationInvariant}; +} +BENCHMARK(BM_Counters_IterationInvariant); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_IterationInvariant %console_report " + "bar=%hrfloat foo=%hrfloat$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_IterationInvariant\",$"}, + {"\"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_IterationInvariant\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckIterationInvariant(Results const& e) { + double its = e.NumIterations(); + // check that the values are within 0.1% of the expected value + CHECK_FLOAT_COUNTER_VALUE(e, "foo", EQ, its, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. * its, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_IterationInvariant", + &CheckIterationInvariant); + +// ========================================================================= // +// ----------------- IterationInvariantRate Counters Output ---------------- // +// ========================================================================= // + +void BM_Counters_kIsIterationInvariantRate(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = + bm::Counter{1, bm::Counter::kIsIterationInvariantRate}; + state.counters["bar"] = + bm::Counter{2, bm::Counter::kIsRate | bm::Counter::kIsIterationInvariant}; +} +BENCHMARK(BM_Counters_kIsIterationInvariantRate); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_kIsIterationInvariantRate " + "%console_report bar=%hrfloat/s foo=%hrfloat/s$"}}); +ADD_CASES(TC_JSONOut, + {{"\"name\": \"BM_Counters_kIsIterationInvariantRate\",$"}, + {"\"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_kIsIterationInvariantRate\",%csv_report," + "%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckIsIterationInvariantRate(Results const& e) { + double its = e.NumIterations(); + 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, its * 1. / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, its * 2. / t, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_kIsIterationInvariantRate", + &CheckIsIterationInvariantRate); + +// ========================================================================= // +// ------------------- AvgIterations Counters Output ------------------ // +// ========================================================================= // + +void BM_Counters_AvgIterations(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgIterations}; + state.counters["bar"] = bm::Counter{2, bm::Counter::kAvgIterations}; +} +BENCHMARK(BM_Counters_AvgIterations); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_AvgIterations %console_report " + "bar=%hrfloat foo=%hrfloat$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_AvgIterations\",$"}, + {"\"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_AvgIterations\",%csv_report,%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckAvgIterations(Results const& e) { + double its = e.NumIterations(); + // check that the values are within 0.1% of the expected value + CHECK_FLOAT_COUNTER_VALUE(e, "foo", EQ, 1. / its, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. / its, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_AvgIterations", &CheckAvgIterations); + +// ========================================================================= // +// ----------------- AvgIterationsRate Counters Output ---------------- // +// ========================================================================= // + +void BM_Counters_kAvgIterationsRate(benchmark::State& state) { + for (auto _ : state) { + } + namespace bm = benchmark; + state.counters["foo"] = bm::Counter{1, bm::Counter::kAvgIterationsRate}; + state.counters["bar"] = + bm::Counter{2, bm::Counter::kIsRate | bm::Counter::kAvgIterations}; +} +BENCHMARK(BM_Counters_kAvgIterationsRate); +ADD_CASES(TC_ConsoleOut, {{"^BM_Counters_kAvgIterationsRate " + "%console_report bar=%hrfloat/s foo=%hrfloat/s$"}}); +ADD_CASES(TC_JSONOut, {{"\"name\": \"BM_Counters_kAvgIterationsRate\",$"}, + {"\"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_kAvgIterationsRate\",%csv_report," + "%float,%float$"}}); +// VS2013 does not allow this function to be passed as a lambda argument +// to CHECK_BENCHMARK_RESULTS() +void CheckAvgIterationsRate(Results const& e) { + double its = e.NumIterations(); + 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, 1. / its / t, 0.001); + CHECK_FLOAT_COUNTER_VALUE(e, "bar", EQ, 2. / its / t, 0.001); +} +CHECK_BENCHMARK_RESULTS("BM_Counters_kAvgIterationsRate", + &CheckAvgIterationsRate); + +// ========================================================================= // +// --------------------------- TEST CASES END ------------------------------ // +// ========================================================================= // + +int main(int argc, char* argv[]) { RunOutputTests(argc, argv); } diff --git a/utils/google-benchmark/tools/compare.py b/utils/google-benchmark/tools/compare.py new file mode 100755 index 0000000000000..d27e24b34922c --- /dev/null +++ b/utils/google-benchmark/tools/compare.py @@ -0,0 +1,373 @@ +#!/usr/bin/env python + +""" +compare.py - versatile benchmark output compare tool +""" + +import argparse +from argparse import ArgumentParser +import sys +import gbench +from gbench import util, report +from gbench.util import * + + +def check_inputs(in1, in2, flags): + """ + Perform checking on the user provided inputs and diagnose any abnormalities + """ + in1_kind, in1_err = classify_input_file(in1) + in2_kind, in2_err = classify_input_file(in2) + output_file = find_benchmark_flag('--benchmark_out=', flags) + output_type = find_benchmark_flag('--benchmark_out_format=', flags) + if in1_kind == IT_Executable and in2_kind == IT_Executable and output_file: + print(("WARNING: '--benchmark_out=%s' will be passed to both " + "benchmarks causing it to be overwritten") % output_file) + if in1_kind == IT_JSON and in2_kind == IT_JSON and len(flags) > 0: + print("WARNING: passing optional flags has no effect since both " + "inputs are JSON") + if output_type is not None and output_type != 'json': + print(("ERROR: passing '--benchmark_out_format=%s' to 'compare.py`" + " is not supported.") % output_type) + sys.exit(1) + + +def create_parser(): + parser = ArgumentParser( + description='versatile benchmark output compare tool') + + utest = parser.add_argument_group() + utest.add_argument( + '--no-utest', + dest='utest', + default=True, + action="store_false", + help="The tool can do a two-tailed Mann-Whitney U test with the null hypothesis that it is equally likely that a randomly selected value from one sample will be less than or greater than a randomly selected value from a second sample.\nWARNING: requires **LARGE** (no less than {}) number of repetitions to be meaningful!\nThe test is being done by default, if at least {} repetitions were done.\nThis option can disable the U Test.".format(report.UTEST_OPTIMAL_REPETITIONS, report.UTEST_MIN_REPETITIONS)) + alpha_default = 0.05 + utest.add_argument( + "--alpha", + dest='utest_alpha', + default=alpha_default, + type=float, + help=("significance level alpha. if the calculated p-value is below this value, then the result is said to be statistically significant and the null hypothesis is rejected.\n(default: %0.4f)") % + alpha_default) + + subparsers = parser.add_subparsers( + help='This tool has multiple modes of operation:', + dest='mode') + + parser_a = subparsers.add_parser( + 'benchmarks', + help='The most simple use-case, compare all the output of these two benchmarks') + baseline = parser_a.add_argument_group( + 'baseline', 'The benchmark baseline') + baseline.add_argument( + 'test_baseline', + metavar='test_baseline', + type=argparse.FileType('r'), + nargs=1, + help='A benchmark executable or JSON output file') + contender = parser_a.add_argument_group( + 'contender', 'The benchmark that will be compared against the baseline') + contender.add_argument( + 'test_contender', + metavar='test_contender', + type=argparse.FileType('r'), + nargs=1, + help='A benchmark executable or JSON output file') + parser_a.add_argument( + 'benchmark_options', + metavar='benchmark_options', + nargs=argparse.REMAINDER, + help='Arguments to pass when running benchmark executables') + + parser_b = subparsers.add_parser( + 'filters', help='Compare filter one with the filter two of benchmark') + baseline = parser_b.add_argument_group( + 'baseline', 'The benchmark baseline') + baseline.add_argument( + 'test', + metavar='test', + type=argparse.FileType('r'), + nargs=1, + help='A benchmark executable or JSON output file') + baseline.add_argument( + 'filter_baseline', + metavar='filter_baseline', + type=str, + nargs=1, + help='The first filter, that will be used as baseline') + contender = parser_b.add_argument_group( + 'contender', 'The benchmark that will be compared against the baseline') + contender.add_argument( + 'filter_contender', + metavar='filter_contender', + type=str, + nargs=1, + help='The second filter, that will be compared against the baseline') + parser_b.add_argument( + 'benchmark_options', + metavar='benchmark_options', + nargs=argparse.REMAINDER, + help='Arguments to pass when running benchmark executables') + + parser_c = subparsers.add_parser( + 'benchmarksfiltered', + help='Compare filter one of first benchmark with filter two of the second benchmark') + baseline = parser_c.add_argument_group( + 'baseline', 'The benchmark baseline') + baseline.add_argument( + 'test_baseline', + metavar='test_baseline', + type=argparse.FileType('r'), + nargs=1, + help='A benchmark executable or JSON output file') + baseline.add_argument( + 'filter_baseline', + metavar='filter_baseline', + type=str, + nargs=1, + help='The first filter, that will be used as baseline') + contender = parser_c.add_argument_group( + 'contender', 'The benchmark that will be compared against the baseline') + contender.add_argument( + 'test_contender', + metavar='test_contender', + type=argparse.FileType('r'), + nargs=1, + help='The second benchmark executable or JSON output file, that will be compared against the baseline') + contender.add_argument( + 'filter_contender', + metavar='filter_contender', + type=str, + nargs=1, + help='The second filter, that will be compared against the baseline') + parser_c.add_argument( + 'benchmark_options', + metavar='benchmark_options', + nargs=argparse.REMAINDER, + help='Arguments to pass when running benchmark executables') + + return parser + + +def main(): + # Parse the command line flags + parser = create_parser() + args, unknown_args = parser.parse_known_args() + if args.mode is None: + parser.print_help() + exit(1) + assert not unknown_args + benchmark_options = args.benchmark_options + + if args.mode == 'benchmarks': + test_baseline = args.test_baseline[0].name + test_contender = args.test_contender[0].name + filter_baseline = '' + filter_contender = '' + + # NOTE: if test_baseline == test_contender, you are analyzing the stdev + + description = 'Comparing %s to %s' % (test_baseline, test_contender) + elif args.mode == 'filters': + test_baseline = args.test[0].name + test_contender = args.test[0].name + filter_baseline = args.filter_baseline[0] + filter_contender = args.filter_contender[0] + + # NOTE: if filter_baseline == filter_contender, you are analyzing the + # stdev + + description = 'Comparing %s to %s (from %s)' % ( + filter_baseline, filter_contender, args.test[0].name) + elif args.mode == 'benchmarksfiltered': + test_baseline = args.test_baseline[0].name + test_contender = args.test_contender[0].name + filter_baseline = args.filter_baseline[0] + filter_contender = args.filter_contender[0] + + # NOTE: if test_baseline == test_contender and + # filter_baseline == filter_contender, you are analyzing the stdev + + description = 'Comparing %s (from %s) to %s (from %s)' % ( + filter_baseline, test_baseline, filter_contender, test_contender) + else: + # should never happen + print("Unrecognized mode of operation: '%s'" % args.mode) + parser.print_help() + exit(1) + + check_inputs(test_baseline, test_contender, benchmark_options) + + options_baseline = [] + options_contender = [] + + if filter_baseline and filter_contender: + options_baseline = ['--benchmark_filter=%s' % filter_baseline] + 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) + + # Now, filter the benchmarks so that the difference report can work + if filter_baseline and filter_contender: + replacement = '[%s vs. %s]' % (filter_baseline, filter_contender) + json1 = gbench.report.filter_benchmark( + json1_orig, filter_baseline, replacement) + json2 = gbench.report.filter_benchmark( + json2_orig, filter_contender, replacement) + + # Diff and output + output_lines = gbench.report.generate_difference_report( + json1, json2, args.utest, args.utest_alpha) + print(description) + for ln in output_lines: + print(ln) + + +import unittest + + +class TestParser(unittest.TestCase): + def setUp(self): + self.parser = create_parser() + testInputs = os.path.join( + os.path.dirname( + os.path.realpath(__file__)), + 'gbench', + 'Inputs') + self.testInput0 = os.path.join(testInputs, 'test1_run1.json') + self.testInput1 = os.path.join(testInputs, 'test1_run2.json') + + def test_benchmarks_basic(self): + parsed = self.parser.parse_args( + ['benchmarks', self.testInput0, self.testInput1]) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertFalse(parsed.benchmark_options) + + def test_benchmarks_basic_without_utest(self): + parsed = self.parser.parse_args( + ['--no-utest', 'benchmarks', self.testInput0, self.testInput1]) + self.assertFalse(parsed.utest) + self.assertEqual(parsed.utest_alpha, 0.05) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertFalse(parsed.benchmark_options) + + def test_benchmarks_basic_with_utest_alpha(self): + parsed = self.parser.parse_args( + ['--alpha=0.314', 'benchmarks', self.testInput0, self.testInput1]) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.utest_alpha, 0.314) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertFalse(parsed.benchmark_options) + + def test_benchmarks_basic_without_utest_with_utest_alpha(self): + parsed = self.parser.parse_args( + ['--no-utest', '--alpha=0.314', 'benchmarks', self.testInput0, self.testInput1]) + self.assertFalse(parsed.utest) + self.assertEqual(parsed.utest_alpha, 0.314) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertFalse(parsed.benchmark_options) + + def test_benchmarks_with_remainder(self): + parsed = self.parser.parse_args( + ['benchmarks', self.testInput0, self.testInput1, 'd']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertEqual(parsed.benchmark_options, ['d']) + + def test_benchmarks_with_remainder_after_doubleminus(self): + parsed = self.parser.parse_args( + ['benchmarks', self.testInput0, self.testInput1, '--', 'e']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarks') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertEqual(parsed.benchmark_options, ['e']) + + def test_filters_basic(self): + parsed = self.parser.parse_args( + ['filters', self.testInput0, 'c', 'd']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'filters') + self.assertEqual(parsed.test[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.filter_contender[0], 'd') + self.assertFalse(parsed.benchmark_options) + + def test_filters_with_remainder(self): + parsed = self.parser.parse_args( + ['filters', self.testInput0, 'c', 'd', 'e']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'filters') + self.assertEqual(parsed.test[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.filter_contender[0], 'd') + self.assertEqual(parsed.benchmark_options, ['e']) + + def test_filters_with_remainder_after_doubleminus(self): + parsed = self.parser.parse_args( + ['filters', self.testInput0, 'c', 'd', '--', 'f']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'filters') + self.assertEqual(parsed.test[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.filter_contender[0], 'd') + self.assertEqual(parsed.benchmark_options, ['f']) + + def test_benchmarksfiltered_basic(self): + parsed = self.parser.parse_args( + ['benchmarksfiltered', self.testInput0, 'c', self.testInput1, 'e']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarksfiltered') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertEqual(parsed.filter_contender[0], 'e') + self.assertFalse(parsed.benchmark_options) + + def test_benchmarksfiltered_with_remainder(self): + parsed = self.parser.parse_args( + ['benchmarksfiltered', self.testInput0, 'c', self.testInput1, 'e', 'f']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarksfiltered') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertEqual(parsed.filter_contender[0], 'e') + self.assertEqual(parsed.benchmark_options[0], 'f') + + def test_benchmarksfiltered_with_remainder_after_doubleminus(self): + parsed = self.parser.parse_args( + ['benchmarksfiltered', self.testInput0, 'c', self.testInput1, 'e', '--', 'g']) + self.assertTrue(parsed.utest) + self.assertEqual(parsed.mode, 'benchmarksfiltered') + self.assertEqual(parsed.test_baseline[0].name, self.testInput0) + self.assertEqual(parsed.filter_baseline[0], 'c') + self.assertEqual(parsed.test_contender[0].name, self.testInput1) + self.assertEqual(parsed.filter_contender[0], 'e') + self.assertEqual(parsed.benchmark_options[0], 'g') + + +if __name__ == '__main__': + # unittest.main() + main() + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# kate: tab-width: 4; replace-tabs on; indent-width 4; tab-indents: off; +# kate: indent-mode python; remove-trailing-spaces modified; diff --git a/utils/google-benchmark/tools/compare_bench.py b/utils/google-benchmark/tools/compare_bench.py index d54baaa0e8f83..7bbf0d0157473 100644 --- a/utils/google-benchmark/tools/compare_bench.py +++ b/utils/google-benchmark/tools/compare_bench.py @@ -39,21 +39,20 @@ def main(): parser.add_argument( 'test2', metavar='test2', type=str, nargs=1, help='A benchmark executable or JSON output file') - # FIXME this is a dummy argument which will never actually match - # any --benchmark flags but it helps generate a better usage message parser.add_argument( - 'benchmark_options', metavar='benchmark_option', nargs='*', + 'benchmark_options', metavar='benchmark_options', nargs=argparse.REMAINDER, help='Arguments to pass when running benchmark executables' ) args, unknown_args = parser.parse_known_args() # Parse the command line flags test1 = args.test1[0] test2 = args.test2[0] - if args.benchmark_options: + if unknown_args: + # should never happen print("Unrecognized positional argument arguments: '%s'" - % args.benchmark_options) + % unknown_args) exit(1) - benchmark_options = unknown_args + benchmark_options = args.benchmark_options check_inputs(test1, test2, benchmark_options) # Run the benchmarks and report the results json1 = gbench.util.run_or_load_benchmark(test1, benchmark_options) diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json index 37faed46d1344..d7ec6a9c8f61a 100644 --- a/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json +++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json @@ -29,6 +29,20 @@ "time_unit": "ns" }, { + "name": "BM_1PercentFaster", + "iterations": 1000, + "real_time": 100, + "cpu_time": 100, + "time_unit": "ns" + }, + { + "name": "BM_1PercentSlower", + "iterations": 1000, + "real_time": 100, + "cpu_time": 100, + "time_unit": "ns" + }, + { "name": "BM_10PercentFaster", "iterations": 1000, "real_time": 100, @@ -55,6 +69,34 @@ "real_time": 10000, "cpu_time": 10000, "time_unit": "ns" + }, + { + "name": "BM_10PercentCPUToTime", + "iterations": 1000, + "real_time": 100, + "cpu_time": 100, + "time_unit": "ns" + }, + { + "name": "BM_ThirdFaster", + "iterations": 1000, + "real_time": 100, + "cpu_time": 100, + "time_unit": "ns" + }, + { + "name": "BM_BadTimeUnit", + "iterations": 1000, + "real_time": 0.4, + "cpu_time": 0.5, + "time_unit": "s" + }, + { + "name": "BM_DifferentTimeUnit", + "iterations": 1, + "real_time": 1, + "cpu_time": 1, + "time_unit": "s" } ] -}
\ No newline at end of file +} diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json index aed5151d39213..59a5ffaca4d4d 100644 --- a/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json +++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json @@ -29,6 +29,20 @@ "time_unit": "ns" }, { + "name": "BM_1PercentFaster", + "iterations": 1000, + "real_time": 98.9999999, + "cpu_time": 98.9999999, + "time_unit": "ns" + }, + { + "name": "BM_1PercentSlower", + "iterations": 1000, + "real_time": 100.9999999, + "cpu_time": 100.9999999, + "time_unit": "ns" + }, + { "name": "BM_10PercentFaster", "iterations": 1000, "real_time": 90, @@ -45,8 +59,8 @@ { "name": "BM_100xSlower", "iterations": 1000, - "real_time": 10000, - "cpu_time": 10000, + "real_time": 1.0000e+04, + "cpu_time": 1.0000e+04, "time_unit": "ns" }, { @@ -55,6 +69,34 @@ "real_time": 100, "cpu_time": 100, "time_unit": "ns" + }, + { + "name": "BM_10PercentCPUToTime", + "iterations": 1000, + "real_time": 110, + "cpu_time": 90, + "time_unit": "ns" + }, + { + "name": "BM_ThirdFaster", + "iterations": 1000, + "real_time": 66.665, + "cpu_time": 66.664, + "time_unit": "ns" + }, + { + "name": "BM_BadTimeUnit", + "iterations": 1000, + "real_time": 0.04, + "cpu_time": 0.6, + "time_unit": "s" + }, + { + "name": "BM_DifferentTimeUnit", + "iterations": 1, + "real_time": 1, + "cpu_time": 1, + "time_unit": "ns" } ] -}
\ No newline at end of file +} diff --git a/utils/google-benchmark/tools/gbench/Inputs/test2_run.json b/utils/google-benchmark/tools/gbench/Inputs/test2_run.json new file mode 100644 index 0000000000000..15bc698030493 --- /dev/null +++ b/utils/google-benchmark/tools/gbench/Inputs/test2_run.json @@ -0,0 +1,81 @@ +{ + "context": { + "date": "2016-08-02 17:44:46", + "num_cpus": 4, + "mhz_per_cpu": 4228, + "cpu_scaling_enabled": false, + "library_build_type": "release" + }, + "benchmarks": [ + { + "name": "BM_Hi", + "iterations": 1234, + "real_time": 42, + "cpu_time": 24, + "time_unit": "ms" + }, + { + "name": "BM_Zero", + "iterations": 1000, + "real_time": 10, + "cpu_time": 10, + "time_unit": "ns" + }, + { + "name": "BM_Zero/4", + "iterations": 4000, + "real_time": 40, + "cpu_time": 40, + "time_unit": "ns" + }, + { + "name": "Prefix/BM_Zero", + "iterations": 2000, + "real_time": 20, + "cpu_time": 20, + "time_unit": "ns" + }, + { + "name": "Prefix/BM_Zero/3", + "iterations": 3000, + "real_time": 30, + "cpu_time": 30, + "time_unit": "ns" + }, + { + "name": "BM_One", + "iterations": 5000, + "real_time": 5, + "cpu_time": 5, + "time_unit": "ns" + }, + { + "name": "BM_One/4", + "iterations": 2000, + "real_time": 20, + "cpu_time": 20, + "time_unit": "ns" + }, + { + "name": "Prefix/BM_One", + "iterations": 1000, + "real_time": 10, + "cpu_time": 10, + "time_unit": "ns" + }, + { + "name": "Prefix/BM_One/3", + "iterations": 1500, + "real_time": 15, + "cpu_time": 15, + "time_unit": "ns" + }, + { + "name": "BM_Bye", + "iterations": 5321, + "real_time": 11, + "cpu_time": 63, + "time_unit": "ns" + } + ] +} diff --git a/utils/google-benchmark/tools/gbench/Inputs/test3_run0.json b/utils/google-benchmark/tools/gbench/Inputs/test3_run0.json new file mode 100644 index 0000000000000..ca793f3367e25 --- /dev/null +++ b/utils/google-benchmark/tools/gbench/Inputs/test3_run0.json @@ -0,0 +1,39 @@ +{ + "context": { + "date": "2016-08-02 17:44:46", + "num_cpus": 4, + "mhz_per_cpu": 4228, + "cpu_scaling_enabled": false, + "library_build_type": "release" + }, + "benchmarks": [ + { + "name": "BM_One", + "iterations": 1000, + "real_time": 10, + "cpu_time": 100, + "time_unit": "ns" + }, + { + "name": "BM_Two", + "iterations": 1000, + "real_time": 9, + "cpu_time": 90, + "time_unit": "ns" + }, + { + "name": "BM_Two", + "iterations": 1000, + "real_time": 8, + "cpu_time": 80, + "time_unit": "ns" + }, + { + "name": "short", + "iterations": 1000, + "real_time": 8, + "cpu_time": 80, + "time_unit": "ns" + } + ] +} diff --git a/utils/google-benchmark/tools/gbench/Inputs/test3_run1.json b/utils/google-benchmark/tools/gbench/Inputs/test3_run1.json new file mode 100644 index 0000000000000..e5cf50c7445e2 --- /dev/null +++ b/utils/google-benchmark/tools/gbench/Inputs/test3_run1.json @@ -0,0 +1,39 @@ +{ + "context": { + "date": "2016-08-02 17:44:46", + "num_cpus": 4, + "mhz_per_cpu": 4228, + "cpu_scaling_enabled": false, + "library_build_type": "release" + }, + "benchmarks": [ + { + "name": "BM_One", + "iterations": 1000, + "real_time": 9, + "cpu_time": 110, + "time_unit": "ns" + }, + { + "name": "BM_Two", + "iterations": 1000, + "real_time": 10, + "cpu_time": 89, + "time_unit": "ns" + }, + { + "name": "BM_Two", + "iterations": 1000, + "real_time": 7, + "cpu_time": 70, + "time_unit": "ns" + }, + { + "name": "short", + "iterations": 1000, + "real_time": 8, + "cpu_time": 80, + "time_unit": "ns" + } + ] +} diff --git a/utils/google-benchmark/tools/gbench/report.py b/utils/google-benchmark/tools/gbench/report.py index 8f1b0fa8604e5..4d03a5476776c 100644 --- a/utils/google-benchmark/tools/gbench/report.py +++ b/utils/google-benchmark/tools/gbench/report.py @@ -1,6 +1,11 @@ """report.py - Utilities for reporting statistics about benchmark results """ import os +import re +import copy + +from scipy.stats import mannwhitneyu + class BenchmarkColor(object): def __init__(self, name, code): @@ -14,11 +19,13 @@ class BenchmarkColor(object): def __format__(self, format): return self.code + # Benchmark Colors Enumeration BC_NONE = BenchmarkColor('NONE', '') BC_MAGENTA = BenchmarkColor('MAGENTA', '\033[95m') BC_CYAN = BenchmarkColor('CYAN', '\033[96m') BC_OKBLUE = BenchmarkColor('OKBLUE', '\033[94m') +BC_OKGREEN = BenchmarkColor('OKGREEN', '\033[32m') BC_HEADER = BenchmarkColor('HEADER', '\033[92m') BC_WARNING = BenchmarkColor('WARNING', '\033[93m') BC_WHITE = BenchmarkColor('WHITE', '\033[97m') @@ -27,6 +34,10 @@ BC_ENDC = BenchmarkColor('ENDC', '\033[0m') BC_BOLD = BenchmarkColor('BOLD', '\033[1m') BC_UNDERLINE = BenchmarkColor('UNDERLINE', '\033[4m') +UTEST_MIN_REPETITIONS = 2 +UTEST_OPTIMAL_REPETITIONS = 9 # Lowest reasonable number, More is better. + + def color_format(use_color, fmt_str, *args, **kwargs): """ Return the result of 'fmt_str.format(*args, **kwargs)' after transforming @@ -66,25 +77,107 @@ def calculate_change(old_val, new_val): return float(new_val - old_val) / abs(old_val) -def generate_difference_report(json1, json2, use_color=True): +def filter_benchmark(json_orig, family, replacement=""): + """ + Apply a filter to the json, and only leave the 'family' of benchmarks. + """ + regex = re.compile(family) + filtered = {} + filtered['benchmarks'] = [] + for be in json_orig['benchmarks']: + if not regex.search(be['name']): + continue + filteredbench = copy.deepcopy(be) # Do NOT modify the old name! + filteredbench['name'] = regex.sub(replacement, filteredbench['name']) + filtered['benchmarks'].append(filteredbench) + return filtered + + +def generate_difference_report( + json1, + json2, + utest=False, + utest_alpha=0.05, + use_color=True): """ Calculate and report the difference between each test of two benchmarks runs specified as 'json1' and 'json2'. """ - first_col_width = find_longest_name(json1['benchmarks']) + 5 + 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 - first_line = "{:<{}s} Time CPU Old New".format( - 'Benchmark', first_col_width) + + utest_col_name = "_pvalue" + first_col_width = max( + first_col_width, + len('Benchmark')) + first_col_width += len(utest_col_name) + first_line = "{:<{}s}Time CPU Time Old Time New CPU Old CPU New".format( + 'Benchmark', 12 + first_col_width) output_strs = [first_line, '-' * len(first_line)] - for bn in json1['benchmarks']: + + last_name = None + timings_time = [[], []] + timings_cpu = [[], []] + + gen = (bn for bn in json1['benchmarks'] + if 'real_time' in bn and 'cpu_time' in bn) + for bn in gen: + fmt_str = "{}{:<{}s}{endc}{}{:+16.4f}{endc}{}{:+16.4f}{endc}{:14.0f}{:14.0f}{endc}{:14.0f}{:14.0f}" + special_str = "{}{:<{}s}{endc}{}{:16.4f}{endc}{}{:16.4f}{endc}{} {}" + + if last_name is None: + last_name = bn['name'] + if last_name != bn['name']: + if ((len(timings_time[0]) >= UTEST_MIN_REPETITIONS) and + (len(timings_time[1]) >= UTEST_MIN_REPETITIONS) and + (len(timings_cpu[0]) >= UTEST_MIN_REPETITIONS) and + (len(timings_cpu[1]) >= UTEST_MIN_REPETITIONS)): + if utest: + def get_utest_color(pval): + if pval >= utest_alpha: + return BC_FAIL + else: + return BC_OKGREEN + 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 + dsc = "U Test, Repetitions: {}".format(len(timings_cpu[0])) + dsc_color = BC_OKGREEN + if len(timings_cpu[0]) < UTEST_OPTIMAL_REPETITIONS: + dsc_color = BC_WARNING + dsc += ". WARNING: Results unreliable! {}+ repetitions recommended.".format( + UTEST_OPTIMAL_REPETITIONS) + output_strs += [color_format(use_color, + special_str, + BC_HEADER, + "{}{}".format(last_name, + utest_col_name), + first_col_width, + get_utest_color(time_pvalue), + time_pvalue, + get_utest_color(cpu_pvalue), + cpu_pvalue, + dsc_color, + dsc, + endc=BC_ENDC)] + last_name = bn['name'] + timings_time = [[], []] + timings_cpu = [[], []] + other_bench = find_test(bn['name']) if not other_bench: continue + if bn['time_unit'] != other_bench['time_unit']: + continue + def get_color(res): if res > 0.05: return BC_FAIL @@ -92,25 +185,44 @@ def generate_difference_report(json1, json2, use_color=True): return BC_WHITE else: return BC_CYAN - fmt_str = "{}{:<{}s}{endc}{}{:+9.2f}{endc}{}{:+14.2f}{endc}{:14d}{:14d}" - 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['cpu_time'], other_bench['cpu_time'], - endc=BC_ENDC)] + + timings_time[0].append(bn['real_time']) + timings_time[1].append(other_bench['real_time']) + timings_cpu[0].append(bn['cpu_time']) + timings_cpu[1].append(other_bench['cpu_time']) + + tres = calculate_change(timings_time[0][-1], timings_time[1][-1]) + cpures = calculate_change(timings_cpu[0][-1], timings_cpu[1][-1]) + output_strs += [color_format(use_color, + fmt_str, + BC_HEADER, + bn['name'], + first_col_width, + get_color(tres), + tres, + get_color(cpures), + cpures, + timings_time[0][-1], + timings_time[1][-1], + timings_cpu[0][-1], + timings_cpu[1][-1], + endc=BC_ENDC)] return output_strs ############################################################################### # Unit tests + import unittest + class TestReportDifference(unittest.TestCase): def load_results(self): import json - testInputs = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Inputs') + 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: @@ -121,24 +233,120 @@ class TestReportDifference(unittest.TestCase): def test_basic(self): expect_lines = [ - ['BM_SameTimes', '+0.00', '+0.00', '10', '10'], - ['BM_2xFaster', '-0.50', '-0.50', '50', '25'], - ['BM_2xSlower', '+1.00', '+1.00', '50', '100'], - ['BM_10PercentFaster', '-0.10', '-0.10', '100', '90'], - ['BM_10PercentSlower', '+0.10', '+0.10', '100', '110'], - ['BM_100xSlower', '+99.00', '+99.00', '100', '10000'], - ['BM_100xFaster', '-0.99', '-0.99', '10000', '100'], + ['BM_SameTimes', '+0.0000', '+0.0000', '10', '10', '10', '10'], + ['BM_2xFaster', '-0.5000', '-0.5000', '50', '25', '50', '25'], + ['BM_2xSlower', '+1.0000', '+1.0000', '50', '100', '50', '100'], + ['BM_1PercentFaster', '-0.0100', '-0.0100', '100', '99', '100', '99'], + ['BM_1PercentSlower', '+0.0100', '+0.0100', '100', '101', '100', '101'], + ['BM_10PercentFaster', '-0.1000', '-0.1000', '100', '90', '100', '90'], + ['BM_10PercentSlower', '+0.1000', '+0.1000', '100', '110', '100', '110'], + ['BM_100xSlower', '+99.0000', '+99.0000', + '100', '10000', '100', '10000'], + ['BM_100xFaster', '-0.9900', '-0.9900', + '10000', '100', '10000', '100'], + ['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'], ] json1, json2 = self.load_results() - output_lines_with_header = generate_difference_report(json1, json2, use_color=False) + output_lines_with_header = generate_difference_report( + json1, json2, 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 xrange(0, len(output_lines)): + for i in range(0, len(output_lines)): + parts = [x for x in output_lines[i].split(' ') if x] + self.assertEqual(len(parts), 7) + self.assertEqual(parts, expect_lines[i]) + + +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 + + def test_basic(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 = 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(len(parts), 7) + self.assertEqual(parts, expect_lines[i]) + + +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 = [] + expect_lines = [ + ['BM_One', '-0.1000', '+0.1000', '10', '9', '100', '110'], + ['BM_Two', '+0.1111', '-0.0111', '9', '10', '90', '89'], + ['BM_Two', '+0.2500', '+0.1125', '8', '10', '80', '89'], + ['BM_Two_pvalue', + '0.2207', + '0.6831', + 'U', + 'Test,', + 'Repetitions:', + '2.', + 'WARNING:', + 'Results', + 'unreliable!', + '9+', + 'repetitions', + 'recommended.'], + ['short', '+0.0000', '+0.0000', '8', '8', '80', '80'], + ] + json1, json2 = self.load_results() + output_lines_with_header = generate_difference_report( + json1, json2, True, 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(len(parts), 5) self.assertEqual(parts, expect_lines[i]) if __name__ == '__main__': unittest.main() + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# kate: tab-width: 4; replace-tabs on; indent-width 4; tab-indents: off; +# kate: indent-mode python; remove-trailing-spaces modified; diff --git a/utils/google-benchmark/tools/strip_asm.py b/utils/google-benchmark/tools/strip_asm.py new file mode 100755 index 0000000000000..9030550b43bec --- /dev/null +++ b/utils/google-benchmark/tools/strip_asm.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +""" +strip_asm.py - Cleanup ASM output for the specified file +""" + +from argparse import ArgumentParser +import sys +import os +import re + +def find_used_labels(asm): + found = set() + label_re = re.compile("\s*j[a-z]+\s+\.L([a-zA-Z0-9][a-zA-Z0-9_]*)") + for l in asm.splitlines(): + m = label_re.match(l) + if m: + found.add('.L%s' % m.group(1)) + return found + + +def normalize_labels(asm): + decls = set() + label_decl = re.compile("^[.]{0,1}L([a-zA-Z0-9][a-zA-Z0-9_]*)(?=:)") + for l in asm.splitlines(): + m = label_decl.match(l) + if m: + decls.add(m.group(0)) + if len(decls) == 0: + return asm + needs_dot = next(iter(decls))[0] != '.' + if not needs_dot: + return asm + for ld in decls: + asm = re.sub("(^|\s+)" + ld + "(?=:|\s)", '\\1.' + ld, asm) + return asm + + +def transform_labels(asm): + asm = normalize_labels(asm) + used_decls = find_used_labels(asm) + new_asm = '' + label_decl = re.compile("^\.L([a-zA-Z0-9][a-zA-Z0-9_]*)(?=:)") + for l in asm.splitlines(): + m = label_decl.match(l) + if not m or m.group(0) in used_decls: + new_asm += l + new_asm += '\n' + return new_asm + + +def is_identifier(tk): + if len(tk) == 0: + return False + first = tk[0] + if not first.isalpha() and first != '_': + return False + for i in range(1, len(tk)): + c = tk[i] + if not c.isalnum() and c != '_': + return False + return True + +def process_identifiers(l): + """ + process_identifiers - process all identifiers and modify them to have + consistent names across all platforms; specifically across ELF and MachO. + For example, MachO inserts an additional understore at the beginning of + names. This function removes that. + """ + parts = re.split(r'([a-zA-Z0-9_]+)', l) + new_line = '' + for tk in parts: + if is_identifier(tk): + if tk.startswith('__Z'): + tk = tk[1:] + elif tk.startswith('_') and len(tk) > 1 and \ + tk[1].isalpha() and tk[1] != 'Z': + tk = tk[1:] + new_line += tk + return new_line + + +def process_asm(asm): + """ + Strip the ASM of unwanted directives and lines + """ + new_contents = '' + asm = transform_labels(asm) + + # TODO: Add more things we want to remove + discard_regexes = [ + re.compile("\s+\..*$"), # directive + re.compile("\s*#(NO_APP|APP)$"), #inline ASM + re.compile("\s*#.*$"), # comment line + re.compile("\s*\.globa?l\s*([.a-zA-Z_][a-zA-Z0-9$_.]*)"), #global directive + re.compile("\s*\.(string|asciz|ascii|[1248]?byte|short|word|long|quad|value|zero)"), + ] + keep_regexes = [ + + ] + fn_label_def = re.compile("^[a-zA-Z_][a-zA-Z0-9_.]*:") + for l in asm.splitlines(): + # Remove Mach-O attribute + l = l.replace('@GOTPCREL', '') + add_line = True + for reg in discard_regexes: + if reg.match(l) is not None: + add_line = False + break + for reg in keep_regexes: + if reg.match(l) is not None: + add_line = True + break + if add_line: + if fn_label_def.match(l) and len(new_contents) != 0: + new_contents += '\n' + l = process_identifiers(l) + new_contents += l + new_contents += '\n' + return new_contents + +def main(): + parser = ArgumentParser( + description='generate a stripped assembly file') + parser.add_argument( + 'input', metavar='input', type=str, nargs=1, + help='An input assembly file') + parser.add_argument( + 'out', metavar='output', type=str, nargs=1, + help='The output file') + args, unknown_args = parser.parse_known_args() + input = args.input[0] + output = args.out[0] + if not os.path.isfile(input): + print(("ERROR: input file '%s' does not exist") % input) + sys.exit(1) + contents = None + with open(input, 'r') as f: + contents = f.read() + new_contents = process_asm(contents) + with open(output, 'w') as f: + f.write(new_contents) + + +if __name__ == '__main__': + main() + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# kate: tab-width: 4; replace-tabs on; indent-width 4; tab-indents: off; +# kate: indent-mode python; remove-trailing-spaces modified; diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py index 199ff3566d30b..6542ceb6fb58c 100644 --- a/utils/libcxx/test/config.py +++ b/utils/libcxx/test/config.py @@ -50,6 +50,11 @@ def loadSiteConfig(lit_config, config, param_name, env_name): ld_fn(config, site_cfg) lit_config.load_config = ld_fn +# Extract the value of a numeric macro such as __cplusplus or a feature-test +# macro. +def intMacroValue(token): + return int(token.rstrip('LlUu')) + class Configuration(object): # pylint: disable=redefined-outer-name def __init__(self, lit_config, config): @@ -463,7 +468,8 @@ class Configuration(object): if '__cpp_structured_bindings' not in macros: self.config.available_features.add('libcpp-no-structured-bindings') - if '__cpp_deduction_guides' not in macros: + if '__cpp_deduction_guides' not in macros or \ + intMacroValue(macros['__cpp_deduction_guides']) < 201611: self.config.available_features.add('libcpp-no-deduction-guides') if self.is_windows: @@ -509,6 +515,9 @@ class Configuration(object): # and so that those tests don't have to be changed to tolerate # this insanity. self.cxx.compile_flags += ['-DNOMINMAX'] + additional_flags = self.get_lit_conf('test_compiler_flags') + if additional_flags: + self.cxx.compile_flags += shlex.split(additional_flags) def configure_default_compile_flags(self): # Try and get the std version from the command line. Fall back to @@ -711,13 +720,9 @@ class Configuration(object): enable_fs = self.get_lit_bool('enable_filesystem', default=False) if not enable_fs: return - enable_experimental = self.get_lit_bool('enable_experimental', default=False) - if not enable_experimental: - self.lit_config.fatal( - 'filesystem is enabled but libc++experimental.a is not.') self.config.available_features.add('c++filesystem') static_env = os.path.join(self.libcxx_src_root, 'test', 'std', - 'experimental', 'filesystem', 'Inputs', 'static_test_env') + 'input.output', 'filesystems', 'Inputs', 'static_test_env') static_env = os.path.realpath(static_env) assert os.path.isdir(static_env) self.cxx.compile_flags += ['-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="%s"' % static_env] @@ -793,6 +798,9 @@ class Configuration(object): self.use_system_cxx_lib] if self.is_windows and self.link_shared: self.add_path(self.cxx.compile_env, self.use_system_cxx_lib) + additional_flags = self.get_lit_conf('test_linker_flags') + if additional_flags: + self.cxx.link_flags += shlex.split(additional_flags) def configure_link_flags_abi_library_path(self): # Configure ABI library paths. @@ -809,6 +817,10 @@ class Configuration(object): if libcxx_experimental: self.config.available_features.add('c++experimental') self.cxx.link_flags += ['-lc++experimental'] + libcxx_fs = self.get_lit_bool('enable_filesystem', default=False) + if libcxx_fs: + self.config.available_features.add('c++fs') + self.cxx.link_flags += ['-lc++fs'] if self.link_shared: self.cxx.link_flags += ['-lc++'] else: @@ -921,9 +933,6 @@ class Configuration(object): # FIXME: Enable the two warnings below. self.cxx.addWarningFlagIfSupported('-Wno-conversion') self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef') - # FIXME: Remove this warning once the min/max handling patch lands - # See https://reviews.llvm.org/D33080 - self.cxx.addWarningFlagIfSupported('-Wno-#warnings') std = self.get_lit_conf('std', None) if std in ['c++98', 'c++03']: # The '#define static_assert' provided by libc++ in C++03 mode @@ -1005,8 +1014,7 @@ class Configuration(object): '__cpp_coroutines is not defined') # Consider coroutines supported only when the feature test macro # reflects a recent value. - val = macros['__cpp_coroutines'].replace('L', '') - if int(val) >= 201703: + if intMacroValue(macros['__cpp_coroutines']) >= 201703: self.config.available_features.add('fcoroutines-ts') def configure_modules(self): diff --git a/utils/libcxx/test/format.py b/utils/libcxx/test/format.py index 317fc8079bb8c..74e3cc0aa3080 100644 --- a/utils/libcxx/test/format.py +++ b/utils/libcxx/test/format.py @@ -242,7 +242,18 @@ class LibcxxTestFormat(object): test_cxx.useWarnings() if '-Wuser-defined-warnings' in test_cxx.warning_flags: test_cxx.warning_flags += ['-Wno-error=user-defined-warnings'] - + else: + # We still need to enable certain warnings on .fail.cpp test when + # -verify isn't enabled. Such as -Werror=unused-result. However, + # we don't want it enabled too liberally, which might incorrectly + # allow unrelated failure tests to 'pass'. + # + # Therefore, we check if the test was expected to fail because of + # nodiscard before enabling it + test_str = "ignoring return value of function declared with " \ + + "'nodiscard' attribute" + if test_str in contents: + test_cxx.flags += ['-Werror=unused-result'] cmd, out, err, rc = test_cxx.compile(source_path, out=os.devnull) expected_rc = 0 if use_verify else 1 if rc == expected_rc: diff --git a/utils/libcxx/test/target_info.py b/utils/libcxx/test/target_info.py index 670aea7ae6307..0e93e11448bfa 100644 --- a/utils/libcxx/test/target_info.py +++ b/utils/libcxx/test/target_info.py @@ -234,7 +234,9 @@ class LinuxLocalTI(DefaultTargetInfo): flags += ['-lunwind', '-ldl'] else: flags += ['-lgcc_s'] - flags += ['-lgcc'] + compiler_rt = self.full_config.get_lit_bool('compiler_rt', False) + if not compiler_rt: + flags += ['-lgcc'] use_libatomic = self.full_config.get_lit_bool('use_libatomic', False) if use_libatomic: flags += ['-latomic'] diff --git a/www/TS_deprecation.html b/www/TS_deprecation.html new file mode 100644 index 0000000000000..a8dd8c183b984 --- /dev/null +++ b/www/TS_deprecation.html @@ -0,0 +1,138 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>libc++ Technical Specification Status</title> + <link type="text/css" rel="stylesheet" href="menu.css"> + <link type="text/css" rel="stylesheet" href="content.css"> +</head> + +<body> +<div id="menu"> + <div> + <a href="https://llvm.org/">LLVM Home</a> + </div> + + <div class="submenu"> + <label>libc++ Info</label> + <a href="/index.html">About</a> + </div> + + <div class="submenu"> + <label>Quick Links</label> + <a href="https://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a> + <a href="https://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a> + <a href="https://bugs.llvm.org/">Bug Reports</a> + <a href="https://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a> + <a href="https://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a> + </div> +</div> + +<div id="content"> +<p>The "end game" of a Technical Specification (TS) is to have the features in there added to a future version of the C++ standard. When this happens, the TS can be retired. Sometimes, only part of at TS is added to the standard, and the rest of the features may be incorporated into the next version of the TS.</p> + +<p>Adoption leaves library implementors with two implementations of a feature, one in namespace <tt>std</tt>, and the other in namespace <tt>std::experimental</tt>. The first one will continue to evolve (via issues and papers), while the other will not. Gradually they will diverge. It's not good for users to have two (subtly) different implementations of the same functionality in the same library.</p> + +<p>As features are adopted into the main standard, we will implement them in namespace <tt>std</tt>, and then remove the versions in <tt>std::experimental</tt>. The removal will not happen immediately, because that would be unhelpful for users - giving them no chance to update their code.</p> + +<p>The rule of thumb that libc++ will follow is: <b>one year</b>. <br/>One year after we ship an implementation of a feature in <tt>std</tt>, we will remove it from <tt>std::experimental</tt>.</p> + +<p>A specific example: The first release of clang/libc++ that officially supported C++17 was 5.0. For the 7.0 release (one year after 5.0), we will remove the features that were adopted into C++17 from the TSes, <i>and</i> that were present in namespace <tt>std</tt> in the 5.0 release.</p> + +<h2>Library Fundamentals TS <a href="https://wg21.link/N4480">V1</a> and <a href="https://wg21.link/N4617">V2</a></h2> + +<p>Most (but not all) of the features of the LFTS were accepted into C++17.</p> + +<table id="LFTS" border="1"> +<tr><th>Section</th><th>Feature</th><th>shipped in<br/><tt>std</tt></th><th>To be removed from<br/><tt>std::experimental</tt></th><th>Notes</th></tr> +<tr><td>2.1</td><td>uses_allocator construction</td><td><center>5.0</center></td><td><center>7.0</center></td><td></td></tr> +<tr><td>3.1.2</td><td><tt>erased_type</tt></td><td></td><td><center>n/a</center></td><td><i>Not part of C++17</i></td></tr> +<tr><td>3.2.1</td><td><tt>tuple_size_v</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.2.2</td><td><tt>apply</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.3.1</td><td>All of the '_v' traits in <type_traits></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.3.2</td><td><tt>invocation_type</tt> and <tt>raw_invocation_type</tt></td><td></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>3.3.3</td><td>Logical operator traits</td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.3.3</td><td>Detection Idiom</td><td><center>5.0</center></td><td></td><td><I>Only partially in C++17</I></td></tr> +<tr><td>3.4.1</td><td>All of the '_v' traits in <ratio></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.5.1</td><td>All of the '_v' traits in <chrono></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.6.1</td><td>All of the '_v' traits in <system_error></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>3.7</td><td><tt>propagate_const</tt></td><td></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>4.2</td><td>Enhancements to <tt>function</tt></td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>4.3</td><td>searchers</td><td><center>7.0</center></td><td><center>9.0</center></td><td></td></tr> +<tr><td>5</td><td><tt>optional</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>6</td><td><tt>any</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>7</td><td><tt>string_view</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>8.2.1</td><td><tt>shared_ptr</tt> enhancements</td><td><center>Not yet</center></td><td><center>Never added</center></td><td></td></tr> +<tr><td>8.2.2</td><td><tt>weak_ptr</tt> enhancements</td><td><center>Not yet</center></td><td><center>Never added</center></td><td></td></tr> +<tr><td>8.5</td><td><tt>memory_resource</tt></td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.6</td><td><tt>polymorphic_allocator</tt></td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.7</td><td><tt>resource_adaptor</tt></tt></td><td><center></center></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>8.8</td><td>Access to program-wide <tt>memory_resource</tt> objects</td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.9</td><td>Pool resource classes</td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.10</td><td><tt>monotonic_buffer_resource</tt></td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.11</td><td>Alias templates using polymorphic memory resources</td><td><center>Not yet</center></td><td></td><td></td></tr> +<tr><td>8.12</td><td>Non-owning pointers</td><td></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>11.2</td><td><tt>promise</tt></td><td></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>11.3</td><td><tt>packaged_task</tt></td><td></td><td><center>n/a</center></td><td><I>Not part of C++17</I></td></tr> +<tr><td>12.2</td><td><tt>search</tt></td><td><center>7.0</center></td><td><center>9.0</center></td><td><I></I></td></tr> +<tr><td>12.3</td><td><tt>sample</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>12.4</td><td><tt>shuffle</tt></td><td></td><td></td><td><I>Not part of C++17</I></td></tr> +<tr><td>13.1</td><td><tt>gcd</tt> and <tt>lcm</tt></td><td><center>5.0</center></td><td><center>7.0</center></td><td><i>Removed</i></td></tr> +<tr><td>13.2</td><td>Random number generation</td><td></td><td><td><I>Not part of C++17</I></td></tr> +<tr><td>14</td><td>Reflection Library</td><td></td><td><td><I>Not part of C++17</I></td></tr> +</table> + +<h2><a href="https://wg21.link/N4100">FileSystem TS</a></h2> +<p>The FileSystem TS was accepted (in toto) for C++17.</p> +<p>The FileSystem TS implementation is still (as of v6.0) in namespace <tt>std::experimental</tt>.</p> + +<h2>Parallelism TS <a href="https://wg21.link/N4507">V1</a> and <a href="https://wg21.link/N4706">V2</a></h2> +<p>Some (most) of the Parallelism TS was accepted for C++17.</p> +<p>We have not yet shipped an implementation of the Parallelism TS.</p> + +<h2><a href="https://wg21.link/N4680">Coroutines TS</a></h2> +<p>The Coroutines TS is not yet part of a shipping standard.</p> +<p>We are shipping (as of v5.0) an implementation of the Coroutines TS in namespace <tt>std::experimental</tt>.</p> + +<h2><a href="https://wg21.link/N4656">Networking TS</a></h2> +<p>The Networking TS is not yet part of a shipping standard.</p> +<p>We have not yet shipped an implementation of the Networking TS.</p> + +<h2><a href="https://wg21.link/N4685">Ranges TS</a></h2> +<p>The Ranges TS is not yet part of a shipping standard.</p> +<p>We have not yet shipped an implementation of the Ranges TS.</p> + +<h2><a href="https://wg21.link/N4641">Concepts TS</a></h2> +<p>The Concepts TS is not yet part of a shipping standard, but it has been adopted into the C++20 working draft.</p> +<p>We have not yet shipped an implementation of the Concepts TS.</p> + +<h2><a href="https://wg21.link/P0159">Concurrency TS</a></h2> +<!-- The Concurrency TS was adopted in Kona (2015). --> +<p>None of the Concurrency TS was accepted for C++17.</p> +<p>We have not yet shipped an implementation of the Concurrency TS.</p> + +<!-- +><table id="Concurrency" border="1"> +<tr><th>Section</th><th>Feature</th><th>shipped in <tt>std</tt></th><th>To be removed from <tt>std::experimental</tt></th><th>Notes</th></tr> +<tr><td>2.3</td><td>class template <tt>future</tt></td><td></td><td><td></td></tr> +<tr><td>2.4</td><td>class template <tt>shared_future</tt></td><td></td><td><td></td></tr> +<tr><td>2.5</td><td>class template <tt>promise</tt></td><td></td><td><td><center><I>Only using <tt>future</tt></I></center></td></tr> +<tr><td>2.6</td><td>class template <tt>packaged_task</tt></td><td></td><td><td><center><I>Only using <tt>future</tt></I></center></td></tr> +<tr><td>2.7</td><td>function template <tt>when_all</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>2.8</td><td>class template <tt>when_any_result</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>2.9</td><td>function template <tt>when_any</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>2.10</td><td>function template <tt>make_ready_future</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>2.11</td><td>function template <tt>make_exeptional_future</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>3</td><td><tt>latches</tt> and <tt>barriers</tt></td><td></td><td><td><center><I>Not part of C++17</I></center></td></tr> +<tr><td>4</td><td>Atomic Smart Pointers</td><td></td><td><td><center><I>Adopted for C++20</I></center></td></tr> +--> +</table> + + + <hr/> + <p>Last Updated: 8-Feb-2018</p> +</div> +</body> +</html> diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 4665eb22bd3c1..dc35283739b38 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -84,7 +84,7 @@ <tr><td><a href="https://wg21.link/P0024R2">P0024R2</a></td><td>LWG</td><td>The Parallelism TS Should be Standardized</td><td>Jacksonville</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0226R1">P0226R1</a></td><td>LWG</td><td>Mathematical Special Functions for C++17</td><td>Jacksonville</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0220R1">P0220R1</a></td><td>LWG</td><td>Adopt Library Fundamentals V1 TS Components for C++17</td><td>Jacksonville</td><td>In Progress</td><td></td></tr> - <tr><td><a href="https://wg21.link/P0218R1">P0218R1</a></td><td>LWG</td><td>Adopt the File System TS for C++17</td><td>Jacksonville</td><td>In Progress</td><td></td></tr> + <tr><td><a href="https://wg21.link/P0218R1">P0218R1</a></td><td>LWG</td><td>Adopt the File System TS for C++17</td><td>Jacksonville</td><td>Complete</td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0033R1">P0033R1</a></td><td>LWG</td><td>Re-enabling shared_from_this</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr> <tr><td><a href="https://wg21.link/P0005R4">P0005R4</a></td><td>LWG</td><td>Adopt not_fn from Library Fundamentals 2 for C++17</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr> <tr><td><a href="https://wg21.link/P0152R1">P0152R1</a></td><td>LWG</td><td>constexpr atomic::is_always_lock_free</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr> @@ -111,9 +111,9 @@ <tr><td><a href="https://wg21.link/p0180r2">p0180r2</a></td><td>LWG</td><td>Reserve a New Library Namespace for Future Standardization</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr> <tr><td><a href="https://wg21.link/p0181r1">p0181r1</a></td><td>LWG</td><td>Ordered by Default</td><td>Oulu</td><td><i>Removed in Kona</i></td><td>n/a</td></tr> <tr><td><a href="https://wg21.link/p0209r2">p0209r2</a></td><td>LWG</td><td>make_from_tuple: apply for construction</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr> - <tr><td><a href="https://wg21.link/p0219r1">p0219r1</a></td><td>LWG</td><td>Relative Paths for Filesystem</td><td>Oulu</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/p0219r1">p0219r1</a></td><td>LWG</td><td>Relative Paths for Filesystem</td><td>Oulu</td><td>Complete</td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/p0254r2">p0254r2</a></td><td>LWG</td><td>Integrating std::string_view and std::string</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr> - <tr><td><a href="https://wg21.link/p0258r2">p0258r2</a></td><td>LWG</td><td>has_unique_object_representations</td><td>Oulu</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/p0258r2">p0258r2</a></td><td>LWG</td><td>has_unique_object_representations</td><td>Oulu</td><td>Complete</td><td>6.0</td></tr> <tr><td><a href="https://wg21.link/p0295r0">p0295r0</a></td><td>LWG</td><td>Adopt Selected Library Fundamentals V2 Components for C++17</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr> <tr><td><a href="https://wg21.link/p0302r1">p0302r1</a></td><td>LWG</td><td>Removing Allocator Support in std::function</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr> <tr><td><a href="https://wg21.link/p0307r2">p0307r2</a></td><td>LWG</td><td>Making Optional Greater Equal Again</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr> @@ -148,12 +148,12 @@ <tr><td><a href="https://wg21.link/P0156R2">P0156R2</a></td><td>LWG</td><td>Variadic Lock guard(rev 5)</td><td>Kona</td><td>Complete</td><td>5.0</td></tr> <tr><td><a href="https://wg21.link/P0270R3">P0270R3</a></td><td>CWG</td><td>Removing C dependencies from signal handler wording</td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0298R3">P0298R3</a></td><td>CWG</td><td>A byte type definition</td><td>Kona</td><td>Complete</td><td>5.0</td></tr> - <tr><td><a href="https://wg21.link/P0317R1">P0317R1</a></td><td>LWG</td><td>Directory Entry Caching for Filesystem</td><td>Kona</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0430R2">P0430R2</a></td><td>LWG</td><td>File system library on non-POSIX-like operating systems</td><td>Kona</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0433R2">P0433R2</a></td><td>LWG</td><td>Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library</td><td>Kona</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0317R1">P0317R1</a></td><td>LWG</td><td>Directory Entry Caching for Filesystem</td><td>Kona</td><td>Complete</td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0430R2">P0430R2</a></td><td>LWG</td><td>File system library on non-POSIX-like operating systems</td><td>Kona</td><td>Complete</td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0433R2">P0433R2</a></td><td>LWG</td><td>Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library</td><td>Kona</td><td><i>In progress</i></td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0452R1">P0452R1</a></td><td>LWG</td><td>Unifying <numeric> Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0467R2">P0467R2</a></td><td>LWG</td><td>Iterator Concerns for Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0492R2">P0492R2</a></td><td>LWG</td><td>Proposed Resolution of C++17 National Body Comments for Filesystems</td><td>Kona</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0492R2">P0492R2</a></td><td>LWG</td><td>Proposed Resolution of C++17 National Body Comments for Filesystems</td><td>Kona</td><td>Complete</td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0518R1">P0518R1</a></td><td>LWG</td><td>Allowing copies as arguments to function objects given to parallel algorithms in response to CH11</td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0523R1">P0523R1</a></td><td>LWG</td><td>Wording for CH 10: Complexity of parallel algorithms</td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0548R1">P0548R1</a></td><td>LWG</td><td>common_type and duration</td><td>Kona</td><td>Complete</td><td>5.0</td></tr> @@ -161,7 +161,7 @@ <tr><td><a href="https://wg21.link/P0574R1">P0574R1</a></td><td>LWG</td><td>Algorithm Complexity Constraints and Parallel Overloads</td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0599R1">P0599R1</a></td><td>LWG</td><td>noexcept for hash functions</td><td>Kona</td><td>Complete</td><td>5.0</td></tr> <tr><td><a href="https://wg21.link/P0604R0">P0604R0</a></td><td>LWG</td><td>Resolving GB 55, US 84, US 85, US 86</td><td>Kona</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0607R0">P0607R0</a></td><td>LWG</td><td>Inline Variables for the Standard Library</td><td>Kona</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0607R0">P0607R0</a></td><td>LWG</td><td>Inline Variables for the Standard Library</td><td>Kona</td><td><i>In Progress</i></td><td>6.0</td></tr> <tr><td><a href="https://wg21.link/P0618R0">P0618R0</a></td><td>LWG</td><td>Deprecating <codecvt></td><td>Kona</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0623R0">P0623R0</a></td><td>LWG</td><td>Final C++17 Parallel Algorithms Fixes</td><td>Kona</td><td></td><td></td></tr> <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> @@ -171,6 +171,9 @@ <!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> --> </table> +<p><i>The parts of P0607 that are not done are the <regex> bits.</i></p> +<p><i>So far, only the <string>, sequence containers, container adaptors and <regex> portions of P0433 have been implemented.</i></p> + <p><i>[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]</i></p> <h3>Library Working group Issues Status</h3> @@ -372,7 +375,7 @@ <tr><td><a href="https://wg21.link/LWG2503">2503</a></td><td>multiline option should be added to syntax_option_type</td><td>Issaquah</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2510">2510</a></td><td>Tag types should not be DefaultConstructible</td><td>Issaquah</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2514">2514</a></td><td>Type traits must not be final</td><td>Issaquah</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2518">2518</a></td><td>[fund.ts.v2] Non-member swap for propagate_const should call member swap</td><td>Issaquah</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2518">2518</a></td><td>[fund.ts.v2] Non-member swap for propagate_const should call member swap</td><td>Issaquah</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2519">2519</a></td><td>Iterator operator-= has gratuitous undefined behaviour</td><td>Issaquah</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2521">2521</a></td><td>[fund.ts.v2] weak_ptr's converting move constructor should be modified as well for array support</td><td>Issaquah</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2525">2525</a></td><td>[fund.ts.v2] get_memory_resource should be const and noexcept</td><td>Issaquah</td><td></td></tr> @@ -440,7 +443,7 @@ <tr><td><a href="https://wg21.link/LWG2778">2778</a></td><td>basic_string_view is missing constexpr</td><td>Issaquah</td><td>Complete</td></tr> <tr><td></td><td></td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2260">2260</a></td><td>Missing requirement for Allocator::pointer</td><td>Kona</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2676">2676</a></td><td>Provide filesystem::path overloads for File-based streams</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2676">2676</a></td><td>Provide filesystem::path overloads for File-based streams</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2768">2768</a></td><td>any_cast and move semantics</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&)</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2781">2781</a></td><td>Contradictory requirements for std::function and std::reference_wrapper</td><td>Kona</td><td>Complete</td></tr> @@ -452,7 +455,7 @@ <tr><td><a href="https://wg21.link/LWG2788">2788</a></td><td>basic_string range mutators unintentionally require a default constructible allocator</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2789">2789</a></td><td>Equivalence of contained objects</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2790">2790</a></td><td>Missing specification of istreambuf_iterator::operator-></td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2794">2794</a></td><td>Missing requirements for allocator pointers</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2794">2794</a></td><td>Missing requirements for allocator pointers</td><td>Kona</td><td><I>Nothing to do</I></td></tr> <tr><td><a href="https://wg21.link/LWG2795">2795</a></td><td>§[global.functions] provides incorrect example of ADL use</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2796">2796</a></td><td>tuple should be a literal type</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2801">2801</a></td><td>Default-constructibility of unique_ptr</td><td>Kona</td><td>Complete</td></tr> @@ -461,10 +464,10 @@ <tr><td><a href="https://wg21.link/LWG2806">2806</a></td><td>Base class of bad_optional_access</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2807">2807</a></td><td>std::invoke should use std::is_nothrow_callable</td><td>Kona</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2812">2812</a></td><td>Range access is available with <string_view></td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2824">2824</a></td><td>list::sort should say that the order of elements is unspecified if an exception is thrown</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2824">2824</a></td><td>list::sort should say that the order of elements is unspecified if an exception is thrown</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2826">2826</a></td><td>string_view iterators use old wording</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2834">2834</a></td><td>Resolution LWG 2223 is missing wording about end iterators</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2835">2835</a></td><td>LWG 2536 seems to misspecify <tgmath.h></td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2835">2835</a></td><td>LWG 2536 seems to misspecify <tgmath.h></td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2837">2837</a></td><td>gcd and lcm should support a wider range of input values</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2838">2838</a></td><td>is_literal_type specification needs a little cleanup</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2842">2842</a></td><td>in_place_t check for optional::optional(U&&) should decay U</td><td>Kona</td><td>Complete</td></tr> @@ -473,20 +476,20 @@ <tr><td><a href="https://wg21.link/LWG2855">2855</a></td><td>std::throw_with_nested("string_literal")</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2857">2857</a></td><td>{variant,optional,any}::emplace should return the constructed value</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2861">2861</a></td><td>basic_string should require that charT match traits::char_type</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2866">2866</a></td><td>Incorrect derived classes constraints</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2866">2866</a></td><td>Incorrect derived classes constraints</td><td>Kona</td><td><I>Nothing to do</I></td></tr> <tr><td><a href="https://wg21.link/LWG2868">2868</a></td><td>Missing specification of bad_any_cast::what()</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2872">2872</a></td><td>Add definition for direct-non-list-initialization</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2873">2873</a></td><td>Add noexcept to several shared_ptr related functions</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2874">2874</a></td><td>Constructor shared_ptr::shared_ptr(Y*) should be constrained</td><td>Kona</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2875">2875</a></td><td>shared_ptr::shared_ptr(Y*, D, […]) constructors should be constrained</td><td>Kona</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2876">2876</a></td><td>shared_ptr::shared_ptr(const weak_ptr<Y>&) constructor should be constrained</td><td>Kona</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2878">2878</a></td><td>Missing DefaultConstructible requirement for istream_iterator default constructor</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2878">2878</a></td><td>Missing DefaultConstructible requirement for istream_iterator default constructor</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2890">2890</a></td><td>The definition of 'object state' applies only to class types</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2900">2900</a></td><td>The copy and move constructors of optional are not constexpr</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2903">2903</a></td><td>The form of initialization for the emplace-constructors is not specified</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2903">2903</a></td><td>The form of initialization for the emplace-constructors is not specified</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2904">2904</a></td><td>Make variant move-assignment more exception safe</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2905">2905</a></td><td>is_constructible_v<unique_ptr<P, D>, P, D const &> should be false when D is not copy constructible</td><td>Kona</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2908">2908</a></td><td>The less-than operator for shared pointers could do more</td><td>Kona</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2908">2908</a></td><td>The less-than operator for shared pointers could do more</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2911">2911</a></td><td>An is_aggregate type trait is needed</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2921">2921</a></td><td>packaged_task and type-erased allocators</td><td>Kona</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2934">2934</a></td><td>optional<const T> doesn't compare with T</td><td>Kona</td><td>Complete</td></tr> @@ -501,7 +504,7 @@ <!-- <tr><td></td><td></td><td></td><td></td></tr> --> </table> - <p>Last Updated: 27-Jul-2017</p> + <p>Last Updated: 22-May-2018</p> </div> </body> </html> diff --git a/www/cxx2a_status.html b/www/cxx2a_status.html index 1ff36a70e1e9b..fc69b296ee546 100644 --- a/www/cxx2a_status.html +++ b/www/cxx2a_status.html @@ -54,31 +54,68 @@ <!-- <tr><td><a href="https://wg21.link/n3346">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr> --> - <tr><td><a href="https://wg21.link/P0463R1">P0463R1</a></td><td>LWG</td><td>Endian just Endian</td><td>Toronto</td><td>In progress</td><td></td></tr> + <tr><td><a href="https://wg21.link/P0463R1">P0463R1</a></td><td>LWG</td><td>Endian just Endian</td><td>Toronto</td><td>Complete</td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0674R1">P0674R1</a></td><td>LWG</td><td>Extending make_shared to Support Arrays</td><td>Toronto</td><td></td><td></td></tr> <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0020R6">P0020R6</a></td><td>LWG</td><td>Floating Point Atomic</td><td>Albuquerque</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0053R7">P0053R7</a></td><td>LWG</td><td>C++ Synchronized Buffered Ostream</td><td>Albuquerque</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0202R3">P0202R3</a></td><td>LWG</td><td>Add constexpr modifiers to functions in <algorithm> and <utility> Headers</td><td>Albuquerque</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0415R1">P0415R1</a></td><td>LWG</td><td>Constexpr for <tt>std::complex</tt></td><td>Albuquerque</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0202R3">P0202R3</a></td><td>LWG</td><td>Add constexpr modifiers to functions in <algorithm> and <utility> Headers</td><td>Albuquerque</td><td><I>In Progress</I></td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0415R1">P0415R1</a></td><td>LWG</td><td>Constexpr for <tt>std::complex</tt></td><td>Albuquerque</td><td><I>In Progress</I></td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0439R0">P0439R0</a></td><td>LWG</td><td>Make <tt>std::memory_order</tt> a scoped enumeration</td><td>Albuquerque</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0457R2">P0457R2</a></td><td>LWG</td><td>String Prefix and Suffix Checking</td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr> <tr><td><a href="https://wg21.link/P0550R2">P0550R2</a></td><td>LWG</td><td>Transformation Trait <tt>remove_cvref</tt></td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr> - <tr><td><a href="https://wg21.link/P0600R1">P0600R1</a></td><td>LWG</td><td>nodiscard in the Library</td><td>Albuquerque</td><td><I>In Progress</I></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0600R1">P0600R1</a></td><td>LWG</td><td>nodiscard in the Library</td><td>Albuquerque</td><td><I>In Progress</I></td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0616R0">P0616R0</a></td><td>LWG</td><td>de-pessimize legacy <numeric> algorithms with std::move</td><td>Albuquerque</td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/P0653R2">P0653R2</a></td><td>LWG</td><td>Utility to convert a pointer to a raw pointer</td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr> <tr><td><a href="https://wg21.link/P0718R2">P0718R2</a></td><td>LWG</td><td>Atomic shared_ptr</td><td>Albuquerque</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0767R1">P0767R1</a></td><td>CWG</td><td>Deprecate POD</td><td>Albuquerque</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0767R1">P0767R1</a></td><td>CWG</td><td>Deprecate POD</td><td>Albuquerque</td><td>Complete</td><td>7.0</td></tr> <tr><td><a href="https://wg21.link/P0768R1">P0768R1</a></td><td>CWG</td><td>Library Support for the Spaceship (Comparison) Operator</td><td>Albuquerque</td><td></td><td></td></tr> - <tr><td><a href="https://wg21.link/P0777R1">P0777R1</a></td><td>LWG</td><td>Treating Unnecessary <tt>decay</tt></td><td>Albuquerque</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0777R1">P0777R1</a></td><td>LWG</td><td>Treating Unnecessary <tt>decay</tt></td><td>Albuquerque</td><td>Complete</td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0122R7">P0122R7</a></td><td>LWG</td><td><span></td><td>Jacksonville</td><td><i>Complete</i></td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0355R7">P0355R7</a></td><td>LWG</td><td>Extending chrono to Calendars and Time Zones</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0551R3">P0551R3</a></td><td>LWG</td><td>Thou Shalt Not Specialize <tt>std</tt> Function Templates!</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0753R2">P0753R2</a></td><td>LWG</td><td>Manipulators for C++ Synchronized Buffered Ostream</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0754R2">P0754R2</a></td><td>LWG</td><td><version></td><td>Jacksonville</td><td>Complete</td><td>7.0</td></tr> + <tr><td><a href="https://wg21.link/P0809R0">P0809R0</a></td><td>LWG</td><td>Comparing Unordered Containers</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0858R0">P0858R0</a></td><td>LWG</td><td>Constexpr iterator requirements</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0905R1">P0905R1</a></td><td>CWG</td><td>Symmetry for spaceship</td><td>Jacksonville</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0966R1">P0966R1</a></td><td>LWG</td><td><tt>string::reserve</tt> Should Not Shrink</td><td>Jacksonville</td><td></td><td></td></tr> + + <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0019R8">P0019R8</a></td><td>LWG</td><td>Atomic Ref</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0458R2">P0458R2</a></td><td>LWG</td><td>Checking for Existence of an Element in Associative Containers</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0475R1">P0475R1</a></td><td>LWG</td><td>LWG 2511: guaranteed copy elision for piecewise construction</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0476R2">P0476R2</a></td><td>LWG</td><td>Bit-casting object representations</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0528R3">P0528R3</a></td><td>CWG</td><td>The Curious Case of Padding Bits, Featuring Atomic Compare-and-Exchange</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0542R5">P0542R5</a></td><td>CWG</td><td>Support for contract based programming in C++</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0556R3">P0556R3</a></td><td>LWG</td><td>Integral power-of-2 operations</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0619R4">P0619R4</a></td><td>LWG</td><td>Reviewing Deprecated Facilities of C++17 for C++20</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0646R1">P0646R1</a></td><td>LWG</td><td>Improving the Return Value of Erase-Like Algorithms</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0722R3">P0722R3</a></td><td>CWG</td><td>Efficient sized delete for variable sized classes</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0758R1">P0758R1</a></td><td>LWG</td><td>Implicit conversion traits and utility functions</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0759R1">P0759R1</a></td><td>LWG</td><td>fpos Requirements</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0769R2">P0769R2</a></td><td>LWG</td><td>Add shift to <algorithm></td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0788R3">P0788R3</a></td><td>LWG</td><td>Standard Library Specification in a Concepts and Contracts World</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0879R0">P0879R0</a></td><td>LWG</td><td>Constexpr for swap and swap related functions Also resolves LWG issue 2800.</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0887R1">P0887R1</a></td><td>LWG</td><td>The identity metafunction</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0892R2">P0892R2</a></td><td>CWG</td><td>explicit(bool)</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0898R3">P0898R3</a></td><td>LWG</td><td>Standard Library Concepts</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0935R0">P0935R0</a></td><td>LWG</td><td>Eradicating unnecessarily explicit default constructors from the standard library</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P0941R2">P0941R2</a></td><td>CWG</td><td>Integrating feature-test macros into the C++ WD</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P1023R0">P1023R0</a></td><td>LWG</td><td>constexpr comparison operators for std::array</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P1025R1">P1025R1</a></td><td>CWG</td><td>Update The Reference To The Unicode Standard</td><td>Rapperswil</td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/P1120R0">P1120R0</a></td><td>CWG</td><td>Consistency improvements for <=> and other comparison operators</td><td>Rapperswil</td><td></td><td></td></tr> <!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> --> </table> <p><i>[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]</i></p> -<p><i>The missing bits in P0600 are in [mem.res.class], [mem.poly.allocator.class], and [container.node.overview]</i></p> +<p>The missing bits in P0600 are in [mem.res.class], [mem.poly.allocator.class], and [container.node.overview]</p> + +<p>The missing bits in P0202 are in <tt>copy</tt>, <tt>copy_backwards</tt>, <tt>move</tt>, and <tt>move_backwards</tt> (and the ones that call them: <tt>copy_n</tt>, <tt>rotate_copy</tt>, <tt>merge</tt>, <tt>set_union</tt>, <tt>set_difference</tt>, and <tt>set_symmetric_difference</tt>). This is because the first four algorithms have specializations that call <tt>memmove</tt> which is not constexpr. See <a href="https://bugs.llvm.org/show_bug.cgi?id=25165">Bug 25165</a></p> + <h3>Library Working group Issues Status</h3> <!-- <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> --> @@ -91,7 +128,7 @@ <tr><td><a href="https://wg21.link/LWG2444">2444</a></td><td>Inconsistent complexity for <tt>std::sort_heap</tt></td><td>Toronto</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2593">2593</a></td><td>Moved-from state of Allocators</td><td>Toronto</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2597">2597</a></td><td><tt>std::log</tt> misspecified for complex numbers</td><td>Toronto</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2783">2783</a></td><td><tt>stack::emplace()</tt> and <tt>queue::emplace()</tt> should return <tt>decltype(auto)</tt></td><td>Toronto</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2783">2783</a></td><td><tt>stack::emplace()</tt> and <tt>queue::emplace()</tt> should return <tt>decltype(auto)</tt></td><td>Toronto</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2932">2932</a></td><td>Constraints on parallel algorithm implementations are underspecified</td><td>Toronto</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2937">2937</a></td><td>Is <tt>equivalent("existing_thing", "not_existing_thing")</tt> an error</td><td>Toronto</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2940">2940</a></td><td><tt>result_of</tt> specification also needs a little cleanup</td><td>Toronto</td><td></td></tr> @@ -103,7 +140,7 @@ <tr><td></td><td></td><td></td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2779">2779</a></td><td>[networking.ts] Relax requirements on buffer sequence iterators</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2870">2870</a></td><td>Default value of parameter theta of polar should be dependent</td><td>Albuquerque</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2870">2870</a></td><td>Default value of parameter theta of polar should be dependent</td><td>Albuquerque</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2935">2935</a></td><td>What should create_directories do when p already exists but is not a directory?</td><td>Albuquerque</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2941">2941</a></td><td>[thread.req.timing] wording should apply to both member and namespace-level functions</td><td>Albuquerque</td><td><i>Nothing to do</i></td></tr> <tr><td><a href="https://wg21.link/LWG2944">2944</a></td><td>LWG 2905 accidentally removed requirement that construction of the deleter doesn't throw an exception</td><td>Albuquerque</td><td><i>Nothing to do</i></td></tr> @@ -114,8 +151,8 @@ <tr><td><a href="https://wg21.link/LWG2953">2953</a></td><td>LWG 2853 should apply to deque::erase too</td><td>Albuquerque</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2958">2958</a></td><td>Moves improperly defined as deleted</td><td>Albuquerque</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2964">2964</a></td><td>Apparently redundant requirement for dynamic_pointer_cast</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2965">2965</a></td><td>Non-existing path::native_string() in filesystem_error::what() specification</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2972">2972</a></td><td>What is is_trivially_destructible_v<int>?</td><td>Albuquerque</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG2965">2965</a></td><td>Non-existing path::native_string() in filesystem_error::what() specification</td><td>Albuquerque</td><td>Nothing to do</td></tr> + <tr><td><a href="https://wg21.link/LWG2972">2972</a></td><td>What is is_trivially_destructible_v<int>?</td><td>Albuquerque</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2976">2976</a></td><td>Dangling uses_allocator specialization for packaged_task</td><td>Albuquerque</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG2977">2977</a></td><td>unordered_meow::merge() has incorrect Throws: clause</td><td>Albuquerque</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG2978">2978</a></td><td>Hash support for pmr::string and friends</td><td>Albuquerque</td><td></td></tr> @@ -129,10 +166,63 @@ <tr><td><a href="https://wg21.link/LWG3001">3001</a></td><td>weak_ptr::element_type needs remove_extent_t</td><td>Albuquerque</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG3024">3024</a></td><td>variant's copies must be deleted instead of disabled via SFINAE</td><td>Albuquerque</td><td></td></tr> + <tr><td></td><td></td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2164">2164</a></td><td>What are the semantics of <tt>vector.emplace(vector.begin(), vector.back())</tt>?</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2243">2243</a></td><td><tt>istream::putback</tt> problem</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG2816">2816</a></td><td><tt>resize_file</tt> has impossible postcondition</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG2843">2843</a></td><td>Unclear behavior of <tt>std::pmr::memory_resource::do_allocate()</tt></td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2849">2849</a></td><td>Why does <tt>!is_regular_file(from)</tt> cause <tt>copy_file</tt> to report a "file already exists" error?</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG2851">2851</a></td><td><tt>std::filesystem</tt> enum classes are now underspecified</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG2946">2946</a></td><td>LWG 2758's resolution missed further corrections</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG2969">2969</a></td><td><tt>polymorphic_allocator::construct()</tt> shouldn't pass <tt>resource()</tt></td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2975">2975</a></td><td>Missing case for <tt>pair</tt> construction in scoped and polymorphic allocators</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2989">2989</a></td><td><tt>path</tt>'s stream insertion operator lets you insert everything under the sun</td><td>Jacksonville</td><td>Completed</td></tr> + <tr><td><a href="https://wg21.link/LWG3000">3000</a></td><td><tt>monotonic_memory_resource::do_is_equal</tt> uses <tt>dynamic_cast</tt> unnecessarily</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3002">3002</a></td><td>[networking.ts] <tt>basic_socket_acceptor::is_open()</tt> isn't <tt>noexcept</tt></td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3004">3004</a></td><td>§[string.capacity] and §[vector.capacity] should specify time complexity for <tt>capacity()</tt></td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3005">3005</a></td><td>Destruction order of arrays by <tt>make_shared/allocate_shared</tt> only recommended?</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3007">3007</a></td><td><tt>allocate_shared</tt> should rebind allocator to <i>cv</i>-unqualified <tt>value_type</tt> for construction</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3009">3009</a></td><td>Including <tt><string_view></tt> doesn't provide <tt>std::size/empty/data</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3010">3010</a></td><td>[networking.ts] <tt>uses_executor</tt> says "if a type <tt>T::executor_type</tt> exists"</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3013">3013</a></td><td><tt>(recursive_)directory_iterator</tt> construction and traversal should not be <tt>noexcept</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3014">3014</a></td><td>More <tt>noexcept</tt> issues with filesystem operations</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3015">3015</a></td><td><tt>copy_options::<i>unspecified</i></tt> underspecified</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3017">3017</a></td><td><tt>list splice</tt> functions should use <tt>addressof</tt></td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3020">3020</a></td><td>[networking.ts] Remove spurious nested <tt>value_type</tt> buffer sequence requirement</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3026">3026</a></td><td><tt>filesystem::weakly_canonical</tt> still defined in terms of <tt>canonical(p, base)</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3030">3030</a></td><td>Who shall meet the requirements of <tt>try_lock</tt>?</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3034">3034</a></td><td>P0767R1 breaks previously-standard-layout types</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3035">3035</a></td><td><tt>std::allocator</tt>'s constructors should be <tt>constexpr</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3039">3039</a></td><td>Unnecessary <tt>decay</tt> in <tt>thread</tt> and <tt>packaged_task</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3041">3041</a></td><td>Unnecessary <tt>decay</tt> in <tt>reference_wrapper</tt></td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3042">3042</a></td><td><tt>is_literal_type_v</tt> should be inline</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3043">3043</a></td><td>Bogus postcondition for <tt>filesystem_error</tt> constructor</td><td>Jacksonville</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3045">3045</a></td><td><tt>atomic<<i>floating-point</i>></tt> doesn't have <tt>value_type</tt> or <tt>difference_type</tt></td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3048">3048</a></td><td><tt>transform_reduce(exec, first1, last1, first2, init)</tt> discards execution policy</td><td>Jacksonville</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3051">3051</a></td><td>Floating point classifications were inadvertently changed in P0175</td><td>Jacksonville</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3075">3075</a></td><td><tt>basic_string</tt> needs deduction guides from <tt>basic_string_view</tt></td><td>Jacksonville</td><td>Complete</td></tr> + + <tr><td></td><td></td><td></td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2139">2139</a></td><td>What is a user-defined type?</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG2970">2970</a></td><td>Return type of std::visit misspecified</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3058">3058</a></td><td>Parallel adjacent_difference shouldn't require creating temporaries</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3062">3062</a></td><td>Unnecessary decay_t in is_execution_policy_v should be remove_cvref_t</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3067">3067</a></td><td>recursive_directory_iterator::pop must invalidate</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3071">3071</a></td><td>[networking.ts] read_until still refers to "input sequence"</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3074">3074</a></td><td>Non-member functions for valarray should only deduce from the valarray</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3076">3076</a></td><td>basic_string CTAD ambiguity</td><td>Rapperswil</td><td>Complete</td></tr> + <tr><td><a href="https://wg21.link/LWG3079">3079</a></td><td>LWG 2935 forgot to fix the existing_p overloads of create_directory</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3080">3080</a></td><td>Floating point from_chars pattern specification breaks round-tripping</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3083">3083</a></td><td>What should ios::iword(-1) do?</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3094">3094</a></td><td>[time.duration.io]p4 makes surprising claims about encoding</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3100">3100</a></td><td>Unnecessary and confusing "empty span" wording</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> + <tr><td><a href="https://wg21.link/LWG3102">3102</a></td><td>Clarify span iterator and const_iterator behavior</td><td>Rapperswil</td><td></td></tr> + <tr><td><a href="https://wg21.link/LWG3104">3104</a></td><td>Fixing duration division</td><td>Rapperswil</td><td>Complete</td></tr> + <!-- <tr><td></td><td></td><td></td><td></td></tr> --> </table> - <p>Last Updated: 16-Jul-2017</p> + <p>Last Updated: 23-Jul-2018</p> </div> </body> </html> diff --git a/www/index.html b/www/index.html index eca48ced11cb7..8f9ae510f8f58 100644 --- a/www/index.html +++ b/www/index.html @@ -134,14 +134,17 @@ <p>libc++ is a 100% complete C++11 implementation on Apple's OS X. </p> <p>LLVM and Clang can self host in C++ and C++11 mode with libc++ on Linux.</p> - <p>libc++ is also a 100% complete C++14 implementation. A list of new features and changes for - C++14 can be found <a href="cxx1y_status.html">here</a>.</p> + <p>libc++ is also a 100% complete C++14 implementation. A list of new features and + changes for C++14 can be found <a href="cxx1y_status.html">here</a>.</p> + <p>libc++'s C++17 implementation is not yet complete. A list of features and changes + for C++17 can be found <a href="cxx1z_status.html">here</a>.</p> <p>A list of features and changes for the next C++ standard, known here as - "C++1z" (probably to be C++17) can be found <a href="cxx1z_status.html">here</a>.</p> - <p>A list of features and changes for the C++ standard beyond C++17, known here as "C++2a" (probably to be C++20) can be found <a href="cxx2a_status.html">here</a>.</p> - <p>Implementation of the post-c++14 Technical Specifications is in progress. A list of features and - the current status of these features can be found <a href="ts1z_status.html">here</a>.</p> + <p>Implementation of the post-C++14 Technical Specifications is in progress. A list of features + and the current status of these features can be found <a href="ts1z_status.html">here</a>.</p> + <p>As features get moved from the Technical Specifications into the main standard, we + will (after a period for migration) remove them from the TS implementation. This + process is detailed <a href="TS_deprecation.html">here</a>.</p> <!--======================================================================--> <h2 id="buildbots">Build Bots</h2> diff --git a/www/upcoming_meeting.html b/www/upcoming_meeting.html index 2723c8b6766a5..500bfb4c70166 100644 --- a/www/upcoming_meeting.html +++ b/www/upcoming_meeting.html @@ -32,7 +32,7 @@ <div id="content"> <!--*********************************************************************--> - <h1>libc++ Upcoming Metting Status</h1> + <h1>libc++ Upcoming Meeting Status</h1> <!--*********************************************************************--> <p>This is a temporary page; please check the c++1z status <a href="cxx1z_status.html">here</a></p> @@ -48,7 +48,8 @@ <h3>Paper Status</h3> <table id="papers" border="1"> - <tr><th>Paper #</th><th>Group</th><th>Paper Name</th><th>Meeting</th><th>Status</th><th>First released version</th></tr> + <tr><th>Paper #</th><th>Paper Name</th><th>Meeting</th><th>Status</th></tr> + <tr><td><a href="https://wg21.link/P0805R1">P0805R1</a></td><td>Comparing Containers</td><td>Jacksonville</td><td><i>Patch Ready: <a href="https://reviews.llvm.org/D43773">D43773</a></i></td></tr> <!-- <tr><td><a href="https://wg21.link/LWGn3346">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr> --> @@ -59,64 +60,64 @@ <table id="issues" border="1"> <tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr> - <tr><td><a href="https://wg21.link/LWG2779">2779</a></td><td>[networking.ts] Relax requirements on buffer sequence iterators</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2870">2870</a></td><td>Default value of parameter theta of polar should be dependent</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2935">2935</a></td><td>What should create_directories do when p already exists but is not a directory?</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2941">2941</a></td><td>[thread.req.timing] wording should apply to both member and namespace-level functions</td><td>Albuquerque</td><td>Nothing to do</td></tr> - <tr><td><a href="https://wg21.link/LWG2944">2944</a></td><td>LWG 2905 accidentally removed requirement that construction of the deleter doesn't throw an exception</td><td>Albuquerque</td><td>Nothing to do</td></tr> - <tr><td><a href="https://wg21.link/LWG2945">2945</a></td><td>Order of template parameters in optional comparisons</td><td>Albuquerque</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2948">2948</a></td><td>unique_ptr does not define operator<< for stream output</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2950">2950</a></td><td>std::byte operations are misspecified</td><td>Albuquerque</td><td>Patch Ready</td></tr> - <tr><td><a href="https://wg21.link/LWG2952">2952</a></td><td>iterator_traits should work for pointers to cv T</td><td>Albuquerque</td><td>Patch ready</td></tr> - <tr><td><a href="https://wg21.link/LWG2953">2953</a></td><td>LWG 2853 should apply to deque::erase too</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2964">2964</a></td><td>Apparently redundant requirement for dynamic_pointer_cast</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2965">2965</a></td><td>Non-existing path::native_string() in filesystem_error::what() specification</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2972">2972</a></td><td>What is is_trivially_destructible_v<int>?</td><td>Albuquerque</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2976">2976</a></td><td>Dangling uses_allocator specialization for packaged_task</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2977">2977</a></td><td>unordered_meow::merge() has incorrect Throws: clause</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2978">2978</a></td><td>Hash support for pmr::string and friends</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2979">2979</a></td><td>aligned_union should require complete object types</td><td>Albuquerque</td><td>Complete</td></tr> - <tr><td><a href="https://wg21.link/LWG2980">2980</a></td><td>Cannot compare_exchange empty pointers</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2981">2981</a></td><td>Remove redundant deduction guides from standard library</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2982">2982</a></td><td>Making size_type consistent in associative container deduction guides</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2988">2988</a></td><td>Clause 32 cleanup missed one typename</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2993">2993</a></td><td>reference_wrapper<T> conversion from T&&</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG2998">2998</a></td><td>Requirements on function objects passed to {forward_,}list-specific algorithms</td><td>Albuquerque</td><td>Nothing to do</td></tr> - <tr><td><a href="https://wg21.link/LWG3001">3001</a></td><td>weak_ptr::element_type needs remove_extent_t</td><td>Albuquerque</td><td></td></tr> - <tr><td><a href="https://wg21.link/LWG3024">3024</a></td><td>variant's copies must be deleted instead of disabled via SFINAE</td><td>Albuquerque</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG2139">2139</a></td><td>What is a user-defined type?</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG2970">2970</a></td><td>Return type of std::visit misspecified</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3058">3058</a></td><td>Parallel adjacent_difference shouldn't require creating temporaries</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3062">3062</a></td><td>Unnecessary decay_t in is_execution_policy_v should be remove_cvref_t</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3067">3067</a></td><td>recursive_directory_iterator::pop must invalidate</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> +<tr><td><a href="https://wg21.link/LWG3071">3071</a></td><td>[networking.ts] read_until still refers to "input sequence"</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> +<tr><td><a href="https://wg21.link/LWG3074">3074</a></td><td>Non-member functions for valarray should only deduce from the valarray</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3076">3076</a></td><td>basic_string CTAD ambiguity</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3079">3079</a></td><td>LWG 2935 forgot to fix the existing_p overloads of create_directory</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3080">3080</a></td><td>Floating point from_chars pattern specification breaks round-tripping</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3083">3083</a></td><td>What should ios::iword(-1) do?</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> +<tr><td><a href="https://wg21.link/LWG3094">3094</a></td><td>[time.duration.io]p4 makes surprising claims about encoding</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3100">3100</a></td><td>Unnecessary and confusing "empty span" wording</td><td>Rapperswil</td><td><i>Nothing to do</i></td></tr> +<tr><td><a href="https://wg21.link/LWG3102">3102</a></td><td>Clarify span iterator and const_iterator behavior</td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3104">3104</a></td><td>Fixing duration division</td><td>Rapperswil</td><td>Complete</td></tr> + +</table> + +<h3>Issues to "Review"</h3> +<table border="1"> +<tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr> +<tr><td><a href="https://wg21.link/LWG2412">2412</a></td><td><tt>promise::set_value()</tt> and <tt>promise::get_future()</tt> should not race</td><td>Rapperswil</td><td>Complete</td></tr> +<tr><td><a href="https://wg21.link/LWG2682">2682</a></td><td><code>filesystem::copy()</code> won't create a symlink to a directory</td><td>Rapperswil</td><td>Complete</td></tr> +<tr><td><a href="https://wg21.link/LWG2697">2697</a></td><td>[concurr.ts] Behavior of <tt>future/shared_future</tt> unwrapping constructor when given an invalid <tt>future</tt></td><td>Rapperswil</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG2708">2708</a></td><td><tt>recursive_directory_iterator::recursion_pending()</tt> is incorrectly specified</td><td>Rapperswil</td><td>Complete</td></tr> +<tr><td><a href="https://wg21.link/LWG2936">2936</a></td><td>Path comparison is defined in terms of the generic format</td><td>Rapperswil</td><td></td></tr> +</table> - </table> <h3>Comments about the issues</h3> <ul> -<li>2779 - </li> -<li>2870 - We already default to <tt>T(0)</tt>; but the PR says <tt>T()</tt>. Later - this makes no difference at all; since T has to be float/double/long double</li> -<li>2935 - Eric? </li> -<li>2941 - Wording cleanup; nothing to do.</li> -<li>2944 - Wording cleanup; nothing to do. </li> -<li>2945 - Synopsis was wrong; code was fine. <i>Fixed in r317063</i></li> -<li>2948 - </li> -<li>2950 - Patch ready</li> -<li>2952 - Patch ready</li> -<li>2953 - Probably just wording; check to be sure.</li> -<li>2964 - At the very least, it needs a test.</li> -<li>2965 - Eric? </li> -<li>2972 - We already do this</li> -<li>2976 - Looks simple. </li> -<li>2977 - We haven't implemented p0083r3 yet (Splicing Maps and Sets), so we don't have <tt>merge</tt> for those containers yet</li> -<li>2978 - Straightforward. </li> -<li>2979 - <i>Test added in revision 316969</i></li> -<li>2980 - Needs code changes and tests</li> -<li>2981 - We need to finish the deduction guides before doing this</li> -<li>2982 - We need to finish the deduction guides before doing this</li> -<li>2988 - Simple; once we rewrite <atomic> </li> -<li>2993 - </li> -<li>2998 - Wording cleanup; nothing to do. </li> -<li>3001 - Looks simple. </li> -<li>3024 - </li> +<li>2139 - I think that this is just wording cleanup.</li> +<li>2970 - I think that we already do this - checking with Michael.</li> +<li>3058 - We don't do the parallel algos yet</li> +<li>3062 - This should be very easy.</li> +<li>3067 - Adding restrictions; no code changes needed.</li> +<li>3071 - This is just wording cleanup.</li> +<li>3074 - Large change, that looks straightforward.</li> +<li>3076 - </li> +<li>3079 - Eric? </li> +<li>3080 - We don't have a from_chars implementation yet.</li> +<li>3083 - This is just wording cleanup.</li> +<li>3094 - We haven't implemented Howard's date library yet.</li> +<li>3100 - This is just wording cleanup.</li> +<li>3102 - This should be just adding tests.</li> +<li>3104 - We already do this.</li> +</ul> + +<h3>Comments about the "Review" issues</h3> +<ul> +<li> 2412 - I think we do this already</li> +<li> 2682 - We already to this </li> +<li> 2697 - No concurrency TS implementation yet</li> +<li> 2708 - We already do this </li> +<li> 2936 - Eric - don't we do this already?</li> </ul> -<p>Last Updated: 28-Jun-2017</p> +<p>Last Updated: 10-May-2018</p> </div> </body> </html> |