1

I'm attempting to deal with an error message produced by g++, regarding the specialization of a template member function in a particular class. I get the error message

error: specialization of ‘template<class T> std::vector<T>& push::GrammarEnv::stack_accessor()’ in different namespace [-fpermissive]

However, the specialization appears to be in the same namespace. Indeed, changing the namespace produces an error stating that the template function was not declared.

What could be causing this issue, and how can I tell what namespace the compiler believes the specialization is taking place in? The error message simply gives the original, unspecialized function declaration's namespace.

4

0 回答 0