fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. template<typename F, typename ...Args>
  5. auto call(F&& f, Args&& ...args)
  6. -> typename std::enable_if<std::is_same<decltype(f()), void>::value>::type
  7. {
  8. std::cout << "call 3\n";
  9. }
  10.  
  11.  
  12. template<typename ...Args>
  13. void call(Args&& ...args) {
  14. std::cout << "call 1\n";
  15. }
  16.  
  17.  
  18.  
  19. int main() {
  20. call(1);
  21. call([](){});
  22. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
call 1
call 3