fork(1) download
  1. template<class T>
  2. class IBase
  3. {
  4. public:
  5. virtual T Method() = 0;
  6. };
  7.  
  8. class Derived : public IBase<int>, public IBase<char> {
  9. public:
  10. int _value;
  11.  
  12. virtual int IBase<int>::Method();
  13. virtual char IBase<char>::Method();
  14. };
  15.  
  16. int Derived::Method() {
  17. return _value;
  18. }
  19.  
  20. char Derived::Method() {
  21. return _value;
  22. }
  23.  
  24. int main() {}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:12:36: error: cannot declare member function ‘IBase<int>::Method’ within ‘Derived’
     virtual int IBase<int>::Method();
                                    ^
prog.cpp:13:38: error: cannot declare member function ‘IBase<char>::Method’ within ‘Derived’
     virtual char IBase<char>::Method();
                                      ^
prog.cpp:16:21: error: no ‘int Derived::Method()’ member function declared in class ‘Derived’
 int Derived::Method() {
                     ^
prog.cpp:20:22: error: no ‘char Derived::Method()’ member function declared in class ‘Derived’
 char Derived::Method() {
                      ^
stdout
Standard output is empty