Boost C++ Libraries: Ticket #12917: string_ref not constructible from rvalue strings anymore https://svn.boost.org/trac10/ticket/12917 <p> The change introduced in this commit is a regression <a class="ext-link" href="https://github.com/boostorg/utility/commit/9960d9f395b79ee860e39064cd46961f76d2cb55"><span class="icon">​</span>https://github.com/boostorg/utility/commit/9960d9f395b79ee860e39064cd46961f76d2cb55</a> </p> <p> This breaks user code and is inconsistent with std::string_view. It is therefore undesirable. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12917 Trac 1.4.3 Marshall Clow Mon, 20 Mar 2017 13:03:36 GMT <link>https://svn.boost.org/trac10/ticket/12917#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12917#comment:1</guid> <description> <p> Can you please give an (non-contrived) example of user code that is broken by this? </p> </description> <category>Ticket</category> </item> <item> <author>arvid.norberg@…</author> <pubDate>Mon, 20 Mar 2017 23:20:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12917#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12917#comment:2</guid> <description> <p> one example of this from my project: </p> <pre class="wiki">std::string combine_path(string_view left, string_view right); </pre><p> It used to be possible to nest these, like this: </p> <pre class="wiki">auto a = combine_path(foo, combine_path(bar, b)); </pre><p> in boost-1.64 this is no longer possible, a proposed work-around is to introduce a <code>string_view make_sv(std::string const&amp;)</code> function, to turn the temporary into an lvalue and construct the string_view from that. <a class="ext-link" href="https://github.com/arvidn/libtorrent/pull/1814"><span class="icon">​</span>https://github.com/arvidn/libtorrent/pull/1814</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 21 Mar 2017 04:29:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12917#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12917#comment:3</guid> <description> <p> thanks for the example. The change was made in response to <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/11740"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/11740</a>. "string_ref not working correctly with rvalue of std::string" </p> </description> <category>Ticket</category> </item> <item> <author>olafvdspek@…</author> <pubDate>Wed, 22 Mar 2017 14:27:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12917#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12917#comment:4</guid> <description> <p> <a class="ext-link" href="https://github.com/mclow/String-Algo/issues/8"><span class="icon">​</span>https://github.com/mclow/String-Algo/issues/8</a> </p> <pre class="wiki">return db.query(make_query(db, q, a...)); </pre><p> make_query returns string, db.query takes string_view. </p> </description> <category>Ticket</category> </item> </channel> </rss>