TIL that you can declare return types this way in C++.
Linux
5
Posts
5
Posters
0
Views
-
TIL that you can declare return types this way in C++.
-
-
TIL that you can declare return types this way in C++.
I never understood why they added that
-
I never understood why they added that
Among other things it lets you define the return type in terms of the arguments to the function.
-
I never understood why they added that
because explicitly declaring types can be redundant, if the compiler knows a lot of the times you should also know
also because some types are extremely cursed: see std views/ranges
-
I never understood why they added that
They're useful for templates because the trailing version is resolved later
-