On 5/7/12, H. S. Teoh <hst...@quickfur.ath.cx> wrote:
> you may be better off adapting D's AA implementation
> to have an AA that consists of just keys.

Yeah I do that in my code right now. It's pretty easy, just write an
some opApply/opBinary functions, add to!string(innerhash.keys) for
good measure and you're set (heh, set).

> Basically, you still have the
> hash table and buckets, just without the value field in each slot. (I
> wonder if it's possible for the new AA implementation to support this by
> specifying void as the value type.)

I think that can be done now with void[0], e.g.:

void[0][int] set;

I guess the way to add keys is to use a stub variable:
void[0][int] set;
void[0] val;
set[1] = val;

But I'm not sure how well serialization libraries can handle this
type, for my code I just use int[Key] in a wrapper struct.

Reply via email to