fork download
  1. #include <iostream>
  2.  
  3. #define use_constexpr 0
  4.  
  5. template<class T>
  6. constexpr T operator *(const T& InA,const T& InB) {
  7. #if use_constexpr
  8. //ancient mul method.
  9. #else
  10. return InA * InB;
  11. #endif
  12. }
  13. template<class T ,class U>
  14. constexpr T operator /(const T& InA,const U& InB) {
  15. #if use_constexpr
  16. //ancient div method.
  17. #else
  18. return InA / InB;
  19. #endif
  20. }
  21.  
  22. int main() {
  23.  
  24. constexpr int A = 16;
  25. constexpr int B = 8;
  26. int M = 0;
  27. int D = 0;
  28.  
  29. M = A * B;
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 4280KB
stdin
Standard input is empty
stdout
Standard output is empty