Andrej Mitrovic wrote:
1. I'm wasting memory. I don't need the values, I only need the keys. But I 
can't declare a void[string] hash.
But I don't know how to get rid of the values, which leaves the issue #1.

Maybe static array of zero length? From documentation:

"A static array with a dimension of 0 is allowed, but no space is allocated for it. It's useful as the last member of a variable length struct, or as the degenerate case of a template expansion."

And this code works:

void[0][string] aa;
aa["key"] = [];
assert("key" in aa);

But anyway, I feel that dedicated HashSet container would be more appropriate.

Reply via email to