I am trying to define a specialization of a template class which contains a Non-type template Parameter member function. And I get the following error:
error: too few template-parameter-lists
Here's a sample class that describes the problem in brief,
// file.h
template <typename T>
class ClassA {
T Setup();
template <int K> static void Execute();
};
//file.cc
void ClassA<int>::Execute<2>() { //Do stuff }
I believe this is more of a syntax issue than a design issue, any clues? Thanks
Even if you fully specialize a template, you still need template<>:
template<> template<> void ClassA<int>::Execute<2>() { //Do stuff }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With