/runtime/typeinfo/ti_void.d
http://github.com/wilkie/djehuty · D · 42 lines · 27 code · 9 blank · 6 comment · 1 complexity · ad41a3d497c7d1c5e6bf41fa3931309a MD5 · raw file
- /*
- * ti_void.d
- *
- * This module implements the TypeInfo for the void type.
- *
- */
- module runtime.typeinfo.ti_void;
- class TypeInfo_v : TypeInfo {
- char[] toString() {
- return "void";
- }
- hash_t getHash(void *p) {
- assert(0);
- }
- int equals(void *p1, void *p2) {
- return *cast(byte *)p1 == *cast(byte *)p2;
- }
- int compare(void *p1, void *p2) {
- return *cast(byte *)p1 - *cast(byte *)p2;
- }
- size_t tsize() {
- return void.sizeof;
- }
- void swap(void *p1, void *p2) {
- byte t;
- t = *cast(byte *)p1;
- *cast(byte *)p1 = *cast(byte *)p2;
- *cast(byte *)p2 = t;
- }
- uint flags() {
- return 1;
- }
- }