6 ms·
C++ and Rust require extra disambiguating syntax in some contexts (C++ the `foo.template bar<T>()` syntax, Rust the "superfish operator" `foo.bar::<T>()`. Java
by Sharlin 6y ago
C++ and Rust require extra disambiguating syntax in some contexts (C++ the `foo.template bar<T>()` syntax, Rust the "superfish operator" `foo.bar::<T>()`. Java works around the problem by awkwardly putting the generic argument list in front of the method name (`foo.<T>bar()`). I don't know about C#.
- steveklabnik 6y ago(teeny tiny note: turbofish, not superfish)
- Sharlin 6y agoOops :D
- DougBTX 6y agoC# is `foo.bar<T>()`, I’m not sure what compromises that had to make for that to work but from an end-user perspective it works well.
- oxnrtr 6y agoUsing [] is the optimal choice for languages in general, but they can't even use that because they blew away that syntax for indexing.