Boost C++ Libraries: Ticket #5178: boost::exception uses invalid C++ code https://svn.boost.org/trac10/ticket/5178 <p> boost::exception uses a </p> <p> std::map&lt;type_info_, shared_ptr&lt;error_info_base&gt; &gt; in error_info_container_impl. This map is copied in clone(). However, type_info_ contains a member which is a reference, so it is not copyable. </p> <p> The standard says that you can only copy a std::map&lt;T,U&gt; if both T and U are copyable. Some standard libraries don't make use of this requirement, but libc++ does. </p> <p> The easiest fix to this would be to make type_info_ take it's reference member instead by pointer, and make it copyable. </p> <p> Before I prepare a full patch, I wondered if anyone had any comments, as this is a fairly big change to boost::exception </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5178 Trac 1.4.3 Steven Watanabe Fri, 11 Feb 2011 00:20:31 GMT <link>https://svn.boost.org/trac10/ticket/5178#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5178#comment:1</guid> <description> <p> Actually, the solution is simple: </p> <ul><li>Implement the copy constructor </li><li>Use it in clone </li></ul><p> The standard only requires the template arguments to be CopyAssignable for assignment, not for copy construction. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Chris Jefferson</dc:creator> <pubDate>Fri, 11 Feb 2011 00:27:30 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5178 https://svn.boost.org/trac10/ticket/5178 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">info_patch.hpp</span> </li> </ul> <p> Patch to info.hpp, using new copy constructor </p> Ticket Chris Jefferson Fri, 11 Feb 2011 00:32:29 GMT <link>https://svn.boost.org/trac10/ticket/5178#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5178#comment:2</guid> <description> <p> You are right, that is much simpler, and I missed it. Thanks. </p> <p> The attached patch does exactly this, and fixes all but one bug in libc++ boost::exception (which is a different problem). gcc darwin still passes all tests. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Fri, 11 Feb 2011 23:53:25 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5178#comment:3 https://svn.boost.org/trac10/ticket/5178#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> Ticket