From 0503cf2618186da0f1df319d44b0927c53a29497 Mon Sep 17 00:00:00 2001 From: Erik Rigtorp Date: Sat, 14 Nov 2026 12:24:17 -0500 Subject: [PATCH] Upgrade minimum C++ standard to C++20 --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 3 +-- README.md | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afbf59e..ad60b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: ci: uses: rigtorp/.github/.github/workflows/cpp-ci.yml@master with: - cxx-standards: '["14", "17", "20"]' + cxx-standards: '["20"]' run-sanitizers: true enable-windows: true enable-macos: true diff --git a/CMakeLists.txt b/CMakeLists.txt index e53db20..bb52c1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ project(HashMap # ----------------------------------------------------------------------------- add_library(HashMap INTERFACE) add_library(HashMap::HashMap ALIAS HashMap) -target_compile_features(HashMap INTERFACE cxx_std_14) +target_compile_features(HashMap INTERFACE cxx_std_20) target_sources(HashMap INTERFACE FILE_SET HEADERS BASE_DIRS include @@ -44,7 +44,6 @@ if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING) if(NOT WIN32) hashmap_executable(HashMapBenchmark src/HashMapBenchmark.cpp) - target_compile_features(HashMapBenchmark PRIVATE cxx_std_17) if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$") target_compile_options(HashMapBenchmark PRIVATE -msse4.2) endif() diff --git a/README.md b/README.md index e7b64a4..eee86b3 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ The rest of the member functions are implemented as for ## Build and install -The header-only `HashMap::HashMap` CMake target requires C++14. Configure with +The header-only `HashMap::HashMap` CMake target requires C++20. Configure with CMake 3.24 or newer: ```sh