pointer-container

Pointer to an element in boost pointer container

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 addres...

C++: Problem with ptr_multimap::insert

Please consider the following code: #include "boost/ptr_container/ptr_map.hpp" int main() { typedef boost::ptr_multimap<char, const int> M; M m; char c = 'c'; int* j = new int(7); m.insert(c, j); return 0; } The gcc 4.3.3 compiler fails to compiler the above code. Am I doing something w...

boost pointer container insert (ptr_list)

Hello everyone. For some reason, I cannot get ptr_list to insert elements. boost::ptr_list<int> somelist; int *someint = new int(123); int *someint2 = new int(456); somelist.push_back(someint); boost:: ptr_list<int>::iterator i = somelist.begin(); somelist.insert(i,someint2); Any help, please? ...