Mercurial > projects > ddmd
comparison dmd/STC.d @ 139:bc45b1c53019
made StorageClass type-safe
author | Trass3r |
---|---|
date | Tue, 14 Sep 2010 01:13:58 +0200 |
parents | af1bebfd96a4 |
children | cd48cb899aee |
comparison
equal
deleted
inserted
replaced
138:90821c10b6a7 | 139:bc45b1c53019 |
---|---|
1 module dmd.STC; | 1 module dmd.STC; |
2 | 2 |
3 enum STC | 3 enum STC : ulong |
4 { | 4 { |
5 STCundefined = 0, | 5 STCundefined = 0, |
6 STCstatic = 1, | 6 STCstatic = 1, |
7 STCextern = 2, | 7 STCextern = 2, |
8 STCconst = 4, | 8 STCconst = 4, |
35 STCshared = 0x20000000, // accessible from multiple threads | 35 STCshared = 0x20000000, // accessible from multiple threads |
36 STCgshared = 0x40000000, // accessible from multiple threads | 36 STCgshared = 0x40000000, // accessible from multiple threads |
37 // but not typed as "shared" | 37 // but not typed as "shared" |
38 STCwild = 0x80000000, // for "wild" type constructor | 38 STCwild = 0x80000000, // for "wild" type constructor |
39 STC_TYPECTOR = (STCconst | STCimmutable | STCshared | STCwild), | 39 STC_TYPECTOR = (STCconst | STCimmutable | STCshared | STCwild), |
40 | |
41 // attributes | |
42 STCproperty = 0x100000000, | |
43 STCsafe = 0x200000000, | |
44 STCtrusted = 0x400000000, | |
45 STCsystem = 0x800000000, | |
46 STCctfe = 0x1000000000, // can be used in CTFE, even if it is static | |
40 } | 47 } |
48 alias STC StorageClass; | |
41 | 49 |
42 import dmd.EnumUtils; | 50 import dmd.EnumUtils; |
43 mixin(BringToCurrentScope!(STC)); | 51 mixin(BringToCurrentScope!(STC)); |
44 | |
45 enum STCproperty = 0x100000000; | |
46 enum STCsafe = 0x200000000; | |
47 enum STCtrusted = 0x400000000; | |
48 enum STCsystem = 0x800000000; | |
49 enum STCctfe = 0x1000000000; // can be used in CTFE, even if it is static | |
50 | |
51 alias ulong StorageClass; |