4 ms·
It is still type inference though. If 2 is an int, the compiler perform type inference to figure out that the expression 2 + 2 is also an int. It is just that t
by goto11 3y ago
It is still type inference though. If 2 is an int, the compiler perform type inference to figure out that the expression 2 + 2 is also an int. It is just that traditional languages only use type inference for expressions, not declarations.
- dllthomas 3y agoIt's type propagation. Which can be seen as a form of inference or not, depending just where you draw the line.
- gpderetta 3y agoSo is auto, decltype and templates. In C++ we properly call it type deduction to distinguish it from actual H-M style inference which C++ lacks. The details of how it is called doesn't detract from parent's argument.
- dllthomas 3y agoYes. I hadn't meant my comment as argument on either side, just added context.