fork download
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. void func(std::initializer_list<T> s) {
  5. for (T const& t: s) {
  6. std::cout << t << '\n';
  7. }
  8. }
  9.  
  10. int main() {
  11. func({1, 2, 3});
  12. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1
2
3