[article] Language Design Deal Breakers

Dmitry Olshansky dmitry.olsh at gmail.com
Wed May 29 06:15:43 PDT 2013


29-May-2013 16:18, Dicebot пишет:
> On Wednesday, 29 May 2013 at 09:28:38 UTC, Walter Bright wrote:
>> The whole point of a notnull is to disallow default initialization.
>
> Beg my pardon if that was already discussed by how does that interfere
> with various T.init use cases in current code? Most important, won't
> some existing template constraints wrongly fail for such types?

IMHO lvalueOf!T and rvalueOf!T are the only things a template 
constraints should care about. Both can be emulated with dummy functions 
that never get linked anyway. I think Denis proposed those long ago as a 
pull and we should have had them by now.

In fact most of Phobos they already use in place lambdas to get mock 
l-values of type T.

This begs the question of usefulness of T.init and should ALL types have 
it.

Since we have @disable this() I'd say T.init is no longer as useful and 
general at best it defines binary mask to blit over uninitialized 
variables. In essence it's T.uninitialized.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list