Sets

Derek Parnell derek at psych.ward
Mon Feb 5 11:08:34 PST 2007


On Mon, 5 Feb 2007 17:44:10 +0000 (UTC), Michiel wrote:

> Is there a built-in way to create a set in D? Like an associative array, only
> without the value?
> 
> I tried: void[KeyType] setName;
> 
> It compiled. But there doesn't seem to be a way to add an item to the set.
> 
> Am I missing something? Or is it just a bug that this even compiled?
> 
> I know I could just use a dummy value, but that's just not very elegant.
> 
> Thanks!

I just use: bool[Keytype] setName;



More information about the Digitalmars-d mailing list