views:

394

answers:

1

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?

+1  A: 

Some update. After spending another 24 hours on this, I figured out that Borland C++ Builder 6 (very old one 2002) is more compatible with boost 1.39 than a brand new C++ Builder 2009.
But neither of them seem to like pointer containers.

Right now I regret that I did not start this project in MSVC but this is what I have.

So if anyone knows how to use pointer containers with C++ Builder, please, share this information. For me this question is still unresolved.

Switched back to std::list<boost::shared_pointer>

Andrew
some update. Newest version of boost in the SVN trunk seems to have a lot of fixes for Borland and gives to access to more components but still errors with pointer containers.
Andrew