Consider the following code:
struct Foo {
int x;
int foo() const & { return x; }
// ^^^
int& foo() & { return x; }
// ^^^
};
What is the purpose of the highlighted ampersands before the function body?
Consider the following code:
struct Foo {
int x;
int foo() const & { return x; }
// ^^^
int& foo() & { return x; }
// ^^^
};
What is the purpose of the highlighted ampersands before the function body?