fork download
  1. #include <iostream>
  2.  
  3. template <class T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
  4. T sum(T a,T b)
  5. {
  6. return a + b;
  7. }
  8.  
  9.  
  10. int main() {
  11. // your code goes here
  12. int a{2}, b{3};
  13.  
  14. std::cout << sum(a, b);
  15.  
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
5