Boost C++ Libraries: Ticket #2121: unspecified_bool_type - based operator bool emulations result in meaningless comparison operators https://svn.boost.org/trac10/ticket/2121 <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/scoped_ptr.hpp&gt; int main() { typedef boost::scoped_ptr&lt;int&gt; ptr_t; ptr_t x(new int); ptr_t y(new int); std::cout &lt;&lt; (x != y) &lt;&lt; std::endl; std::cout &lt;&lt; (x == y) &lt;&lt; std::endl; return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2121 Trac 1.4.3 Marshall Clow Sat, 26 Jul 2008 03:44:18 GMT component changed; owner set https://svn.boost.org/trac10/ticket/2121#comment:1 https://svn.boost.org/trac10/ticket/2121#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> <p> Trying this on the 1.36 release branch using gcc 4.2 gives me compile errors: </p> <p> junk.cpp: In function ‘int main()’: /Users/marshall/Sources/boost/release/boost/scoped_ptr.hpp:51: error: ‘void boost::scoped_ptr&lt;T&gt;::operator!=(const boost::scoped_ptr&lt;T&gt;&amp;) const [with T = int]’ is private junk.cpp:11: error: within this context </p> Ticket Peter Dimov Sat, 26 Jul 2008 12:33:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2121#comment:2 https://svn.boost.org/trac10/ticket/2121#comment:2 <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> This is a duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1444" title="#1444: Bugs: scoped_ptr::operator== should be equivalent to a.get()==b.get(), but ... (closed: fixed)">#1444</a>, which has been fixed with <a class="changeset" href="https://svn.boost.org/trac10/changeset/43317" title="Fixes #1444.">[43317]</a>. </p> Ticket