Topic: [variadic_templates]pattern expansion with non-pack present
Author: cppljevans@gmail.com
Date: Mon, 4 May 2009 22:52:44 CST Raw View
Boost mpl has sequences composed of integral constants:
http://www.boost.org/doc/libs/1_39_0/libs/mpl/doc/refmanual/integral-sequence-wrapper.html
Why couldn't this be implemented with variadic templates something
like:
template<class T, T... C>
struct SEQ_c
: SEQ<integral_c<T,C>...>
{};
? I tried compiling something like this; however, I got
a compile error:
error: parameter packs not expanded with '...':
However, when the T in the expansion was replaced with a constant
type, e.g. int, the expansion worked.
Code illustrating the problem is in the boost vault under
variadic_templates:
http://www.boostpro.com/vault/index.php?&directory=variadic_templates
in file:
list_c_expansion_wish.cpp
--
[ 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 ]