Boost C++ Libraries: Ticket #8679: Boost.Test pollutes boost namespace with it's own enable_if/disable_if templates https://svn.boost.org/trac10/ticket/8679 <p> The following test program: </p> <pre class="wiki">#define BOOST_TEST_MODULE my_test #include &lt;boost/multiprecision/cpp_dec_float.hpp&gt; #define BOOST_TEST_MAIN #include &lt;boost/test/included/unit_test.hpp&gt; // Note: header-only Boost.Test #include &lt;boost/test/floating_point_comparison.hpp&gt; BOOST_AUTO_TEST_CASE(my_test) { typedef boost::multiprecision::number&lt;boost::multiprecision::cpp_dec_float&lt;50&gt;, boost::multiprecision::et_off&gt; mp_type; const mp_type test_value = mp_type(12) / 7; } </pre><p> Fails to compile due to ambiguities between boost::enable_if and boost::unit_test::decorator::disable_if: </p> <pre class="wiki">1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(118): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt; d:\data\boost\trunk\boost\type_traits\is_convertible.hpp(484) : see reference to class template instantiation 'boost::multiprecision::number&lt;Backend&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Backend=boost::multiprecision::backends::cpp_dec_float&lt;50&gt; 1&gt; ] 1&gt; d:\data\boost\trunk\boost\multiprecision\detail\no_et_ops.hpp(455) : see reference to class template instantiation 'boost::is_convertible&lt;From,To&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; From=__int64, 1&gt; To=boost::multiprecision::number&lt;boost::multiprecision::backends::cpp_dec_float&lt;50&gt;&gt; 1&gt; ] 1&gt; d:\data\boost\trunk\ide\math\scrap\scrap.cpp(38) : see reference to function template instantiation 'boost::multiprecision::number&lt;Backend,ExpressionTemplates&gt; boost::multiprecision::operator /&lt;boost::multiprecision::backends::cpp_dec_float&lt;Digits10&gt;,int&gt;(boost::multiprecision::number&lt;Backend,ExpressionTemplates&gt; &amp;&amp;,const V &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Backend=boost::multiprecision::backends::cpp_dec_float&lt;50&gt;, 1&gt; ExpressionTemplates=et_off, 1&gt; Digits10=50, 1&gt; V=int 1&gt; ] 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(118): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(118): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(118): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(124): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(124): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(124): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(124): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(131): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(131): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(153): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(153): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(168): error C2872: 'disable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(59) : boost::disable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(197) : boost::unit_test::decorator::disable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(168): error C2872: 'disable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(59) : boost::disable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(197) : boost::unit_test::decorator::disable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(237): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(237): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(268): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(268): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(312): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(312): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(343): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(343): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(391): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(391): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(400): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(400): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(431): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(431): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(465): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(465): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(500): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(500): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(533): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(533): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(661): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(661): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(1637): error C2872: 'disable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(59) : boost::disable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(197) : boost::unit_test::decorator::disable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(1637): error C2872: 'disable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(59) : boost::disable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(197) : boost::unit_test::decorator::disable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(1640): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' 1&gt;d:\data\boost\trunk\boost\multiprecision\number.hpp(1640): error C2872: 'enable_if' : ambiguous symbol 1&gt; could be 'd:\data\boost\trunk\boost\utility\enable_if.hpp(36) : boost::enable_if' 1&gt; or 'd:\data\boost\trunk\boost\test\tree\decorator.hpp(184) : boost::unit_test::decorator::enable_if' </pre><p> IMO Boost.Test should not pollute namespace boost with types of the same name as other types already there. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8679 Trac 1.4.3 Gennadiy Rozental Wed, 12 Jun 2013 06:57:16 GMT <link>https://svn.boost.org/trac10/ticket/8679#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8679#comment:1</guid> <description> <p> Your example letter for letter builds fine with gcc 4.7.2 and VS 10 on my windows box </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 07 Jul 2015 09:14:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8679#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8679#comment:2</guid> <description> <p> I believe this is fixed now in master. Can anyone confirm? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gennadiy Rozental</dc:creator> <pubDate>Tue, 07 Jul 2015 15:40:21 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8679#comment:3 https://svn.boost.org/trac10/ticket/8679#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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> <p> I believe this is resolved in 1.59 </p> Ticket