This is a misfeature and is inconsistent with std::string_view.
I just made a ticket for it here
https://svn.boost.org/trac/boost/ticket/12917
On 17 March 2017 at 07:29, Simon Sasburg via Boost
I've just tested our codebase with the 1.64.0 master snapshot, and i've encountered an issue which i've tracked down to this commit:
https://github.com/boostorg/utility/commit/9960d9f395b79ee860e39064cd4696 1f76d2cb55
Basically this removes the constructor which allows constructing a boost::string_ref from an rvalue std::string. I am wondering if this is really that dangerous. In our codebase we almost exlusively use boost::string_ref as function parameters, with the understanding that passed string_refs parameters are only valid within the function body. (so you need to copy it into an std::string if you need to access it afterwards) With these constraints i think it is OK to construct a string_ref from an rvalue std::string because the temporary should live long enough. (but please correct me if i'm wrong here)
Is the safety (?) added by this commit worth it if it breaks working code?
Simon
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/ mailman/listinfo.cgi/boost