Boost C++ Libraries: Ticket #5232: ptr_container compiler error with BOOST_RESULT_OF_DECLTYPE https://svn.boost.org/trac10/ticket/5232 <p> The following code: </p> <pre class="wiki">#include &lt;boost/ptr_container/ptr_set.hpp&gt; struct A { bool operator&lt;(const A&amp;) const; }; int main() { boost::ptr_set&lt;A&gt; s; return 0; } </pre><p> gives the following compiler errors when compiling with BOOST_RESULT_OF_USE_DECLTYPE defined: </p> <pre class="wiki">In file included from ../../lib/boost- trunk/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0, from ../../lib/boost-trunk/boost/utility/result_of.hpp:95, from ../../lib/boost-trunk/boost/ptr_container/indirect_fun.hpp:23, from ../../lib/boost-trunk/boost/ptr_container/ptr_set.hpp:19, from test.cpp:1: ../../lib/boost-trunk/boost/utility/detail/result_of_iterate.hpp: In instantiation of 'boost::detail::cpp0x_result_of_impl&lt;less&lt;A&gt;(A &amp;)&gt;': ../../lib/boost-trunk/boost/utility/detail/result_of_iterate.hpp:41:8: instantiated from 'boost::result_of&lt;less&lt;A&gt;(A &amp;)&gt;' ../../lib/boost-trunk/boost/ptr_container/indirect_fun.hpp:107:9: instantiated from 'boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt;' stl_tree.h:462:31: instantiated from '_Rb_tree&lt; void *, void *, _Identity&lt;void *&gt; , boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt;' stl_set.h:112:17: instantiated from 'set&lt; void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt;' ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:40:21: instantiated from 'boost::ptr_container_detail::set_config&lt; A, set&lt;void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt;, true &gt;' ../../lib/boost-trunk/boost/ptr_container/detail/reversible_ptr_container.hpp:110:59: instantiated from 'boost::ptr_container_detail::reversible_ptr_container&lt; boost::ptr_container_detail::set_config&lt; A, set&lt;void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt;, true &gt;, boost::heap_clone_allocator &gt;' ../../lib/boost-trunk/boost/ptr_container/detail/associative_ptr_container.hpp:32:11: instantiated from 'boost::ptr_container_detail::associative_ptr_container&lt; boost::ptr_container_detail::set_config&lt; A, set&lt;void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt;, true &gt;, boost::heap_clone_allocator &gt;' ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:122:11: instantiated from 'boost::ptr_container_detail::ptr_set_adapter_base&lt; A, set&lt;void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt; , boost::heap_clone_allocator, true &gt;' ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:299:11: instantiated from 'boost::ptr_set_adapter&lt; A, set&lt;void *, boost::void_ptr_indirect_fun&lt;less&lt;A&gt;, A, A&gt; &gt; , boost::heap_clone_allocator, true &gt;' ../../lib/boost-trunk/boost/ptr_container/ptr_set.hpp:33:11: instantiated from 'boost::ptr_set&lt;A&gt;' ../shared/test/test.cpp:10:23: instantiated from here ../../lib/boost-trunk/boost/utility/detail/result_of_iterate.hpp:64:5: error: no match for call to '(less&lt;A&gt;) (A &amp;)' stl_function.h:230:12: candidate is: stl_function.h:233:7: bool less&lt;A&gt;::operator()(const A &amp;, const A &amp;) const stl_function.h:233:7: candidate expects 2 arguments, 1 provided </pre><p> I am compiling with g++ 4.5 with the --std=c++0x flag. The error goes away if I do not define BOOST_RESULT_OF_USE_DECLTYPE. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5232 Trac 1.4.3 anonymous Mon, 28 Feb 2011 20:27:49 GMT <link>https://svn.boost.org/trac10/ticket/5232#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5232#comment:1</guid> <description> <p> I don't have access to a compiler with this feature yet. It would greatly help me if you could submit a patch. </p> <p> kind regards </p> <p> Thorsten </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thorsten Ottosen</dc:creator> <pubDate>Thu, 31 Mar 2011 20:30:18 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5232#comment:2 https://svn.boost.org/trac10/ticket/5232#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> Ticket