J
James W. Walker
I can't understand why I'm getting an error message from code like
this...
#include <vector>
template <class T>
struct Foo
{
typedef int (T::*Method)( int i );
typedef int (*Func)( int i );
std::vector< Method > mMethodVec;
void Bar()
{
std::vector< Func >::iterator i;
std::vector< Method >::iterator j;
}
};
The error is on the line declaring the iterator j. For some reason the
compiler expects a semicolon before that. There's no error on the mere
declaration of a vector of method pointers, and if I can create the
vector, I ought to be able to have an iterator for it.
this...
#include <vector>
template <class T>
struct Foo
{
typedef int (T::*Method)( int i );
typedef int (*Func)( int i );
std::vector< Method > mMethodVec;
void Bar()
{
std::vector< Func >::iterator i;
std::vector< Method >::iterator j;
}
};
The error is on the line declaring the iterator j. For some reason the
compiler expects a semicolon before that. There's no error on the mere
declaration of a vector of method pointers, and if I can create the
vector, I ought to be able to have an iterator for it.