Boost logo

Boost :

Subject: Re: [boost] Constructing string_ref from rvalue string
From: Jonathan Müller (jonathanmueller.dev_at_[hidden])
Date: 2017-03-24 07:57:46


On Mar 24, 2017 08:23, "Simon Sasburg via Boost" <boost_at_[hidden]>
wrote:

> I'll also point out that that commit was in response to this bug report:
> https://svn.boost.org/trac/boost/ticket/11740
>

 I see. Using boost::string_ref in that way (local variable) would raise a
big red flag for us. So i understand that the change does add some safety,
but it also breaks usages that are completely fine. We 'solved' the safety
issue with a really simple rule (only use boost::string_ref as function
parameters).

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/
mailman/listinfo.cgi/boost

That's exactly what I said in my blog post. Function parameters are a
special use case that require a different type, that type is
std::string_view, for everything else a boost::string_ref that doesn't bind
to rvalues could be repurposed.


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