August 2017
Intermediate to advanced
438 pages
14h 19m
English
There are also methods that modify strings in-place. They just do not end on _copy and return void. All the case-insensitive methods (the ones that start with i) accept std::locale as the last parameter and use a default constructed locale as a default parameter.
Do you use case insensitive methods a lot and need a better performance? Just create a std::locale variable holding std::locale::classic() and pass it to all the algorithms. On small strings most of the time is eaten by std::locale constructions, not by the algorithms:
#include <boost/algorithm/string/erase.hpp>void erasing_examples_locale() { namespace ba = boost::algorithm; const std::locale loc = std::locale::classic(); const std::string r1 = ba::ierase_all_copy(str, ...Read now
Unlock full access