fork(3) download
  1. #include <type_traits>
  2.  
  3. struct Y{};
  4.  
  5. struct X{
  6. bool operator()(Y const&);
  7. long operator()(Y&&);
  8. };
  9.  
  10. Y const f();
  11.  
  12. int main(){
  13. static_assert(std::is_same<std::result_of<X(Y const)>::type, bool>(), "/cry");
  14.  
  15. X x;
  16. using result_type = decltype(x(f()));
  17. static_assert(std::is_same<result_type, bool>(), "/yay");
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13:3: error: static assertion failed: /cry
stdout
Standard output is empty