Are AAs broken? (Was: Why isn't bool allowed as AA key type?)

Timon Gehr timon.gehr at gmx.ch
Thu Jun 2 03:21:28 PDT 2011


Steven Schveighoffer wrote:
> There is always dcollections (has both Hash- and TreeSet).  It is boost
> 1.0, so feel free to steal anything to propose for std.container (in fact,
> RedBlackTree is from dcollections).  Note that I'm nowhere near an expert
> on hashing, so I'm not sure how it will perform against AAs.  I know it
> does beat them using my custom allocator, but that's not a truly fair
> comparison -- AA's could be written with a custom allocator too.
>
> -Steve

Well, how? Since an 'in' expression returns an internal pointer into the AA for
value types, they cannot do better than to rely on GC.
This rules out heavy AA use for real-time applications. I think AAs are broken.

Timon


More information about the Digitalmars-d mailing list