Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/interfaces
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-12-26 00:27:11 +0100
committerMartin Hořeňovský2021-12-26 00:35:46 +0100
commit187bf6db2bf6724481599526622f8881f4a46cee (patch)
tree062a18ad6b63314788a913b6c355c4e5a73b8d1c /src/catch2/interfaces
parentcde26de803964197e7d5e988a17a8dad0cd3721e (diff)
downloadcatch3-187bf6db2bf6724481599526622f8881f4a46cee.tar.gz
Split out CaseInsensitiveCmp into its own file
Diffstat (limited to 'src/catch2/interfaces')
-rw-r--r--src/catch2/interfaces/catch_interfaces_combined_tu.cpp12
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_registry.hpp7
2 files changed, 2 insertions, 17 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
index 0f2f406b..b1ce0928 100644
--- a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
+++ b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
@@ -76,21 +76,9 @@ namespace Catch {
#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
-#include <catch2/internal/catch_string_manip.hpp>
-
-#include <algorithm>
namespace Catch {
-
IReporterRegistry::~IReporterRegistry() = default;
- bool IReporterRegistry::CaseInsensitiveCmp::operator()(std::string const& lhs, std::string const& rhs) const {
- return std::lexicographical_compare(lhs.begin(), lhs.end(),
- rhs.begin(), rhs.end(),
- [](char l, char r) {
- return toLower(l) < toLower(r);
- });
- }
-
}
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
index 0228f9c3..57c652e7 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
@@ -8,6 +8,7 @@
#ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
#define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+#include <catch2/internal/catch_case_insensitive_comparisons.hpp>
#include <catch2/internal/catch_unique_ptr.hpp>
#include <string>
@@ -24,11 +25,7 @@ namespace Catch {
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
struct IReporterRegistry {
- struct CaseInsensitiveCmp {
- bool operator()(std::string const& lhs, std::string const& rhs) const;
- };
-
- using FactoryMap = std::map<std::string, IReporterFactoryPtr, CaseInsensitiveCmp>;
+ using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>;
using Listeners = std::vector<IReporterFactoryPtr>;
virtual ~IReporterRegistry(); // = default