https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98723
--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, that looks like nice improvement, thanks. I think it would be easier to read as: if (!_M_equiv_set.empty()) { auto __x = _M_traits.transform_primary(&__ch, &__ch+1); auto __p = std::find(_M_equiv_set.begin(), _M_equiv_set.end(), __x); if (__p != _M_equiv_set.end()) return true; } Could you send a patch to the mailing lists for review?