From [[string.capacity]](https://eel.is/c++draft/string.capacity#8): > Mandates: OP has an integer-like type ([[iterator.concept.winc]](https://eel.is/c++draft/iterator.concept.winc)). The following should be rejected because `bool` is not an integer-like type: ```cpp #include <string> int main() { std::string s; s.resize_and_overwrite(10, [](char*, std::size_t) { return true; }); } ``` https://godbolt.org/z/YEshcM1P5