mercredi 3 août 2016

C++ STL: Why does std::pair expose member variables?

From http://www.cplusplus.com/reference/utility/pair/ we know std::pair has two member variables, first and second.

As far as I know, it will be better if encapsulating two member variables above and giving a getFirst(); and getSecond();, so why does STL design like that?

Aucun commentaire:

Enregistrer un commentaire