[Issue 9771] Remove toHash from Object

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 3 08:15:23 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9771


Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu


--- Comment #14 from Martin Nowak <code at dawg.eu> 2013-06-03 08:15:21 PDT ---
(In reply to comment #2)
> This probably can't be implemented until we replace AA's with a library
> template, since otherwise it would make it impossible for e.g. classes to be
> used as AA keys.

That very simple to solve, let the compiler pass two functions (hash, equals)
to the AA implementation instead of RTTI.

> Once we have the library type, though, we can probably make use of UFCS to
> provide default implementations of toHash for all types.

I would not want to bet that this will happen.
The current situation where the AA is partly implemented in the compiler and in
the runtime is unfortunate to say the least.
Also performance-wise a generic AA implementation will never be on par with one
that's suited for a special purpose. So it makes a lot of sense to have a lean
builtin implementation and provide more configurable ones in std.container.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list