0
template<class T>
struct TSData{
    int timestamp;
    T data;
}; 

int main () {
    std::vector<TSData<int>> Gen;   //Compile Error
    std::vector<TSData<int> > Stts; //Compiles fine
}

I'm using Visual c++ 6.0, and I ran into this issue today. I'm wondering why having a space makes the second statement OK. Without the space I would get the following errors:

error C2146: syntax error : missing ',' before identifier 'Stts' 
error C2654: 'OLPkrStts' : attempt to access member outside a member function
error C2143: syntax error : missing '>' before ';'
Louie Mayo
  • 349
  • 1
  • 4

0 Answers0