14 Oct
2021
14 Oct
'21
1:02 p.m.
On Thu, Oct 14, 2021 at 2:04 PM Phil Endecott via Boost < boost@lists.boost.org> 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?