Boost C++ Libraries: Ticket #11740: string_ref not working correctly with rvalue of std::string https://svn.boost.org/trac10/ticket/11740 <p> This is currently allowed: boost::string_ref something; something = "temp"; <em> works ok something = std::string("temp"); </em>doesn't work corretly </p> <p> while it should not be a should only be: boost::string_ref something; something = "temp"; <em> works ok std::string tempStr("temp"); something = tempStr; </em> works ok </p> <p> Current version is pointing to buffer that is no longer part of any std::string, therefore if you use something like valgrind it will trigger and error. </p> <p> Attached is a simple patch that prevent this. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11740 Trac 1.4.3 steweg@… Mon, 19 Oct 2015 15:04:52 GMT attachment set https://svn.boost.org/trac10/ticket/11740 https://svn.boost.org/trac10/ticket/11740 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch</span> </li> </ul> <p> proposed patch </p> Ticket steweg@… Mon, 19 Oct 2015 15:07:11 GMT attachment set https://svn.boost.org/trac10/ticket/11740 https://svn.boost.org/trac10/ticket/11740 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">decription with formatting.txt</span> </li> </ul> <p> Descirption (again) with correct formatting </p> Ticket Marshall Clow Mon, 13 Feb 2017 19:00:54 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11740#comment:1 https://svn.boost.org/trac10/ticket/11740#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed w/ a test in 9960d9f395b79ee860e39064cd46961f76d2cb55 Unfortunately, the fix only works in C++11 and later. </p> Ticket