2 * Copyright (C) 2004-2006 by Digital Mars, www.digitalmars.com
3 * Written by Walter Bright
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, in both source and binary form, subject to the following
14 * o The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * o Altered source versions must be plainly marked as such, and must not
19 * be misrepresented as being the original software.
20 * o This notice may not be removed or altered from any source
24 module rt.typeinfo.ti_Areal;
26 private import typeinfo.ti_real;
30 class TypeInfo_Ae : TypeInfo
32 string toString() { return "real[]"; }
34 hash_t getHash(in void* p)
35 { real[] s = *cast(real[]*)p;
36 size_t len = s.length;
43 hash += (cast(uint *)str)[0];
44 hash += (cast(uint *)str)[1];
45 hash += (cast(ushort *)str)[4];
53 equals_t equals(in void* p1, in void* p2)
55 real[] s1 = *cast(real[]*)p1;
56 real[] s2 = *cast(real[]*)p2;
57 size_t len = s1.length;
61 for (size_t u = 0; u < len; u++)
63 int c = TypeInfo_e._equals(s1[u], s2[u]);
70 int compare(in void* p1, in void* p2)
72 real[] s1 = *cast(real[]*)p1;
73 real[] s2 = *cast(real[]*)p2;
74 size_t len = s1.length;
78 for (size_t u = 0; u < len; u++)
80 int c = TypeInfo_e._compare(s1[u], s2[u]);
84 if (s1.length < s2.length)
86 else if (s1.length > s2.length)
93 return (real[]).sizeof;
109 class TypeInfo_Aj : TypeInfo_Ae
111 string toString() { return "ireal[]"; }
115 return typeid(ireal);