mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
CaseInsensitiveLess takes args as StringRefs
This commit is contained in:
parent
187bf6db2b
commit
156e6fdfa9
@ -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(),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user