Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2021-10-21 14:52:49


On Thu, Oct 21, 2021 at 6:47 AM Phil Endecott via Boost
<boost_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk