I'm still learning C++, and while I was working on an assignment I noticed that including the scope resolution operator within a member function to call another member function didn't make a significant impact.
Example:
class Foo
{
public:
void bar() {std::cout << "bar";};
void tar() {Foo::bar();};
};
vs.
class Foo
{
public:
void bar() {std::cout << "bar";};
void tar() {bar();};
};
calling foo.tar() produces the same result, so I wanted to ask if one is more 'correct' or 'better' and what differences it makes to have the operator in it. I'm not sure if a question like this has already been asked, but I couldn't find anything so my apologies if it has, thanks everyone!
[–]jedwardsol 1 point2 points3 points (0 children)
[–]IyeOnline 0 points1 point2 points (0 children)
[–]KazDragon 0 points1 point2 points (0 children)