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 Catch {
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
|
|
||||||
bool CaseInsensitiveLess::operator()( std::string const& lhs,
|
bool CaseInsensitiveLess::operator()( StringRef lhs,
|
||||||
std::string const& rhs ) const {
|
StringRef rhs ) const {
|
||||||
return std::lexicographical_compare(
|
return std::lexicographical_compare(
|
||||||
lhs.begin(), lhs.end(),
|
lhs.begin(), lhs.end(),
|
||||||
rhs.begin(), rhs.end(),
|
rhs.begin(), rhs.end(),
|
||||||
|
@ -8,14 +8,16 @@
|
|||||||
#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
|
#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
|
||||||
#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
|
#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include <catch2/internal/catch_stringref.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
//! Provides case-insensitive `op<` semantics when called
|
//! Provides case-insensitive `op<` semantics when called
|
||||||
struct CaseInsensitiveLess {
|
struct CaseInsensitiveLess {
|
||||||
bool operator()( std::string const& lhs,
|
bool operator()( StringRef lhs,
|
||||||
std::string const& rhs ) const;
|
StringRef rhs ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Detail
|
} // namespace Detail
|
||||||
|
Loading…
Reference in New Issue
Block a user