On Tue, 11 Oct 2011 12:40:29 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
Nope. Private ctors have to be called from within the same module,
whether implicit or not:
test.d:
class Foo
{
private this() { } // Error: constructor main.Bar.this no match
for implicit super() call
On Fri, 07 Oct 2011 18:02:33 -0400, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
Is there any way to enforce the user to call the base-class ctor via
super(), so it's the first statement in his class ctor? e.g.:
class Base {
this(int) { }
}
class Derived : Base {
this(int x) {
Nope. Private ctors have to be called from within the same module,
whether implicit or not:
test.d:
class Foo
{
private this() { } // Error: constructor main.Bar.this no match
for implicit super() call in constructor
}
import test;
class Bar : Foo
{
this() { }
}
void main()
{
auto
On Fri, 07 Oct 2011 23:02:33 +0100, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
So I'm looking for some techniques or tricks (or, dare I say, design
patterns :x) you guys might have if you've ever ran into this kind of
problem.
The best I can come up with is a runtime solution:
import
Is there any way to enforce the user to call the base-class ctor via
super(), so it's the first statement in his class ctor? e.g.:
class Base {
this(int) { }
}
class Derived : Base {
this(int x) {
super(x);
// user statements
}
}
The problem I'm having is that Base