, .
std::string downcased(std::string s) {
std::locale loc{"en_US.UTF-8"};
std::transform(begin(s), end(s), begin(s), [&](auto const& c) {
return std::tolower(c, loc);
});
return s;
}
,
if(downcased(input_string) == "yes") ...
"" .
Boost, downcased():
if(boost::algorithm::to_lower_copy(input_string) == "yes") ...
, ++ C. Python, , , -. ++ std::vector<> . , , , . , algortithms, std::find(), . ,
std::vector<std::string> const ys = {"yes", "yEs", };
if(std::find(begin(ys), end(ys), "yeS") != end(ys))
...
user5154412