diff --git a/CMakeLists.txt b/CMakeLists.txt index 24c787c..da33ec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,7 +114,7 @@ set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parse set(META_FEATURES_FOR_COMPILER_DETECTION_HEADER cxx_thread_local) set(META_VERSION_MAJOR 5) set(META_VERSION_MINOR 10) -set(META_VERSION_PATCH 1) +set(META_VERSION_PATCH 2) # find required 3rd party libraries include(3rdParty) diff --git a/conversion/stringconversion.h b/conversion/stringconversion.h index d6357b0..8671ffe 100644 --- a/conversion/stringconversion.h +++ b/conversion/stringconversion.h @@ -194,7 +194,15 @@ Container splitStringSimple(const typename Container::value_type &string, const if (delimPos == Container::value_type::npos) { delimPos = string.size(); } - res.emplace_back(string.substr(i, delimPos - i)); +#if __cplusplus >= 202002 + if constexpr (requires { res.emplace_back(string); }) { +#endif + res.emplace_back(string.substr(i, delimPos - i)); +#if __cplusplus >= 202002 + } else { + res.emplace(string.substr(i, delimPos - i)); + } +#endif } return res; }