From 73b757fc4de0cdf8f94ffba2b6450eec3cd66075 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 1 May 2020 17:59:41 -0700 Subject: [PATCH] Remove string::substr: fix #85 This intentionally leaves the question of "which storage to use for the return value" unanswered. --- include/boost/json/string.hpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/include/boost/json/string.hpp b/include/boost/json/string.hpp index c77474c5..4333bfed 100644 --- a/include/boost/json/string.hpp +++ b/include/boost/json/string.hpp @@ -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.