toHash => pure, nothrow, const, @safe

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Mar 12 20:40:01 PDT 2012


On 3/12/12 8:15 PM, Stewart Gordon wrote:
> On 11/03/2012 23:54, Walter Bright wrote:
>> Consider the toHash() function for struct key types:
>>
>> http://dlang.org/hash-map.html
>>
>> And of course the others:
>>
>> const hash_t toHash();
>> const bool opEquals(ref const KeyType s);
>> const int opCmp(ref const KeyType s);
> <snip>
>
> And what about toString?

I think the three others have a special regime because pointers to them 
must be saved for the sake of associative arrays. toString is used only 
generically,

Andrei




More information about the Digitalmars-d mailing list