T
Tom McCallum
I have looked all afternoon and I can't find a definite answer on the
following problem. I have defined a class
My question is why can't I define my iterator below?
template<class T>
class myClass {
public:
void myfunction();
};
and then a function:
template<class T>
void myclass<T>::myfunction() {
multimap<double, T* > i; // why is this allowed and
multimap<double, T* >::iterator j; // why is this not allowed?
}
The error I get with the iterator line is "parse error before '=' token".
I read somewhere that you could not define partial iterators - but if you
cannot use them why bother being able to define containers in template
classes?
Any suggestions, workarounds, reasons would be greatly appreciated.
Many thanks
Tom
following problem. I have defined a class
My question is why can't I define my iterator below?
template<class T>
class myClass {
public:
void myfunction();
};
and then a function:
template<class T>
void myclass<T>::myfunction() {
multimap<double, T* > i; // why is this allowed and
multimap<double, T* >::iterator j; // why is this not allowed?
}
The error I get with the iterator line is "parse error before '=' token".
I read somewhere that you could not define partial iterators - but if you
cannot use them why bother being able to define containers in template
classes?
Any suggestions, workarounds, reasons would be greatly appreciated.
Many thanks
Tom