fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T>
  5. auto f(T x) -> decltype(x)
  6. {
  7. T x2 = 2 * x;
  8. return x2 + (x * x + 1) / x2;
  9. }
  10.  
  11. template int f(int );
  12.  
  13. int main() {
  14. cout << f(5);
  15. return 0;
  16. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
12