Mercurial > projects > qtd
comparison qt/core/QTypeInfo.d @ 295:463563fc9e17 signals
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
author | eldar |
---|---|
date | Sun, 22 Nov 2009 11:01:19 +0000 |
parents | bb37b0ed94c9 |
children | 5173835bb372 |
comparison
equal
deleted
inserted
replaced
294:bb37b0ed94c9 | 295:463563fc9e17 |
---|---|
10 | 10 |
11 import qt.qtd.MetaMarshall; | 11 import qt.qtd.MetaMarshall; |
12 | 12 |
13 bool qIsDetached(T)(ref T) { return true; } | 13 bool qIsDetached(T)(ref T) { return true; } |
14 | 14 |
15 template QTypeInfo(T) | 15 template isBasicType(T) |
16 { | 16 { |
17 public: | 17 enum isBasicType = isNumeric!T || is(T == bool); |
18 enum { | |
19 isPointer = isPointer!T, | |
20 isComplex = !isPointer, | |
21 isStatic = !isPointer, | |
22 isLarge = (T.sizeof > (void*).sizeof), | |
23 isDummy = false | |
24 } | |
25 } | 18 } |
26 | 19 |
27 template QTypeInfo(T) | 20 template QTypeInfo(T) |
28 if ( isQObjectType!T || isObjectType!T ) | |
29 { | 21 { |
30 public: | 22 static if(isBasicType!T) |
31 enum { | 23 { |
32 isPointer = true, | 24 public enum |
33 isComplex = false, | 25 { |
34 isStatic = false, | 26 isPointer = false, |
35 isLarge = false, | 27 isComplex = false, |
36 isDummy = false | 28 isStatic = false, |
29 isLarge = (T.sizeof > (void*).sizeof), | |
30 isDummy = false | |
31 } | |
32 } | |
33 else static if(__traits(compiles, mixin("T.TypeInfo"))) | |
34 { | |
35 alias T.QTypeInfo QTypeInfo; // alias member QTypeInfo | |
36 } | |
37 else static if ( isQObjectType!T || isObjectType!T ) | |
38 { | |
39 public enum // are pointers | |
40 { | |
41 isPointer = true, | |
42 isComplex = false, | |
43 isStatic = false, | |
44 isLarge = false, | |
45 isDummy = false | |
46 } | |
47 } | |
48 else // default parameters | |
49 { | |
50 public enum | |
51 { | |
52 isPointer = isPointer!T, | |
53 isComplex = !isPointer, | |
54 isStatic = !isPointer, | |
55 isLarge = (T.sizeof > (void*).sizeof), | |
56 isDummy = false | |
57 } | |
37 } | 58 } |
38 } | 59 } |
39 | 60 |
40 | 61 |
41 /* | 62 /* |