3 ms·
Have a look at the sourcecode [1]. It is just implemented with an associative array (implemented as hash table) from argument tuples to the return type. This me
by v0i0-0 12y ago
Have a look at the sourcecode [1].
It is just implemented with an associative array (implemented as hash table) from argument tuples to the return type.
This means that keys have to be atomic or provide their to_hash and equality check themselves.
Check out the D template system, it is quite impressive what you can express with it.
1: https://github.com/D-Programming-Language/phobos/blob/master/std/functional.d#L756 https://github.com/D-Programming-Language/phobos/blob/master...