fork(5) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <type_traits>
  5.  
  6. template<typename T, typename F, typename... X>
  7. void bar(std::vector<T> const&c, F const&f, X&&... x)
  8. {
  9. std:for_each(c.begin(),c.end(),[&](const T&t)
  10. { f(t,std::forward<X>(x)...); });
  11. }
  12.  
  13. int main()
  14. {
  15. std::cout << "Hello, World!\n";
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In lambda function:
prog.cpp:10:32: error: parameter packs not expanded with ‘...’:
          { f(t,std::forward<X>(x)...); });
                                ^
prog.cpp:10:32: note:         ‘x’
stdout
Standard output is empty