Author
anonymous
over 7 years ago
Language
Compiler
Options
Author
anonymous
over 7 years ago
$
prog.cc: In function 'int main()':
prog.cc:14:24: error: 'void Enclosing::EnclosingFun(Enclosing::Nested*, T) [with T = int]' is private within this context
e.EnclosingFun(0, 0);
^
prog.cc:7:10: note: declared private here
void EnclosingFun(Nested *n, T t) {
^~~~~~~~~~~~
prog.cc: In instantiation of 'void Enclosing::EnclosingFun(Enclosing::Nested*, T) [with T = int]':
prog.cc:14:24: required from here
prog.cc:8:30: error: 'int Enclosing::Nested::y' is private within this context
std::cout << t << n->y; // OK? Why?
~~~^
prog.cc:4:24: note: declared private here
class Nested { int y; };
^
Exit Code:
1