Congratulations to the D Team!

Timon Gehr timon.gehr at gmx.ch
Tue Jul 10 19:42:13 PDT 2012


On 07/11/2012 04:30 AM, Walter Bright wrote:
> On 7/10/2012 6:07 PM, Timon Gehr wrote:
>> (conceptually, the structures are immutable and infinite.)
>
>
> What a minute - how are you doing toHash for an infinite structure?
>
> The only way you could is by doing toHash on the initial condition for
> it. And that could be made const.
>
> Same for opEquals.

I am not. The structure is used to obtain unique representations for
values. Other parts of the code query the structure for the
representations of values. That query cannot be const because the
structure has to remember the representation it gives out if it has
never been requested before. Values can be compared for equality by
simple reference comparison that way, which speeds up the code
tremendously.


More information about the Digitalmars-d mailing list