template <size_t size, typename ...Params>
void doStuff(Params...) {
}
template <>
void doStuff<size_t(1), int, bool>(int, bool) {
}
int main(int, char**) {
doStuff<1,int,bool>(1, false);
return 0;
}
This doesn't compile, the second doStuff declaration gives me error: template-id ‘doStuff<1u, int, bool>’ for ‘void doStuff(int, bool)’ does not match any template declaration
but it clearly matches the first declaration with variadic template arguments.
How to specialize variadic templates?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…