Does this type of initialization have a name?
class MyClass
{
public:
MyClass();
// ...
private:
int m_count;
};
MyClass::MyClass()
: m_count(0) // <-- this guy right here
{
}
Are there any benefits/fallbacks to doing it this way as opposed to this;
MyClass::MyClass()
{
m_count = 0;
}
Thanks!
PS - sorry if this has been posted before, it's hard to find something when you don't know it's name!