Skip to content

Instantly share code, notes, and snippets.

@PkmX
Created May 20, 2015 09:11
Show Gist options
  • Save PkmX/bb36dd093789075fce33 to your computer and use it in GitHub Desktop.
Save PkmX/bb36dd093789075fce33 to your computer and use it in GitHub Desktop.
struct B;
class C;
struct A {
A(const B&);
A(const C&);
private: int var1;
};
struct B : A {
protected: int var2;
};
class C : protected B {
};
A::A(const B& b) { b.var1; } // OK
A::A(const C& c) { c.var1; } // Invalid
int main() {
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment