Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 26th, 2011  |  syntax: None  |  size: 0.76 KB  |  views: 75  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. % cat variadic.cpp
  2. template <typename... TS>
  3. void do_stuff(TS... ts)
  4. {
  5.   auto f = [](TS... things) { };
  6. }
  7.  
  8. int main () {
  9.     do_stuff(10,20,30);
  10. }
  11.  
  12.  
  13. % LANG=C make CXXFLAGS="-std=c++0x -ggdb -Wall -Wextra -Wpacked" CXX=/home/evnu/bin/g++ variadic
  14. /home/evnu/bin/g++ -std=c++0x -ggdb -Wall -Wextra -Wpacked    variadic.cpp   -o variadic
  15. variadic.cpp: In instantiation of 'void do_stuff(TS ...) [with TS = {int, int, int}]':
  16. variadic.cpp:8:22:   required from here
  17. variadic.cpp:4:8: warning: variable 'f' set but not used [-Wunused-but-set-variable]
  18. variadic.cpp:2:6: warning: unused parameter 'ts#0' [-Wunused-parameter]
  19. variadic.cpp:2:6: warning: unused parameter 'ts#1' [-Wunused-parameter]
  20. variadic.cpp:2:6: warning: unused parameter 'ts#2' [-Wunused-parameter]