Boost logo

Boost :

From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2021-10-14 13:02:19


On Thu, Oct 14, 2021 at 2:04 PM Phil Endecott via Boost <
boost_at_[hidden]> wrote:

> >> auto url = parse_url(str);
> >>
> >> The problem is that url is a view of the string parameter, but
> >> nothing warns the user about that and...
> >
> > Well, it is documented profusely. I agree there is some danger here
> > but with great danger comes great power. Or something about
> great responsibility?
>
> I don't think this is acceptable. What do others think?

I don't mind. It's no different than std::string and std::string_view.
You pay for copies only if you really want to. Maybe having
parse_url_as_view(str)
and a safer parse_url(str) using the former but not returning a view would
satisfy you?


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