dimanche 25 janvier 2015

"= default" about constructor in c++ [duplicate]


This question already has an answer here:





struct Sale{
Sale () = default;//I got nothing about those cod
Sale(std::istream &input);
Sale(const std::string &s):book(s) {}
//and so on......
}


What did the second code mean? Is that mean that doing nothing ?Or we must write those default code to tell the compiler we made a default constructor which doing nothing. And what about the "= default" mean in the C++11?


Aucun commentaire:

Enregistrer un commentaire