Can You Survive the C++ Auto Type Deduction Gauntlet?
One of the most iconic C++ features is the language’s ability to deduce types with the auto keyword. In this post, I’ll give a series of code snippits. Your job is to assess what will be deduced for v in each case. Determine for each: The deduced type If it is a value, an lvalue or rvalue reference, or a pointer Which CV qualifiers are applicable Some of these may not even compile, so “this won’t work” is a totally valid answer. ...