diff options
| author | Leitwolf | 2026-10-31 17:18:21 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-31 17:18:21 +0300 |
| commit | 326ea0c0213aeecb6b984bba3dabb0ebad97679e (patch) | |
| tree | 5cec698f0bc0b8a60f45e866fb40f2fd8a358bd1 /extras/catch_amalgamated.cpp | |
| parent | 6a42cdf6461b2577106ef094d6f98025554b6077 (diff) | |
| parent | afe91797e9d50cd4712d3694a2e5fedfc0b966b1 (diff) | |
| download | catch3-326ea0c0213aeecb6b984bba3dabb0ebad97679e.tar.gz | |
Merge pull request #22 from Progmasoft/build/cpp17
Build Catch3 as C++17
Diffstat (limited to 'extras/catch_amalgamated.cpp')
| -rw-r--r-- | extras/catch_amalgamated.cpp | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index fc87bf40..3b15cc2d 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7,14 +7,14 @@ // SPDX-License-Identifier: BSL-1.0 // Catch3 v0.3.0, on the Catch2 v3.16.1 engine -// Generated: 2026-10-29 19:30:41.305371 +// Generated: 2026-10-31 13:33:37.309963 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. // // The parts that come from src/Progmasoft, the Catch3 runner, keep // their own copyright and license lines (MPL-2.0 WITH -// AdditionRef-Progmasoft-Exception-1.1). The runner needs C++20. +// AdditionRef-Progmasoft-Exception-1.1). The runner needs C++17. // ---------------------------------------------------------- #include "catch_amalgamated.hpp" @@ -14663,18 +14663,22 @@ namespace Progmasoft::Catch3::Runner for (const auto &[name, value] : additions) { const std::wstring wideName = Widen(name); - std::erase_if(entries, [&](const std::wstring &entry) { - // A leading '=' marks the hidden per-drive variables. - const auto equals = entry.find(L'=', 1); - return equals == wideName.size() - && CompareStringOrdinal( - entry.data(), - static_cast<int>(equals), - wideName.data(), - static_cast<int>(wideName.size()), - TRUE) - == CSTR_EQUAL; - }); + const auto removed = std::remove_if( + entries.begin(), + entries.end(), + [&](const std::wstring &entry) { + // A leading '=' marks the hidden per-drive variables. + const auto equals = entry.find(L'=', 1); + return equals == wideName.size() + && CompareStringOrdinal( + entry.data(), + static_cast<int>(equals), + wideName.data(), + static_cast<int>(wideName.size()), + TRUE) + == CSTR_EQUAL; + }); + entries.erase(removed, entries.end()); entries.push_back(wideName + L"=" + Widen(value)); } std::wstring block; @@ -15429,11 +15433,17 @@ namespace Progmasoft::Catch3::Runner } for (const auto &[name, value] : options.environment) { - std::erase_if(environmentStorage, [&](const std::string &entry) { - return entry.size() > name.size() - && entry.compare(0, name.size(), name) == 0 - && entry[name.size()] == '='; - }); + // A lambda cannot capture a structured binding in C++17. + const std::string &variable = name; + const auto removed = std::remove_if( + environmentStorage.begin(), + environmentStorage.end(), + [&](const std::string &entry) { + return entry.size() > variable.size() + && entry.compare(0, variable.size(), variable) == 0 + && entry[variable.size()] == '='; + }); + environmentStorage.erase(removed, environmentStorage.end()); environmentStorage.push_back(name + "=" + value); } std::vector<char *> environment; |