Boost C++ Libraries: Ticket #10984: libs/assign/test/basic.cpp Error: The name exception is ambiguous, exception and boost::exception https://svn.boost.org/trac10/ticket/10984 <ol><li>Description of the failure </li></ol><p> ============================== On Solaris 11.2 Oracle Studio 12.4 C++ compiler under -std=c++11 option produces the following error messages for libs/assign/test/basic.cpp </p> <p> "/usr/include/math.h", line 215: Error: The name exception is ambiguous, exception and boost::exception. </p> <p> and actually it produces similar error messages for small test like this: </p> <blockquote> <p> namespace boost { </p> <blockquote> <p> class exception; </p> </blockquote> <p> } using namespace boost; #include &lt;algorithm&gt; </p> </blockquote> <p> Note that in the original boost harness "class exception;" can be found inside: boost/exception/exception.hpp </p> <ol start="2"><li>Cause of the failure. </li></ol><p> ======================== This is a C++ vs Unix or Boost vs Unix issue. </p> <p> Standard Unix requires "struct exception" in the global namespace when &lt;math.h&gt; is included. This conflicts with std::exception or boost::exception, but only when there are using-declarations or using-directives that bring std::exception or boost::exception into the global namespace. </p> <p> When &lt;math.h&gt; is included, user code must avoid all of the following at file scope (in the global namespace): using namespace std; using namespace boost; using std::exception; using boost::exception; </p> <ol start="3"><li>Possible Solution. </li></ol><p> ====================== </p> <ul><li>Remove 2 lines: </li></ul><blockquote> <blockquote> <p> using namespace std; using namespace boost; </p> </blockquote> </blockquote> <ul><li>Add std:: prefix to all 'vector', 'map', 'string' invocations. </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10984 Trac 1.4.3 Sergey.Sprogis@… Fri, 30 Jan 2015 20:19:28 GMT owner, component changed https://svn.boost.org/trac10/ticket/10984#comment:1 https://svn.boost.org/trac10/ticket/10984#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">René Rivera</span> to <span class="trac-author">Thorsten Ottosen</span> </li> <li><strong>component</strong> <span class="trac-field-old">Regression Testing</span> → <span class="trac-field-new">assign</span> </li> </ul> Ticket Aparna Kumta <aparna.kumta@…> Tue, 05 Jan 2016 22:14:39 GMT <link>https://svn.boost.org/trac10/ticket/10984#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10984#comment:2</guid> <description> <p> PR: <a class="ext-link" href="https://github.com/boostorg/assign/pull/11"><span class="icon">​</span>https://github.com/boostorg/assign/pull/11</a> has been submitted. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Tue, 31 Jul 2018 15:13:33 GMT</pubDate> <title>owner, milestone changed https://svn.boost.org/trac10/ticket/10984#comment:3 https://svn.boost.org/trac10/ticket/10984#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Thorsten Ottosen</span> to <span class="trac-author">James E. King, III</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.69</span> </li> </ul> Ticket James E. King, III Tue, 31 Jul 2018 15:13:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10984#comment:4 https://svn.boost.org/trac10/ticket/10984#comment:4 <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