So I've been trying to implement the same type of get and set like in C#. But something generated some doubts about how the variables are declared under the hood in c++. Here's the code:
class foo {
foo Getter() {
return *this;
}
foo f; //this isn't allowed
__declspec(property(get = Getter)) foo f2; // but this IS
};
What's really happening here?