From d5718258083be61d600e55b70915ccca43666e0f Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 22 Apr 2022 00:40:16 +0200 Subject: [PATCH] bump C++ requirement to 17 (ns3 will need it for v3.26) --- CMakeLists.txt | 8 ++++---- src/xbt/PropertyHolder.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41c59b6e91..ca5ab2d733 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,15 +45,15 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") if (CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0") message(FATAL_ERROR - "SimGrid needs at least g++ version 5.0 to compile but you have ${CMAKE_CXX_COMPILER_VERSION}." - "You need a sufficient support of c++14 to compile SimGrid.") + "SimGrid needs at least g++ version 7.0 to compile but you have ${CMAKE_CXX_COMPILER_VERSION}." + "You need a sufficient support of c++17 to compile SimGrid.") endif() endif() ## We need a decent support of the C++14 and C11 standards -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 11) diff --git a/src/xbt/PropertyHolder.cpp b/src/xbt/PropertyHolder.cpp index e77cd01f1c..bb798c9f90 100644 --- a/src/xbt/PropertyHolder.cpp +++ b/src/xbt/PropertyHolder.cpp @@ -43,7 +43,7 @@ template void PropertyHolder::set_properties(const Assoc& properti properties_ = std::make_unique>(); std::unordered_map props(std::cbegin(properties), std::cend(properties)); #if __cplusplus >= 201703L - props.merge(properties_); + props.merge(*properties_); #else props.insert(properties_->cbegin(), properties_->cend()); #endif -- 2.20.1