Topic: Variadic Templates Recursion Initializer Lis?= =?windows-1252?Q?ts.


Author: Kenshin <kenshin.himura.sakabato@gmail.com>
Date: Wed, 9 Dec 2009 12:08:09 CST
Raw View
Seems to me like the only way to write functions/classes taking
variadic templates is by recursion. Is that true? Can the below work,
for iteration?

template<class    T>
auto func(const T&    t){

 std::initializer_list<?> ilist = {t   }; //what should go here <?>//
  for(const auto& arg : ilist)
       //use arg//
}


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]