Thursday 12 September 2013

How do "const", "&", and "&&" affect overloading of a parameterless function?

How do "const", "&", and "&&" affect overloading of a parameterless function?

Consider a class defined as below:
struct A
{
void f();
void f() const;
void f() &;
void f() const &;
void f() &&;
void f() const &&;
};
What are the differences between:
1) void A::f(); and void A::f() &;
2) void A::f() const; and void A::f() const &;
3) void A::f() &&; and void A::f() const &&;

No comments:

Post a Comment