2
0
mirror of https://github.com/boostorg/json.git synced 2026-02-10 23:42:19 +00:00

Remove string::substr:

fix #85

This intentionally leaves the question of
"which storage to use for the return value" unanswered.
This commit is contained in:
Vinnie Falco
2020-05-01 17:59:41 -07:00
parent af66849e90
commit 73b757fc4d

View File

@@ -2288,34 +2288,6 @@ public:
return string_view(*this).substr(pos, count);
}
/** Return a substring.
Returns a substring.
@par Exception Safety
Strong guarantee.
@return A string containing
`{data() + pos, std::min(count, size() - pos))`.
@param pos The index to being the substring at.
The default argument for this parameter is `0`.
@param count The length of the substring.
The default argument for this parameter
is @ref npos.
@throw std::out_of_range `pos > size()`
*/
string
substr(
std::size_t pos = 0,
std::size_t count = npos) const
{
return string(subview(pos, count));
}
//------------------------------------------------------
/** Copy a substring to another string.