A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.
Document number: N4174
Date: 2014-10-11
Call syntax: x.f(y) vs. f(x,y)
by Bjarne Stroustrup
Excerpt:
This note explores the possibility of providing a uniform call syntax by giving member functions preference over non-member functions. Offering the choice between the
x.f(y)
andf(x,y)
notations with different meanings means that different people will chose differently for their function definitions, so that users have to know the choice and write calls appropriately. This gives users more opportunities for making mistakes, makes it harder to write generic code, and has led to replication when people define both a member and a non-member function to express the same thing. I suggest that providing different meanings to the two syntaxes offers no significant advantage.
Add a Comment
Comments are closed.