Implementing UFCS in Clang
10 comments · 94% upvoted · source · other discussions
10 comments · 94% upvoted · source · other discussions
UFCS is not extension methods. That's something else.
UFCS is allowing common calling syntax for both member and non-member functions. Extension methods are additional syntax for a 3rd kind of function...
Well, in the common definition, ufcs allows for what is commonly referred to as extension method syntax. That doesn't mean it's identical to something like C#, the big difference is of course that with ufcs, you are still allowed to call it as a free function.
I would love to see this. Seems like a good compromise - it's not exactly classic UFCS, but lets you basically do the same. I like it.
I think extension methods are not very appealing in c++ because the STL way for extensibility is to prefer free functions instead of member functions syntax. Recent language development like ranges operator| and |> also follow that pattern.
Would love this. There are so many times when a class (which I can't modify) is missing some really convenient method, and so I end up either:
germandiago 1 points · Aug 2020
True but... IDE completion?
Not sure how reliable. Anyway, eith modules things should be ok.
fdwr 3 points · Aug 2020 · fdwr@github 🔍
Yes please 😄.