shared_ptr capabilities
http://www.boost.org/libs/smart_ptr/shared_ptr.htm states that: "Normally, a shared_ptr cannot correctly hold a pointer to a dynamically allocated array. See shared_array for that usage." What I hope to use shared_ptr for, is to store pointers to a class in a vector, and that class will also have a vector that stores pointers via shared_ptr. example: class Foo { int a; } class one { int var1; int var2; std::vector<Foo> foo_vector; } class two { std::vector<one> one_vector; } I don't believe the above statement will affect me, but I just want to be sure Collin Peters
There is no boost::shared_ptr<> in your example.
"Collin Peters"
http://www.boost.org/libs/smart_ptr/shared_ptr.htm states that: "Normally, a shared_ptr cannot correctly hold a pointer to a dynamically allocated array. See shared_array for that usage."
What I hope to use shared_ptr for, is to store pointers to a class in a vector, and that class will also have a vector that stores pointers via shared_ptr.
example:
class Foo { int a; }
class one { int var1; int var2; std::vector<Foo> foo_vector; }
class two { std::vector<one> one_vector; }
On Wednesday, November 6, 2002, at 01:03 PM, Collin Peters wrote:
http://www.boost.org/libs/smart_ptr/shared_ptr.htm states that: "Normally, a shared_ptr cannot correctly hold a pointer to a dynamically allocated array. See shared_array for that usage."
What I hope to use shared_ptr for, is to store pointers to a class in a vector, and that class will also have a vector that stores pointers via shared_ptr.
That's fine. A vector is not an array. -- Darin
participants (3)
-
Collin Peters
-
Darin Adler
-
Edward Diener