UFCS and constructors

Jonathan M Davis jmdavisProg at gmx.com
Tue Jul 2 01:16:28 PDT 2013


On Tuesday, July 02, 2013 09:35:38 monarch_dodra wrote:
> Coming back from learn here. There was an example where somebody
> "accidentally" called a constructor via UFCS. I am kind of
> surprised that it worked. I thought UFCS was for functions only,
> and that constructors (specifically) were off limits.
> 
> Am I mistaken? Is UFCS explicitly allowed for constructors? Or
> did we kind of forget to take it into account?

I'm not sure that it was ever decided one way or the other so much as happened 
into being due to how UFCS was implemented. I know that it's come up before, 
and folks were arguing on both sides. Personally, I think that it's a horrible 
idea.

- Jonathan M Davis


More information about the Digitalmars-d mailing list