vendredi 19 mai 2023

boost::to_lower_copy() too expensive as it extracts a facet from the passed locale

I've got std::use_facet<std::ctype<char> > showing up in a profiler. It is called indirectly from boost::to_lower_copy(). I remember fixing this for a comparison operator by storing the reference returned from std::use_facet<> only once and repeatedly calling facet.tolower(char) with it, avoiding repeated calls to std::use_facet<>. Is there a way to avoid this short of writing one's own to_lower(const std::string&) function?

Aucun commentaire:

Enregistrer un commentaire