Jump to content

C++ Language/Std/Stl/CallableObjects/ImplicitGetterFunction

From Wikibooks, open books for an open world

For every data member in a class, there is an implicit getter-function (even if the programmer didn't explicitly define that as a member function):
std::function<int(const CRType*)> GetMember
  = &CRType::m_iMember;

Additional information about implicit getter-functions (includes interactive examples)