[ptr_container] "Cannot access private member..." compile error

Seeking ptr_container guru, My first usage of ptr_container, and I fear I'm missing something obvious. I keep getting the following compile error: -------------------------------------------- Z:\Tools\boost\boost_1_34_0\boost/ptr_container/detail/associative_ptr_container.hpp(202) : error C2248: 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::reversible_ptr_container' : cannot access private member declared in class 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>' with [ Config=boost::ptr_container_detail::set_config<Abstract_Record,std::set<void *,boost::void_ptr_indirect_fun<std::less<Abstract_Record>,Abstract_Record>,std::allocator<void *>>>, CloneAllocator=boost::heap_clone_allocator ] Z:\Tools\boost\boost_1_34_0\boost/ptr_container/detail/reversible_ptr_container.hpp(286) : see declaration of 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::reversible_ptr_container' with [ Config=boost::ptr_container_detail::set_config<Abstract_Record,std::set<void *,boost::void_ptr_indirect_fun<std::less<Abstract_Record>,Abstract_Record>,std::allocator<void *>>>, CloneAllocator=boost::heap_clone_allocator ] This diagnostic occurred in the compiler generated function 'boost::ptr_container_detail::associative_ptr_container<Config,CloneAllocator>::associative_ptr_container(const boost::ptr_container_detail::associative_ptr_container<Config,CloneAllocator> &)' with [ Config=boost::ptr_container_detail::set_config<Abstract_Record,std::set<void *,boost::void_ptr_indirect_fun<std::less<Abstract_Record>,Abstract_Record>,std::allocator<void *>>>, CloneAllocator=boost::heap_clone_allocator ] -------------------------------------------- My container is declared thusly: boost::ptr_set<Abstract_Record> And the relevant parts of -------------------------------------------- class Abstract_Record { public: Abstract_Record(); Abstract_Record* clone(); virtual bool operator<(const Abstract_Record&); private: Abstract_Record(const Abstract_Record&); }; -------------------------------------------- I'm having trouble deciphering the error message. I declared a new_clone() function as described in the docs. I also tried writing my own CloneAllocator. Neither have any effect. I would be very grateful for some insight, or even a nudge with a cluebat. -Dan

Sorry, I forgot to add I'm using the prebuilt 1.34 libraries provided by Boost Consulting.

Nevermind. I finally figured out the error message to mean that the compiler-generated copy-constructor was being called somewhere. I determined that elsewhere, I was storing my set_ptr in an STL container--which, of course, is verboten.

Dan Thill skrev:
Nevermind. I finally figured out the error message to mean that the compiler-generated copy-constructor was being called somewhere. I determined that elsewhere, I was storing my set_ptr in an STL container--which, of course, is verboten.
That change in a newer version, FWIW. -Thorsten
participants (2)
-
Dan Thill
-
Thorsten Ottosen