Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

compile c++ clang online

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.7 sec, absolute service time: 0.88 sec 
edit mode |  history
Error(s):
/var/www/service/usercode/816208133/source.cpp:15:20: error: 'v' is a private member of 'template_class<char>'
        cout << t2.v << endl;
                   ^
/var/www/service/usercode/816208133/source.cpp:21:5: note: in instantiation of member function 'foo' requested here
    foo(t);
    ^
/var/www/service/usercode/816208133/source.cpp:6:7: note: implicitly declared private here
    T v;
      ^
/var/www/service/usercode/816208133/source.cpp:14:12: error: 'v' is a private member of 'template_class<char>'
        t2.v = 'c'; // (3)why accessible too even if instantiated with [T=int]?
           ^
/var/www/service/usercode/816208133/source.cpp:6:7: note: implicitly declared private here
    T v;
      ^
2 errors generated.

        

    
                
λ
.NET NoSQL database for rapid development