23 Strings library [strings]

23.4 String classes [string.classes]

23.4.3 Class template basic_string [basic.string]

23.4.3.8 String operations [string.ops]

23.4.3.8.3 basic_string​::​substr [string.substr]

constexpr basic_string substr(size_type pos = 0, size_type n = npos) const &;
Effects: Equivalent to: return basic_string(*this, pos, n);
constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&;
Effects: Equivalent to: return basic_string(std​::​move(*this), pos, n);