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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-12-26 00:52:52 +0100
committerMartin Hořeňovský2021-12-26 00:52:52 +0100
commit156e6fdfa9122ea9b52fe6e65f20c66cf38688a7 (patch)
tree2fc9498df69c65278c7f7ef8b97cc6bdc055cb90 /src/catch2/internal
parent187bf6db2bf6724481599526622f8881f4a46cee (diff)
downloadcatch3-156e6fdfa9122ea9b52fe6e65f20c66cf38688a7.tar.gz
CaseInsensitiveLess takes args as StringRefs
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_case_insensitive_comparisons.cpp4
-rw-r--r--src/catch2/internal/catch_case_insensitive_comparisons.hpp6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/catch2/internal/catch_case_insensitive_comparisons.cpp b/src/catch2/internal/catch_case_insensitive_comparisons.cpp
index 3081edb3..3f81b219 100644
--- a/src/catch2/internal/catch_case_insensitive_comparisons.cpp
+++ b/src/catch2/internal/catch_case_insensitive_comparisons.cpp
@@ -14,8 +14,8 @@
namespace Catch {
namespace Detail {
- bool CaseInsensitiveLess::operator()( std::string const& lhs,
- std::string const& rhs ) const {
+ bool CaseInsensitiveLess::operator()( StringRef lhs,
+ StringRef rhs ) const {
return std::lexicographical_compare(
lhs.begin(), lhs.end(),
rhs.begin(), rhs.end(),
diff --git a/src/catch2/internal/catch_case_insensitive_comparisons.hpp b/src/catch2/internal/catch_case_insensitive_comparisons.hpp
index 372809d4..6dfe712b 100644
--- a/src/catch2/internal/catch_case_insensitive_comparisons.hpp
+++ b/src/catch2/internal/catch_case_insensitive_comparisons.hpp
@@ -8,14 +8,16 @@
#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
+#include <catch2/internal/catch_stringref.hpp>
+
#include <string>
namespace Catch {
namespace Detail {
//! Provides case-insensitive `op<` semantics when called
struct CaseInsensitiveLess {
- bool operator()( std::string const& lhs,
- std::string const& rhs ) const;
+ bool operator()( StringRef lhs,
+ StringRef rhs ) const;
};
} // namespace Detail