fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. auto dupa1(auto num)->decltype(num+8){
  5. return num+8;
  6. }
  7.  
  8. auto dupa2(auto num){
  9. return num+8;
  10. }
  11.  
  12. template <typename T>
  13. T dupa3(T num){
  14. return num+8;
  15. }
  16.  
  17. int main() {
  18. double a=10.1;
  19. int b=5;
  20. cout << dupa1(a) << endl;
  21. cout << dupa2(a) << endl;
  22. cout << dupa3(a) << endl;
  23. cout << dupa1(b) << endl;
  24. cout << dupa2(b) << endl;
  25. cout << dupa3(b) << endl;
  26. return 0;
  27. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
18.1
18.1
18.1
13
13
13