Re: Constructor Inheritance

2016-06-20 Thread Meta via Digitalmars-d-learn
this for you. Maybe take a look in std.typecons or std.meta (or wherever they shove those things these days)? T I was going to say that this is painful compared to Java or C++, but it looks like it's been too long since I've used those languages as well; neither of them allow c

Re: Constructor Inheritance

2016-06-20 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jun 21, 2016 at 02:48:39AM +, ketmar via Digitalmars-d-learn wrote: > no and no. howewer, creating template mixin with default ctors may > spare you of some typing. I think Phobos has an AutoImplement template that might do this for you. Maybe take a look in std.typecons or std.meta (o

Re: Constructor Inheritance

2016-06-20 Thread ketmar via Digitalmars-d-learn
no and no. howewer, creating template mixin with default ctors may spare you of some typing.

Constructor Inheritance

2016-06-20 Thread Meta via Digitalmars-d-learn
It's been so long since I've had to use OOP in D that I'm starting to forget things like this. If I have the parent class A which defines a constructor: class A { string val; this(string val) { this.val = val; } } And a child class B which inherits from A: class B: A { } I get the t