Boost C++ Libraries: Ticket #7722: smart_ptr includes <new> even if not needed https://svn.boost.org/trac10/ticket/7722 <p> I'm using a subset of Boost in a project compiled with armcc and custom libraries. It's for an embedded system. As expected the compiler and/or libraries are broken, but I was able to workaround almost all problems with the macros <code>BOOST_NO_RTTI</code>, <code>BOOST_EXCEPTION_DISABLE</code> etc. </p> <p> However, the compiler still complains about the missing header <code>&lt;new&gt;</code> (not included in the library), because it's included by <code>smart_ptr/detail/shared_count.hpp</code> to have <code>std::bad_alloc</code> declared. </p> <p> But since <code>std::bad_alloc</code> is used only when BOOST_NO_EXCEPTIONS is defined (I'm <em>not</em> defining it) it's not always really needed. I attached a patch which alleviates the problem for those of us dealing with broken compilers and brings (I believe) no side effect for the rest of the community. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7722 Trac 1.4.3 romuloceccon@… Thu, 22 Nov 2012 11:46:29 GMT attachment set https://svn.boost.org/trac10/ticket/7722 https://svn.boost.org/trac10/ticket/7722 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">shared_count.patch</span> </li> </ul> Ticket Peter Dimov Thu, 22 Nov 2012 17:39:29 GMT <link>https://svn.boost.org/trac10/ticket/7722#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7722#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81488" title="Apply patch from #7722. Refs #7722.">[81488]</a>) Apply patch from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7722" title="#7722: Bugs: smart_ptr includes &lt;new&gt; even if not needed (closed: fixed)">#7722</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7722" title="#7722: Bugs: smart_ptr includes &lt;new&gt; even if not needed (closed: fixed)">#7722</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Thu, 22 Nov 2012 17:41:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7722#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7722#comment:2</guid> <description> <p> It seems to me that you could also create an empty &lt;new&gt; header instead of fixing all includes of it, but the patch doesn't hurt, so I applied it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 05 Dec 2012 03:44:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7722#comment:3 https://svn.boost.org/trac10/ticket/7722#comment:3 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81714" title="Merged revision(s) 81488 from trunk: Apply patch from #7722. Fixes #7722.">[81714]</a>) Merged revision(s) 81488 from trunk: Apply patch from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7722" title="#7722: Bugs: smart_ptr includes &lt;new&gt; even if not needed (closed: fixed)">#7722</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7722" title="#7722: Bugs: smart_ptr includes &lt;new&gt; even if not needed (closed: fixed)">#7722</a>. </p> Ticket