2 * TypeInfo support code.
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
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)
14 module rt.typeinfo.ti_delegate;
16 private import rt.util.hash;
20 alias void delegate(int) dg;
22 class TypeInfo_D : TypeInfo
29 override size_t getHash(in void* p)
31 return rt.util.hash.hashOf(p[0 .. dg.sizeof], 0);
34 override bool equals(in void* p1, in void* p2)
36 return *cast(dg *)p1 == *cast(dg *)p2;
39 override @property size_t tsize() nothrow pure
44 override void swap(void *p1, void *p2)
49 *cast(dg *)p1 = *cast(dg *)p2;
53 override const(void)[] initializer() const @trusted
55 static immutable dg d;
57 return (cast(void *)null)[0 .. dg.sizeof];
60 override @property uint flags() nothrow pure