comparison tests/mini/const1.d @ 619:722630261d62

Implemented constant pointer casts (like casting function pointer to void* as a constant global initializer)
author tomas@myhost
date Sun, 28 Sep 2008 21:09:21 +0200
parents
children
comparison
equal deleted inserted replaced
618:c9aa338280ed 619:722630261d62
1 module mini.const1;
2
3 void* g = cast(void*)&foobar;
4
5 int foobar()
6 {
7 return 42;
8 }
9
10 void main()
11 {
12 auto fn = cast(int function())g;
13 int i = fn();
14 assert(i == 42);
15 }