fork(1) download
  1. struct Base
  2. {
  3. virtual void Func(float f) = 0;
  4. virtual ~Base() = default; // to silence warnings
  5. };
  6.  
  7. template <typename T>
  8. struct Derived : Base
  9. {
  10. void Func(T f) override {} // will fail to compile if not overriding
  11. };
  12.  
  13. int main()
  14. {
  15. Derived<float> d;
  16. d.Func(0);
  17. return 0;
  18. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty