Boost C++ Libraries: Ticket #3948: Conflict between concept_check and shared_ptr https://svn.boost.org/trac10/ticket/3948 <p> Hello, </p> <p> The following code compiled with MSVC 2005 or 2008 : </p> <pre class="wiki">#include &lt;boost/concept_check.hpp&gt; namespace boost { template&lt; typename T &gt; class some_type {}; template&lt; typename T1, typename T2 &gt; bool operator&lt;( const some_type&lt; T1 &gt;&amp;, const some_type&lt; T2 &gt;&amp; ); } class c {}; BOOST_CONCEPT_ASSERT((boost::LessThanComparable&lt; c &gt;)); </pre><p> Produces the following error : </p> <pre class="wiki">1&gt;C:\Users\Mat\Desktop\dev\include\boost/concept_check.hpp(242) : error C2784: 'bool boost::operator &lt;(const boost::some_type&lt;T&gt; &amp;,const boost::some_type&lt;T2&gt; &amp;)' : could not deduce template argument for 'const boost::some_type&lt;T&gt; &amp;' from 'c' 1&gt; ..\..\src\tests\turtle_test\concept_check_test.cpp(19) : see declaration of 'boost::operator &lt;' 1&gt; C:\Users\Mat\Desktop\dev\include\boost/concept_check.hpp(241) : while compiling class template member function 'boost::LessThanComparable&lt;TT&gt;::~LessThanComparable(void)' ... </pre><p> Changing the namespace from boost to anything else (for instance nm) produces the correct error output e.g. : </p> <pre class="wiki">1&gt;C:\Users\Mat\Desktop\dev\include\boost/concept_check.hpp(242) : error C2676: binary '&lt;' : 'c' does not define this operator or a conversion to a type acceptable to the predefined operator 1&gt; C:\Users\Mat\Desktop\dev\include\boost/concept_check.hpp(241) : while compiling class template member function 'boost::LessThanComparable&lt;TT&gt;::~LessThanComparable(void)' ... </pre><p> This use case is actually quite common because for instance in boost::shared_ptr there is such a construct, in the boost namespace of course. Therefore the following code exhibits the same problem : </p> <pre class="wiki">#include &lt;boost/concept_check.hpp&gt; #include &lt;boost/shared_ptr.hpp&gt; class c {}; BOOST_CONCEPT_ASSERT((boost::LessThanComparable&lt; c &gt;)); </pre><p> Maybe enclosing the concept check code into another level of namespace would prove enough to protect from the lookup ? </p> <p> Thank you ! </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3948 Trac 1.4.3