toHash => pure, nothrow, const, @safe

deadalnix deadalnix at gmail.com
Mon Mar 12 06:16:56 PDT 2012


Le 12/03/2012 13:51, Alex Rønne Petersen a écrit :
> On 12-03-2012 10:40, Walter Bright wrote:
>> On 3/12/2012 1:08 AM, Martin Nowak wrote:
>>> What's wrong with auto-inference. Inferred attributes are only
>>> strengthening
>>> guarantees.
>>
>> Auto-inference is currently done for lambdas and template functions -
>> why? - because the function's implementation is guaranteed to be visible
>> to the compiler. For other functions, not so, and so the attributes must
>> be part of the function signature.
>
> Isn't auto-inference for templates a Bad Thing (TM) since it may give
> API guarantees that you can end up silently breaking?
>

As long as you can explicitly specify that too, and that you get a 
compile time error when you fail to provide what is explicitly stated, 
this isn't a problem.


More information about the Digitalmars-d mailing list