rblondeau
Tomato Guru
Canada
102 Posts |
Posted - Oct 05 2004 : 1:36:20 PM
|
Currently when we type a < (less than symbol), no corresponding > (greater than symbol) is automatically inserted with the caret left between the two. It would be nice but that is ok.
What would be nice though, is if the parser recognizes that you are defining a template object variable, that it would add spaces between the < > and the type. This is because sometimes not putting spaces between these characters causes compiler errors. Normally it's when there are multiple closing > characters.
For example, both of these would work: vector<int> MyVar; vector< int > MyVar;
But in a more complex declaration, map<long, vector<string>> MyVar;
the >> would be interpreted as the >> stream operator and would give the following error message:
error C2947: expecting '>' to terminate template-argument-list, found '>>'
For that reason it should be declared with spaces: map< long, vector< string > > MyVar;
|
|