[Boost-bugs] [Boost C++ Libraries] #5232: ptr_container compiler error with BOOST_RESULT_OF_DECLTYPE

Subject: [Boost-bugs] [Boost C++ Libraries] #5232: ptr_container compiler error with BOOST_RESULT_OF_DECLTYPE
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-25 22:27:03


#5232: ptr_container compiler error with BOOST_RESULT_OF_DECLTYPE
---------------------------------------------------+------------------------
 Reporter: Nathan Ridge <zeratul976@…> | Owner: nesotto
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: ptr_container
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 The following code:

 {{{
 #include <boost/ptr_container/ptr_set.hpp>
 struct A
 {
     bool operator<(const A&) const;
 };
 int main()
 {
     boost::ptr_set<A> s;
     return 0;
 }
 }}}

 gives the following compiler errors when compiling with
 BOOST_RESULT_OF_USE_DECLTYPE defined:

 {{{
 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<less<A>(A &)>':
 ../../lib/boost-trunk/boost/utility/detail/result_of_iterate.hpp:41:8:
     instantiated from 'boost::result_of<less<A>(A &)>'
 ../../lib/boost-trunk/boost/ptr_container/indirect_fun.hpp:107:9:
     instantiated from 'boost::void_ptr_indirect_fun<less<A>, A, A>'
 stl_tree.h:462:31: instantiated from '_Rb_tree<
         void *, void *, _Identity<void *>
       , boost::void_ptr_indirect_fun<less<A>, A, A>
>'
 stl_set.h:112:17: instantiated from 'set<
         void *, boost::void_ptr_indirect_fun<less<A>, A, A>
>'
 ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:40:21:
     instantiated from 'boost::ptr_container_detail::set_config<
         A, set<void *, boost::void_ptr_indirect_fun<less<A>, A, A> >, true
>'
 ../../lib/boost-
 trunk/boost/ptr_container/detail/reversible_ptr_container.hpp:110:59:
     instantiated from
 'boost::ptr_container_detail::reversible_ptr_container<
         boost::ptr_container_detail::set_config<
             A, set<void *, boost::void_ptr_indirect_fun<less<A>, A, A> >,
 true
>, boost::heap_clone_allocator
>'
 ../../lib/boost-
 trunk/boost/ptr_container/detail/associative_ptr_container.hpp:32:11:
     instantiated from
 'boost::ptr_container_detail::associative_ptr_container<
         boost::ptr_container_detail::set_config<
             A, set<void *, boost::void_ptr_indirect_fun<less<A>, A, A> >,
 true
>, boost::heap_clone_allocator
>'
 ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:122:11:
     instantiated from 'boost::ptr_container_detail::ptr_set_adapter_base<
         A, set<void *, boost::void_ptr_indirect_fun<less<A>, A, A> >
       , boost::heap_clone_allocator, true
>'
 ../../lib/boost-trunk/boost/ptr_container/ptr_set_adapter.hpp:299:11:
     instantiated from 'boost::ptr_set_adapter<
         A, set<void *, boost::void_ptr_indirect_fun<less<A>, A, A> >
       , boost::heap_clone_allocator, true
>'
 ../../lib/boost-trunk/boost/ptr_container/ptr_set.hpp:33:11:
 instantiated
     from 'boost::ptr_set<A>'
 ../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<A>) (A &)'
 stl_function.h:230:12: candidate is:
 stl_function.h:233:7: bool less<A>::operator()(const A &, const A &) const
 stl_function.h:233:7: candidate expects 2 arguments, 1 provided
 }}}

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5232>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC