[Issue 9857] UFCS for struct opCall

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 2 17:27:03 PDT 2013


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



--- Comment #10 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-04-02 17:27:02 PDT ---
> Do you want to explain why?

> (Constructors are functions, so why introduce an asymmetry.)

In great part because they're _not_ normal functions. They're constructors.
They're also not free functions, and the whole idea with UFCS was that it would
work with free functions so that you could act like the function was a member
of the type of its first argument. It allowed you to essentially add member
functions to a type, and therefore be able to not care whether a function was
implemented on a type or as a free function, thereby making code more generic.
This is trying to take UFCS beyond free functions, and it makes no sense for a
constructor to be treated as a member function of another type, because it
never could have been implemented as a member function of that type in the
first place.

-- 
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