Debian Codegraph @

gcc/testsuite/gdc.test/compilable/enumbasearithmetic.d

raw
1 //https://issues.dlang.org/show_bug.cgi?id=20777
2 struct FooInt
3 {
4 int i;
5 auto opBinary(string op : "+")(int j)
6 {
7 return typeof(this)(i + j);
8 }
9
10 static @property FooInt max()
11 {
12 return typeof(this)(int.max);
13 }
14 }
15
16 enum foolist
17 {
18 hi = FooInt(0),
19 bye
20 }