lundi 23 octobre 2017

c++ null constructor constexpr or properly null?

Is it better to declare a null constructor which:

  • Allocates default values to the member data and is declared constexpr, or
  • leaves all member data undefined?

I'm thinking mainly in the context of STL containers, e.g. vectors make heavy use of null constructors, so which way is more efficient?

Aucun commentaire:

Enregistrer un commentaire