Public outcry against new .init behaviour
Sean Kelly
sean at f4.ca
Mon Jul 2 22:52:45 PDT 2007
Deewiant wrote:
> Sean Kelly wrote:
>> I generally use .init in a context where the change doesn't matter, so...
>
> I'd find such code easier to read if you used typeof(foo).init, it's clearer if
> that's what you really mean. I've come across this in Tango once or twice: I was
> really bewildered to find out that "foo.nan" is equivalent to typeof(foo).nan, I
> was wondering if it had something to do with NaN payloads.
Yeah, it's worth considering. I tend to avoid comparing to T.init
because then it's sensitive to type changes. typeof(t).init is just
kind of verbose, but I agree that it's more clear.
Sean
More information about the Digitalmars-d
mailing list