fork download
  1. #include <iostream>
  2.  
  3. template <int I1, int I2>
  4. struct adder { };
  5.  
  6. template <typename A, int I>
  7. struct fusedmultiplyadder { };
  8.  
  9. template <int i1, int i2, int i3>
  10. void foo(fusedmultiplyadder<adder<i1, i2>, i3>)
  11. {
  12. std::cout << "fma: " << i1 << ", " << i2 << ", " << i3 << std::endl;
  13. }
  14.  
  15. int main()
  16. {
  17. fusedmultiplyadder<adder<2, 3>, 4> fma;
  18. foo(fma);
  19. return 0;
  20. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
fma: 2, 3, 4