www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Templated Struct Constructors

Is this a bug, or are templated struct constructors not allowed to
call other constructors?

---
struct A {
    this(T)(T thing, int i) {
        this(thing, i > 0); // Error: constructor call must be in a constructor
    }
    this(T)(T thing, bool b) {
    }
}

void main() {
    auto a = A(5, 5); // Error: template instance
constructtest.A.__ctor!(int) error instantiating
}
---
Dec 21 2011