C++11 Nested

Anonymous
1,189 views
undefined

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

int x,y; // globals
class enclose { //
private:
int x; //
protected:
int xx;
public:
int xxx;
private:
static int s;
public:
private:
struct inner { //
void f(int i) {
//x = i; // enclose::x
//xx = i;
//xxx = i;
int a = sizeof x; // C++11
// C++11 OK sizeof
// enclose::x 使
s = i; // OK enclose::s
::x = i; // OK x
y = i; // OK y
}
void g(enclose* p, int i) {
p->x = i; // OK enclose::x
p->xx = i;
p->xxx = i;
}
};
};
int main()
{
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content