I have been working in C++ for some time now, but I am unsure about the difference between the two options:
public : Thing(int _foo, int _bar): member1(_foo), member2(_bar){}
and
public : Thing(int _foo, int _bar){
member1 = _foo;
member2 = _bar;
}
I have a feeling that they do the same thing, but is there a practical difference between these 2 syntaxes. Is one of these safer then the other, and do they handle default parameters differently.
Not totally accustomed to the first example so if I made a mistake on it I apologize.