mirror of
https://github.com/pantor/inja.git
synced 2026-03-18 15:05:59 +00:00
Fix the std::transform bug (#56)
https://stackoverflow.com/questions/16792456/no-matching-function-for-call-to-transform This is a fix for using toupper and tolower with std::transform
This commit is contained in:
@@ -396,12 +396,12 @@ public:
|
||||
switch (element.function) {
|
||||
case Parsed::Function::Upper: {
|
||||
std::string str = eval_expression<std::string>(element.args[0], data);
|
||||
std::transform(str.begin(), str.end(), str.begin(), toupper);
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
|
||||
return str;
|
||||
}
|
||||
case Parsed::Function::Lower: {
|
||||
std::string str = eval_expression<std::string>(element.args[0], data);
|
||||
std::transform(str.begin(), str.end(), str.begin(), tolower);
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
return str;
|
||||
}
|
||||
case Parsed::Function::Range: {
|
||||
|
||||
Reference in New Issue
Block a user