[Development] RFC: Containers member functions for algorithm

Konrad Rosenbaum konrad at silmor.de
Thu Mar 23 11:51:02 CET 2017


On Thursday, March 23, 2017 10:36:06 Marc Mutz wrote:
> There're
> proposals floating around for years to make o.f() fall back to f(o) for std
> C++.

Those are a lot more pain than you'd think! This construct already exists in 
C# (static extension classes/methods) and it is causing major headaches there 
- depending on your using statements (equiv. of #include) what looks like a 
simple method call can mean totally different things or not work at all! A 
change in a different section of the class that necessitates an additional 
using directive may cause all kinds of mayhem. It is a nightmare if you have 
to diagnose problems.

In short: the recommendation in the C# world is: "do not use them unless you 
absolutely positively have no other choice." We should take that as a warning.


	Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170323/7cab49ac/attachment.sig>


More information about the Development mailing list