[Issue 3680] default struct constructor should not be removed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 15 08:43:22 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3680



--- Comment #5 from ibrahim YANIKLAR <yanikibo at gmail.com> 2010-01-15 08:43:21 PST ---
> What bothers me is this :
> > To remove static opCall's completely is another subject...

I will explain that by opening a new issue.

> A case which needs clarification, by the way, is when the struct is
> externalized to C which does not prohibits the default construction to be
> used...

The implementation of the default constructor should be prohibited as the
current situation. Also the implementation of the default opCall (static ...
opCall()) should be prohibited. And implementing a non-default constructor or a
non default opCall should not cause the removal of the defaults.

------------------------------
struct S {
  ...
  this() { ... } // should give error
}
------------------------------
struct S {
  ...
  static S opCall() { ... } // should give error
}
------------------------------
struct S {
  ...
  this(int a) { ... }
  static S opcall(double d) { ... }
}

S s = S(); // should work
S* s = new S(); // should work
------------------------------

Is this proposal causes a problem like you have depicted? Probably I could not
understand your case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list