When using auto, the type deduction follows the rules for template type deduction.
One practical consequence of these rules is that auto will never deduce a reference.
Otherwise, the two corner cases to remember are:
- auto&& is always deduced and, therefore, a universal/forwarding reference (unlike T&& inside a template)
- the behaviour when using list initialization
Compiler Explorer link: https://compiler-explorer.com/z/sPnv5G3r4