It seems like saying that a constructor with all default arguments is not a default constructor is a distinction without meaning. What are you doing that you would care?


The Object.factory does not seem to consider a constructor with default arguments as a defaultConstructor. Consider the following code snippet. It works only when I uncomment line 3.

module foo;                               // 1
class Foo {                               // 2
  // this() {}                            // 3
  this(int n=0) {}                        // 4
}                                         // 5
void main() {                             // 6
  auto obj = Object.factory("foo.Foo");         // 7
  assert(obj !is null);                   // 8
  auto foo = cast(Foo) obj;               // 9
  assert(foo !is null);                   // 10
}                                         // 11

Reply via email to