Congratulations to the D Team!

Timon Gehr timon.gehr at gmx.ch
Wed Jul 11 10:04:10 PDT 2012


On 07/11/2012 06:45 PM, Andrei Alexandrescu wrote:
> On 7/11/12 12:30 PM, H. S. Teoh wrote:
>> It *is* a problem when you're talking about abstractions. If I have
>> million node binary trees and I'm testing for equality, I'd like to be
>> able to cache the results. But being forced to use const means I can't
>> cache anything. And this isn't just about caching; if my tree is
>> partially stored in the database, and I have a DB connection object in
>> my tree class, then I can't use opEquals because I can't modify the DB
>> state (which is impractical if I have to actually use it to make DB
>> queries -- the DB engine may have to cache DB pages, etc.). Any
>> abstraction of opEquals beyond the bitwise level cannot be implemented.
>
> How about the static hash/cache?
>
> Andrei

Will break horribly as soon as it is discovered that the methods should 
be pure as well.


More information about the Digitalmars-d mailing list