Type Inference
suggest changeVersions
Introduction
This topic discusses type inference with the keyword auto, available since C++11.
Remarks
Add const, &, or constexpr to an auto declaration when the program needs those properties; doing so can prevent unintended copies or mutation. Use auto when the initializer makes the type clear or when spelling the type would add noise, while avoiding it where an explicit type better communicates intent.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents