How can a compiler generated default constructor be more efficient than a self-written one that does nothing but initialize members? [duplicate]
问题 This question already has answers here : Why would the implicitly generated constructor (et al.) be more efficient than a user-defined (trivial) one? (4 answers) Are user-defined default constructors less efficient? (2 answers) Closed 7 months ago . Triggered by this answer I was reading in the core guidelines: C.45: Don’t define a default constructor that only initializes data members; use in-class member initializers instead The reasoning given is Reason Using in-class member initializers