fork(4) download
  1. #include <type_traits>
  2.  
  3. struct X{
  4. bool operator()(int (&&arr)[3]);
  5. long operator()(void*);
  6. };
  7.  
  8. // X x; x(alias<int[]>{1,2,3}); -- will call first overload
  9. static_assert(std::is_same<std::result_of<X(int[3])>::type, bool>(), "/cry");
  10. static_assert(std::is_same<decltype(std::declval<X>()(std::declval<int[3]>())), long>(), "/yay");
  11.  
  12. int main(){}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:1: error: static assertion failed: /cry
prog.cpp:10:1: error: static assertion failed: /yay
stdout
Standard output is empty