Debian Codegraph @

tests/rule-of-three/bug403193.cpp

raw
1 class APrivate
2 {
3 public:
4 int i = 3;
5 };
6
7 class A
8 {
9 public:
10 A() : d(new APrivate()) {}
11 A(const A &other) : d(new APrivate(*other.d)) {}
12 ~A() { delete d; }
13 private:
14 APrivate *const d;
15 };
16
17 void test()
18 {
19 A a;
20 A a2;
21 }