The C++ Standard doesn't say that: https://eel.is/c++draft/string.substr
|
_NODISCARD _CONSTEXPR20 basic_string substr(const size_type _Off = 0, const size_type _Count = npos) const {
|
|
// return [_Off, _Off + _Count) as new string
|
|
return basic_string{*this, _Off, _Count, get_allocator()};
|
|
}
|
@CaseyCarter agreed. He also assumed that we'll fix this when implementing WG21-P2438 but I still decided to create an issue to not forget about it.