]> git.ipfire.org Git - thirdparty/gcc.git/blob - libphobos/libdruntime/rt/typeinfo/ti_Adouble.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / libphobos / libdruntime / rt / typeinfo / ti_Adouble.d
1 /**
2 * TypeInfo support code.
3 *
4 * Copyright: Copyright Digital Mars 2004 - 2009.
5 * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 * Authors: Walter Bright
7 */
8
9 /* Copyright Digital Mars 2004 - 2009.
10 * Distributed under the Boost Software License, Version 1.0.
11 * (See accompanying file LICENSE or copy at
12 * http://www.boost.org/LICENSE_1_0.txt)
13 */
14 module rt.typeinfo.ti_Adouble;
15
16 private import rt.util.typeinfo;
17
18 // double[]
19
20 class TypeInfo_Ad : TypeInfo_Array
21 {
22 alias F = double;
23
24 override bool opEquals(Object o) { return TypeInfo.opEquals(o); }
25
26 override string toString() const { return (F[]).stringof; }
27
28 override size_t getHash(in void* p) @trusted const
29 {
30 return Array!F.hashOf(*cast(F[]*)p);
31 }
32
33 override bool equals(in void* p1, in void* p2) const
34 {
35 return Array!F.equals(*cast(F[]*)p1, *cast(F[]*)p2);
36 }
37
38 override int compare(in void* p1, in void* p2) const
39 {
40 return Array!F.compare(*cast(F[]*)p1, *cast(F[]*)p2);
41 }
42
43 override @property inout(TypeInfo) next() inout
44 {
45 return cast(inout)typeid(F);
46 }
47 }
48
49 // idouble[]
50
51 class TypeInfo_Ap : TypeInfo_Ad
52 {
53 alias F = idouble;
54
55 override string toString() const { return (F[]).stringof; }
56
57 override @property inout(TypeInfo) next() inout
58 {
59 return cast(inout)typeid(F);
60 }
61 }