Mercurial > projects > ldc
comparison lphobos/typeinfo1/ti_wchar.d @ 58:2c3cd3596187 trunk
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
Added initial support for CatExp aka 'a ~ b'
Fixed global constant static arrays initialized with string literals
Fixed casting any dynamic array to void*
Fixed new expression with temporary storage
Fixed alias declarations in function scope
Fixed relational comparisons of pointers
author | lindquist |
---|---|
date | Thu, 25 Oct 2007 09:02:55 +0200 |
parents | lphobos/typeinfo/ti_wchar.d@06ccc817acd4 |
children |
comparison
equal
deleted
inserted
replaced
57:a9d29e9f1fed | 58:2c3cd3596187 |
---|---|
1 | |
2 module typeinfo1.ti_wchar; | |
3 | |
4 | |
5 class TypeInfo_u : TypeInfo | |
6 { | |
7 char[] toString() { return "wchar"; } | |
8 | |
9 hash_t getHash(void *p) | |
10 { | |
11 return *cast(wchar *)p; | |
12 } | |
13 | |
14 int equals(void *p1, void *p2) | |
15 { | |
16 return *cast(wchar *)p1 == *cast(wchar *)p2; | |
17 } | |
18 | |
19 int compare(void *p1, void *p2) | |
20 { | |
21 return *cast(wchar *)p1 - *cast(wchar *)p2; | |
22 } | |
23 | |
24 size_t tsize() | |
25 { | |
26 return wchar.sizeof; | |
27 } | |
28 | |
29 void swap(void *p1, void *p2) | |
30 { | |
31 wchar t; | |
32 | |
33 t = *cast(wchar *)p1; | |
34 *cast(wchar *)p1 = *cast(wchar *)p2; | |
35 *cast(wchar *)p2 = t; | |
36 } | |
37 | |
38 void[] init() | |
39 { static wchar c; | |
40 | |
41 return (cast(wchar *)&c)[0 .. 1]; | |
42 } | |
43 } | |
44 |