Re: Forwarding constructor arguments to super

2010-06-14 Thread bearophile
pillsy: > Is there a good way to forward constructor arguments to a superclass > constructor? This seems to work for simple situations, but maybe it doesn't work in more complex cases: import std.traits: ParameterTypeTuple; mixin template This() { this(ParameterTypeTuple!(super.__ctor) ar

Forwarding constructor arguments to super

2010-06-12 Thread pillsy
Is there a good way to forward constructor arguments to a superclass constructor? I.e., if I have something like this class Foo { int _x; this (int x) { _x = x; } } class Bar : Foo {} I'd like to able to have this just work: auto bar = new Bar(3); However, doing this means that DMD compl