
Hello I'm trying to use ptr_vector but I'm having headaches because I have no idea why I'm getting this error: error C2248: 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::operator =' : cannot access private member declared in class 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>' with [ Config=boost::ptr_container_detail::sequence_config<boost::asio::dns::base_nameserver_resource,std::vector<void *,std::allocator<void *>>>, CloneAllocator=boost::heap_clone_allocator ] C:\Program Files\boost\boost_1_34_0\boost/ptr_container/detail/reversible_ptr_container.hpp(287) : see declaration of 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::operator =' with [ Config=boost::ptr_container_detail::sequence_config<boost::asio::dns::base_nameserver_resource,std::vector<void *,std::allocator<void *>>>, CloneAllocator=boost::heap_clone_allocator ] This diagnostic occurred in the compiler generated function 'boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator> &boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>::operator =(const boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator> &)' with [ T=boost::asio::dns::base_nameserver_resource, VoidPtrSeq=std::vector<void *,std::allocator<void *>>, CloneAllocator=boost::heap_clone_allocator ] My code (simplified): class base1 { public: void somefunc() { }; }; class main : public base1 { public: virtual void somefunc() { } }; class derived : public main { public: virtual void somefunc() { } }; boost::ptr_vector<main> m_vector; Any Idea what am I doing wrong? I tried to add do_clone functions/members without success. Any help is highly appreciated Regards A

Aljaz skrev:
Hello
I'm trying to use ptr_vector but I'm having headaches because I have no idea why I'm getting this error:
error C2248: 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::operator =' : cannot access private member declared in class
[snip]
boost::ptr_vector<main> m_vector;
Is this the only code? Note you can't currently copy/copy-assign a ptr_container. -Thorsten
participants (2)
-
Aljaz
-
Thorsten Ottosen