Debian Codegraph @

yo/stl/examples/sharedarray.cc

raw
1 #include <memory>
2 #include <iostream>
3
4 using namespace std;
5
6 //code
7 struct Type
8 {
9 ~Type()
10 {
11 cout << "destr\n"; // show the object's destruction
12 }
13 };
14
15 int main()
16 {
17 shared_ptr<Type[]> sp{ new Type[3] };
18 sp[0] = sp[1];
19 }
20 //=