fork download
  1. #include <type_traits>
  2.  
  3. int f(int); // we deduce the returning type of this function
  4.  
  5. int main()
  6. {
  7. std::result_of<decltype(f)>::type x;
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:7:5: error: 'type' is not a member of 'std::result_of<int(int)>'
     std::result_of<decltype(f)>::type x;
     ^
stdout
Standard output is empty