ptr_vector

It seems I have a use for ptr_vectors. I've followed the documentation here - http://www.codeproject.com/KB/stl/ptr_vecto.aspx .

When I include ptr_vector.h my IDE doesn't recognize it - although the compiler doesn't seem to complain about it (from what I can tell anyway).

Code Part 1
1
2
3
30:  #include "ptr_vector.h"

83:  boost::ptr_vector<MyClass::pointer> MyClassContainer;


Code Part 2
1
2
3
4
5
6
7
8
9
Class MyClass
{
...


    typedef MyClass* pointer;

...
}


Compile Error
1
2
3
83: error: ISO C++ forbids declaration of 'ptr_vector' with no type
83: error: invalid use of '::'
83: error: expected ';' before '<' token


Any ideas what I need to do?

Edit: URL link corrected.
Last edited on
Looks to me like line 83 should be:
 
stdx::ptr_vector<MyClass::pointer> MyClassContainer;

You have it in the boost namespace.
Also, it should probably be -> stdx::ptr_vector<MyClass> MyClassContainer;
Ok, yes. For some reason I was thinking it was the Boost namespace since it dealt with Boost libraries/headers. Thanks for that catch.
yes, ptr_vector<> came from the boost.ptr_container library.
Topic archived. No new replies allowed.