Virtual Template Function Overload
        template <class T, class U, class Child>
    class Parent {
    public:
      virtual T blah() {
        return gaga;
      }
    protected:
      T gaga;
    };
     
    class Child : public Parent<double, double, Child> {
      virtual void blah(int overloaded) {
      }
     
      virtual void func() {
        blah();
      }
    };
     
    int main() {
      Child* p = new Child();
    }
     


Why doesn't the code above compile? Why can't I overload my virtual function like that? The errors I am getting....

    prog.cpp: In member function ‘virtual void Child::func()’:
    prog.cpp:16: error: no matching function for call to ‘Child::blah()’
    prog.cpp:12: note: candidates are: virtual void Child::blah(int)
    prog.cpp: In function ‘int main()’:
    prog.cpp:21: warning: unused variable ‘p’


Virtual Template Function Overload
===

        template <class T, class U, class Child>
    class Parent {
    public:
      virtual T blah() {
        return gaga;
      }
    protected:
      T gaga;
    };
     
    class Child : public Parent<double, double, Child> {
      virtual void blah(int overloaded) {
      }
     
      virtual void func() {
        blah();
      }
    };
     
    int main() {
      Child* p = new Child();
    }
     


Why doesn't the code above compile? Why can't I overload my virtual function like that? The errors I am getting....

    prog.cpp: In member function ‘virtual void Child::func()’:
    prog.cpp:16: error: no matching function for call to ‘Child::blah()’
    prog.cpp:12: note: candidates are: virtual void Child::blah(int)
    prog.cpp: In function ‘int main()’:
    prog.cpp:21: warning: unused variable ‘p’

