| Lecture 2 - Slide 25 : 29 |
C++ supports several different notations and mechanisms for initialization
T v1 = v; // C style initialization.
T v2 = {v}; // C style List initialization.
T v3(v); // Constructor style initialization.
T v4{v}; // Universal initialization, without narrowing. Preferred.
T v5{}; // Default initialization. For user-defined types, use parameterless constructor.