3 ms·
Auto is preferred for assignment because it eliminates a whole class of errors involving unintentional construction. Dropping a const is the conanical example.
by ok123456 2y ago
Auto is preferred for assignment because it eliminates a whole class of errors involving unintentional construction. Dropping a const is the conanical example.
Auto in a function signature is syntactic sugar for introducing a template parameter. It needs to be monomorphized at some point to generate code.