Template Problem
I'm trying to compile this peice of code and get an error message about template explicit specification before definition under Visual C++ 6.
template<class T>
union myunion {
.......
};
template<class T>
class myclass {
..........
union myunion<T> *p;
};
What's the problem here? I'm passing the same type to be used for the union in the class.
Thanks.
What error number is this? Often, searching Google for that number'll give you everything you need to know.
Also, consider that VC6 has legendary template support. Or lack thereof.
CM
Also, consider that VC6 has legendary template support. Or lack thereof.
CM
Quote:Original post by quaker
If I wanted to search it on google I would not post it here.
Well then why not provide a better description of your problem? Post actual code that breaks, not an approximation of what you think might be causing the problem -- and then give us the exact error you are getting rather than "an error message about template explicit specification" which doesn't even make sense. Did you mean explicit template specialization possibly? It is not our responsibility to try to figure out what you mean. Take the little time that it takes to form a better description of the situation.
Quote:Original post by quaker
If I wanted to search it on google I would not post it here.
If you actually want an answer here you shouldn't have posted this reply either.
There's a certain etiquette to asking questions on a forum. I'll post the link again: Asking Questions the Smart Way .
Anyway - try removing the "union" tag before the union member declaration. That strikes me as a C-ism - though I don't have a VC6.0 to test if that is the problem.
I.e.
// instead of// union myunion<T> *pmyunion<T> *p;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement