Mercurial > projects > ldc
view test/aa4.d @ 291:068cb3c60afb trunk
[svn r312] Changed assert codegen to insert an unreachable terminator after the call to the assert function, which currently calls abort().
Changed array comparison runtime support to pass the array typeinfo instead of the element typeinfo. This allows a cleaner and faster implementation.
author | lindquist |
---|---|
date | Sat, 21 Jun 2008 21:16:26 +0200 |
parents | 5ab8e92611f9 |
children |
line wrap: on
line source
module aa4; void main() { int[int] aa; aa = addkey(aa,42,12); int* p = haskey(aa,42); assert(p && *p == 12); } int[int] addkey(int[int] aa, int key, int val) { aa[key] = val; return aa; } int* haskey(int[int] aa, int key) { return key in aa; }