diff options
| author | Leitwolf11 | 2026-10-31 13:00:24 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-10-31 13:00:24 +0300 |
| commit | 8814bd0b796b2e291fa5b4a1033f0313c8a26065 (patch) | |
| tree | e87e5f5150f3712bb05ed53911425600aa871f45 /src/Progmasoft/PropertyEngine.cpp | |
| parent | 6a42cdf6461b2577106ef094d6f98025554b6077 (diff) | |
| download | catch3-8814bd0b796b2e291fa5b4a1033f0313c8a26065.tar.gz | |
Build Catch3 as C++17
C++17 is still the widest common target, and a library built on it stays
usable from C++17 and every later standard, while C++20 would have left
out many users.
Concepts become enable_if on named traits in Detail/TypeTraits.hpp, which
also replaces std::remove_cvref_t and std::identity. std::span becomes
std::vector references, std::bit_cast becomes static_cast and memcpy,
template lambdas become helper templates, and std::erase_if, contains,
starts_with and ends_with have their C++17 forms. Random::Between no
longer uses a lambda over a constexpr local, which MSVC rejects outside
/permissive-, so the headers work under its default mode too.
Tests give up designated initializers, which MSVC refuses in C++17. CI
builds the matrix in C++17 and C++20, since the headers promise both.
Diffstat (limited to 'src/Progmasoft/PropertyEngine.cpp')
| -rw-r--r-- | src/Progmasoft/PropertyEngine.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Progmasoft/PropertyEngine.cpp b/src/Progmasoft/PropertyEngine.cpp index 571a5ac3..7151dd1a 100644 --- a/src/Progmasoft/PropertyEngine.cpp +++ b/src/Progmasoft/PropertyEngine.cpp @@ -231,7 +231,7 @@ namespace Progmasoft::Catch3::Detail std::size_t size, bool describe) { - return Execute(ChoiceSource(std::span(choices), size), describe); + return Execute(ChoiceSource(choices, size), describe); } static PropertyResult @@ -302,10 +302,16 @@ namespace Progmasoft::Catch3::Detail // Only the examples checked here are dropped; another // process may have stored new ones meanwhile. database_.Update([&](std::vector<std::string> &stored) { - std::erase_if(stored, [&](const std::string &token) { - return std::find(tokens.begin(), tokens.end(), token) - != tokens.end(); - }); + const auto removed = std::remove_if( + stored.begin(), + stored.end(), + [&](const std::string &token) { + return std::find(tokens.begin(), + tokens.end(), + token) + != tokens.end(); + }); + stored.erase(removed, stored.end()); }); } return std::nullopt; |