Comment by mckravchyk 6 months ago C++ does not have a function keyword at all, I wonder why did they add it in the first place. 4 comments mckravchyk Reply Tuna-Fish 6 months ago The c++ notation for functions (and types in general) is horrible, and makes parsing much more expensive than it needs to be. Fixing it is step one if you are making a modern language. pjmlp 6 months ago A compatibility required by C. twoodfin 6 months ago To avoid any possibility of reintroducing the Most Vexing Parse?https://en.wikipedia.org/wiki/Most_vexing_parse gpderetta 6 months ago It doesn't, but you can pretend it does: auto my_function(int, double) -> int; They probably want to use the same arrow signature and need something in place of auto as omitting it completely would complicate parsing.
Tuna-Fish 6 months ago The c++ notation for functions (and types in general) is horrible, and makes parsing much more expensive than it needs to be. Fixing it is step one if you are making a modern language. pjmlp 6 months ago A compatibility required by C.
twoodfin 6 months ago To avoid any possibility of reintroducing the Most Vexing Parse?https://en.wikipedia.org/wiki/Most_vexing_parse
gpderetta 6 months ago It doesn't, but you can pretend it does: auto my_function(int, double) -> int; They probably want to use the same arrow signature and need something in place of auto as omitting it completely would complicate parsing.
The c++ notation for functions (and types in general) is horrible, and makes parsing much more expensive than it needs to be. Fixing it is step one if you are making a modern language.
A compatibility required by C.
To avoid any possibility of reintroducing the Most Vexing Parse?
https://en.wikipedia.org/wiki/Most_vexing_parse
It doesn't, but you can pretend it does:
They probably want to use the same arrow signature and need something in place of auto as omitting it completely would complicate parsing.