On Sun, 24 Jan 2010 15:12:47 +0100, grauzone <[email protected]> wrote:
Eldar Insafutdinov wrote:grauzone Wrote:It's ugly, doesn't work sometimes and is inconsistent with other constructors.Eldar Insafutdinov wrote:Andrei Alexandrescu Wrote:Eldar Insafutdinov wrote:Walter doesn't want. This will go down as one of the larger language incapabilities.Jesse Phillips Wrote:Jason House wrote:Andrei's finishing his last TDPL chapter, Sean is updating std.thread(?), and Walter's been fixing forward reference and CTFE bugs. What's left?This page[1] has been getting regular updates, so it should do a goodjob answering the question.1. http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel#FutureDirectionsFrom this list: default struct constructors?AndreiSigh...Why can't you just use opCall?Why doesn't it work, bugs? Use opCall instead of constructor in the other cases too?Are there cases where ctors can do something opCall can't? I thought constructors were only added for symmetry with dtors.
Take this for example:
struct S {
int n;
this( ) {
n = random( );
}
}
class C {
S s;
}
In C++, 'new C( );' would call S's constructor, and initialize n to
some random number. opCall can do the same thing, but must be
explicitly called in C's constructor. This can be unacceptable for
libraries, at least.
--
Simen
