mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Fix transform without a lambda
Catch apparently supports targeting C++03, so use an inline function instead.
This commit is contained in:
parent
79f01100e3
commit
c17ba0870a
@ -21,9 +21,11 @@ namespace Catch {
|
|||||||
bool contains( std::string const& s, std::string const& infix ) {
|
bool contains( std::string const& s, std::string const& infix ) {
|
||||||
return s.find( infix ) != std::string::npos;
|
return s.find( infix ) != std::string::npos;
|
||||||
}
|
}
|
||||||
|
char toLowerCh(char c) {
|
||||||
|
return static_cast<char>( ::tolower( c ) );
|
||||||
|
}
|
||||||
void toLowerInPlace( std::string& s ) {
|
void toLowerInPlace( std::string& s ) {
|
||||||
std::transform( s.begin(), s.end(), s.begin(),
|
std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
|
||||||
[](char c) { return static_cast<char>(::tolower(c)); } );
|
|
||||||
}
|
}
|
||||||
std::string toLower( std::string const& s ) {
|
std::string toLower( std::string const& s ) {
|
||||||
std::string lc = s;
|
std::string lc = s;
|
||||||
|
Loading…
Reference in New Issue
Block a user