Fix transform without a lambda

Catch apparently supports targeting C++03, so use an inline function
instead.
This commit is contained in:
Billy Robert O'Neal III 2016-10-14 14:08:57 -07:00
parent 79f01100e3
commit c17ba0870a

View File

@ -21,9 +21,11 @@ namespace Catch {
bool contains( std::string const& s, std::string const& infix ) {
return s.find( infix ) != std::string::npos;
}
char toLowerCh(char c) {
return static_cast<char>( ::tolower( c ) );
}
void toLowerInPlace( std::string& s ) {
std::transform( s.begin(), s.end(), s.begin(),
[](char c) { return static_cast<char>(::tolower(c)); } );
std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
}
std::string toLower( std::string const& s ) {
std::string lc = s;