
On Thu, Oct 21, 2021 at 6:47 AM Phil Endecott via Boost <boost@lists.boost.org> wrote:
I'd be happy with the parsing function returning a view if its name reflected that. My complaint is that the short name parse_url() doesn't give the user that "obvious indication".
In C++ the "name" of a function includes its return type and parameter types, so actually the name is: result<url_view> parse_uri( string_view s ) noexcept; Thus it already reflects that a view is returned. If you think that the function name is just "parse_uri," then we have even bigger usability problems, as users are going to be in for a surprise to discover they have to call has_error(), value(), or error() on the returned result<url_view> to get something recognizable. Thanks