Skip to content

[libc++] <string>: string::resize_and_overwrite missing _Mandates_ #160577

@hewillk

Description

@hewillk

From [string.capacity]:

Mandates: OP has an integer-like type ([iterator.concept.winc]).

The following should be rejected because bool is not an integer-like type:

#include <string>

int main() {
  std::string s;
  s.resize_and_overwrite(10, [](char*, std::size_t) { return true; });
}

https://godbolt.org/z/YEshcM1P5

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions