4 ms·
C# doesn't have unified call syntax, it has extension methods. You're right in that they do allow you to write a function that takes an argument and call it as
by braveo 10y ago
C# doesn't have unified call syntax, it has extension methods. You're right in that they do allow you to write a function that takes an argument and call it as if it wasn't on that argument, but it doesn't have UCS generically, just as a special case.
- beached_whale 10y agoYou are technically correct, the best kind. The ability is similar though, although I can see some fun C++ code with templates to apply it to all types. Then, if allowed, something like int i; i.print( ); could happen.