Hi all,
I've just started looking at ptr_vector<> and got stuck on the
following issue:
putting a boost::ptr_vector<Simple> into a map doesn't
compile. See the following test case:
class Simple
{
public:
virtual ~Simple()
{
}
void foo()
{
doFoo();
}
protected:
virtual void doFoo()
{
}
};
void Test()
{
std::map map;
map["key"].push_back(new Simple);
}
I'm using VS2005 RC1 (8.0.50727.26) and the compiler output is as
follows:
1>c:\work\3rd-party\boost\include\boost-1_33\boost/ptr_container/ptr_sequence_adapter.hpp(595) : error C2248: 'boost::ptr_container_detail::reversible_ptr_container::reversible_ptr_container' : cannot access private member declared in class 'boost::ptr_container_detail::reversible_ptr_container'
1> with
1> [
1> Config=boost::ptr_container_detail::sequence_config>>,
1> CloneAllocator=boost::heap_clone_allocator
1> ]
1> c:\work\3rd-party\boost\include\boost-1_33\boost/ptr_container/detail/reversible_ptr_container.hpp(294) : see declaration of 'boost::ptr_container_detail::reversible_ptr_container::reversible_ptr_container'
1> with
1> [
1> Config=boost::ptr_container_detail::sequence_config>>,
1> CloneAllocator=boost::heap_clone_allocator
1> ]
1> This diagnostic occurred in the compiler generated function 'boost::ptr_sequence_adapter::ptr_sequence_adapter(const boost::ptr_sequence_adapter &)'
1> with
1> [
1> T=Simple,
1> VoidPtrSeq=std::vector>,
1> CloneAllocator=boost::heap_clone_allocator
1> ]
Can anybody shed some light on the subject?
Thanks,
Oleg.