3 ms·
"I often wish I worked in a language where I could start dynamic and end statically." C++ 'auto' type. Workflow: 1. Write 'auto =', see what the compiler pic
by quickben 9y ago
"I often wish I worked in a language where I could start dynamic and end statically."
C++ 'auto' type.
Workflow:
1. Write 'auto =', see what the compiler picks up (iterator of a vector of a set of classes that points to a list of structs, etc).
2. Potentially copy/paste that (unless the line is bigger than 350 characters :) )
- jeremyjh 9y agoType inference or deduction is not the same as dynamic typing. An auto variable resolves to exactly one type, which is determined by the expression it is bound to. If you pass that variable to a method expecting a different type, the compiler will stop you. If it were dynamically typed, it would let you proceed and fail at runtime.