Debian Codegraph @

libphobos/testsuite/libphobos.typeinfo/enum_.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=21441
2
3 int dtorCount;
4 int postblitCount;
5
6 struct S
7 {
8 this(this) { ++postblitCount; }
9 ~this() { ++dtorCount; }
10 }
11
12 enum E : S { _ = S.init }
13
14 void main()
15 {
16 E e;
17 typeid(e).destroy(&e);
18 assert(dtorCount == 1);
19 typeid(e).postblit(&e);
20 assert(postblitCount == 1);
21 }