I am just starting to use boost::ptr_vector
. I have a ptr_vector pctr
as a member of one class A and want another class B to refer to an element in pctr
. While constructing an object of class B I want to store a pointer in pctr
.
Since pointer containers do not allow access to the pointer (but only to references), I must take the address of the reference from pctr
and then store it in the object of type B. But taking the address of a reference seems unintuitive. Is there an better alternative?