#include <iostream> // .hclass A {public: void load(); private: struct B {int i = 1;};}; // .ccvoid foo(A::B c) { std::cout << c.i << std::endl; std::cout << "YEAH!" << std::endl;} void A::load() { foo(B());} int main() { A a; a.load(); return 0;}
Standard input is empty
prog.cpp: In function ‘void foo(A::B)’: prog.cpp:13:13: error: ‘struct A::B’ is private within this context void foo(A::B c) { ^ prog.cpp:9:10: note: declared private here struct B {int i = 1;}; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!