Template specialization with variadic templates

前端 未结 1 384
时光取名叫无心
时光取名叫无心 2021-01-03 22:20
template 
void doStuff(Params...) {
}

template <>
void doStuff(int, bool) {

}

int main(in         


        
相关标签:
1条回答
  • 2021-01-03 22:46

    The syntax is correct (afaik, and clang++ accepts it), but your compiler is probably just not up2date yet.

    If you use gcc, its variadic template support is quite incomplete, and even very recent svn versions don't support specialization yet (That is just how it is when you use bleeding edge technology, and sadly gcc implemented only a very early incomplete variadic template proposal and since then didn't keep up much, while clang started pretty late, but got pretty complete)

    0 讨论(0)
提交回复
热议问题