Please be aware that you will see an oversimplified version of the code here. So it might look useless. However, that is not the problem.
The problem is that I have a primary template class like this:
// The primary template class
template<int N>
struct Start {
int start;
template<typename... Args>
int operator()(Args... args) const {return start;}
};
When I specialize this class template:
// Specialization for N=1:
template<>
struct Start<1> {
int operator()(int i) const {return start;}
};
I get the following error:
error: ‘start’ was not declared in this scope
int operator()(int i) const {return start;}
Why is start not declared in the scope of class Start<1>?
Question
- Why does the specialized class not recognize the member of the primary class?
I appreciate any suggestions.