fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. template<typename T, typename...> struct require { using type = T; };
  5. template<typename... Args> void ignore(Args const &...){}
  6.  
  7. template<typename... Ints>
  8. auto f(Ints... x) -> typename require<void, typename std::enable_if<std::is_convertible<Ints, int>::value>::type...>::type
  9. {
  10. ignore((std::cout << x << std::endl)...);
  11. }
  12.  
  13. int main()
  14. {
  15. f(1);
  16. f(2, 3);
  17. }
  18.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1
3
2