Boost C++ Libraries: Ticket #10751: exception_detail::set_info should use make_shared https://svn.boost.org/trac10/ticket/10751 <p> info.hpp:170 </p> <pre class="wiki"> shared_ptr&lt;error_info_tag_t&gt; p( new error_info_tag_t(v) ); </pre><p> should be </p> <pre class="wiki"> shared_ptr&lt;error_info_tag_t&gt; p = make_shared&lt;error_info_tag_t&gt;(v); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10751 Trac 1.4.3 Emil Dotchevski Wed, 05 Nov 2014 01:33:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10751#comment:1 https://svn.boost.org/trac10/ticket/10751#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">worksforme</span> </li> </ul> <p> This doesn't seem like a bug to me. </p> Ticket Li Yinan <li_yinan@…> Wed, 05 Nov 2014 13:54:31 GMT <link>https://svn.boost.org/trac10/ticket/10751#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10751#comment:2</guid> <description> <p> Sorry, but I think it will be less likely to have bad_alloc with make_shared. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 05 Nov 2014 20:23:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10751#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10751#comment:3</guid> <description> <p> This isn't necessarily true: the free space may by fragmented and it is possible that two smaller allocations succeed while the single bigger allocation from make_shared fails. </p> <p> Either way the program should be exception-safe in case adding error info throws. </p> </description> <category>Ticket</category> </item> </channel> </rss>