samedi 27 mars 2021

is default constructor is better than user defined in c++11 if its exactly the same

struct widget
{
  widget()=default; // better than widget(){} ?

  inline widget& operator=(const widget&);
};

why is using default constructor here better? more specifically, how is the compiler-generated constructor more efficient than the one we provide, if we provide exactly the same constructor?

Aucun commentaire:

Enregistrer un commentaire