fork download
  1. struct mat4 {};
  2.  
  3. struct Base {
  4. void operator*(float) {}
  5. };
  6.  
  7. struct Derived : Base {
  8. void operator*(mat4) {}
  9. };
  10.  
  11.  
  12. int main() {
  13. Derived d;
  14. mat4 m;
  15. d * m;
  16. d * 4.2f;
  17. return 0;
  18. }
  19.  
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:9: error: no match for ‘operator*’ in ‘d * 4.19999981e+0f’
prog.cpp:16:9: note: candidate is:
prog.cpp:8:10: note: void Derived::operator*(mat4)
prog.cpp:8:10: note:   no known conversion for argument 1 from ‘float’ to ‘mat4’
stdout
Standard output is empty