March 01, 2004
Strict Ownership in STL Containers
Listing 1: Shared ownership.
struct A;
struct B {
A* a;
B(A*); // TBD 1
~B(); // TBD 2
}
struct A {
B* b;
A(): b(new B) {}
~A() {delete b;}
};
|
|
||||||||||||||||||||||||||||
|
|
|
|