template matching for associative arrays

PNoel span at please.no
Fri Mar 30 22:01:23 PDT 2007


Hi,

for arrays there is this way to match arrays in template arguments:
class SomeClass(T : T[])
{
}
But how can you achieve this for AA?
class SomeClass(K[V])
{
}
.. doesn't work. But this does:
class SomeClass(K, V, M : K[V])
{
}
.. but this way you have to know the key and value type in advance
which doesn't help to make the code "better".

Is there a library function to accomplish this or at least a map type decomposition to key/value types?

Thanks in advance.


More information about the Digitalmars-d-dtl mailing list