[Issue 2642] .init contains zeroes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 21 08:56:19 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2642
------- Comment #7 from jarrett.billingsley at gmail.com 2009-02-21 10:56 -------
(In reply to comment #6)
> One of the solutions is to introduce non-nullable types (both reference and
> value-types). In this case T.init would be useless (and thus may be safely
> removed from language*), because user will *have to* initialize it:
So, as much as I like nonnull types, and as much as I like your proposal,
there's this .. kind of icky part too.
auto a = new ClassType[10];
How exactly do you allocate an array of nonnull types?
> * I don't mind if T.init will be removed from language specs altogether as I
> never found it useful. It may still be left for some time in compiler internals
> (to copy T[] prior to calling T.__ctor), just don't expose it to users.
I've found it useful!
--
More information about the Digitalmars-d-bugs
mailing list