fork download
  1. template <const int N>
  2. struct UnrolledOp
  3. {
  4. template <const int j, int op(int*, int*)>
  5. static void Do(int* foo, int* l, int* r)
  6. {
  7. return UnrolledOp<N - 1>::template Do<j + 4, op>(foo, l, r);
  8. }
  9. };
  10.  
  11. template <>
  12. struct UnrolledOp<0>
  13. {
  14. template <const int j, int op(int*, int*)>
  15. static void Do(int* foo, int* l, int* r) { }
  16. };
  17.  
  18. template <const int fooSize, int op(int*, int*)>
  19. void Op(int* foo, int* l, int* r)
  20. {
  21. UnrolledOp<fooSize / 4>::template Do<0, op>(foo, l, r);
  22. }
  23.  
  24. int Test(int* x, int* y)
  25. {
  26. return 0;
  27. }
  28.  
  29. int main()
  30. {
  31. Op<16, Test>(nullptr, nullptr, nullptr);
  32. return 0;
  33. }
Success #stdin #stdout 0s 4288KB
stdin
Standard input is empty
stdout
Standard output is empty