Just wondering which of these functions would be faster (or if they would be the same):
class MyClass
{
private:
bool MyVar;
public:
MyClass &Function1(bool MyVar);
MyClass &Function2(bool MyVar);
MyClass &Function3(bool var);
};
MyClass &MyClass::Function1(bool MyVar)
{
this->MyVar=MyVar;
cout<<MyVar;
return *this;
}
MyClass &MyClass::Function2(bool MyVar)
{
this->MyVar=MyVar;
cout<<this->MyVar;
return *this;
}
MyClass &MyClass::Function3(bool var)
{
MyVar=var;
cout<<MyVar;
return *this;
}