Page 1 of 1

template members in eVC3

PostPosted: Jul 11, 2003 @ 12:04am
by v0101

PostPosted: Jul 11, 2003 @ 8:05am
by Velo

PostPosted: Jul 11, 2003 @ 3:52pm
by angedelamort

PostPosted: Jul 11, 2003 @ 7:01pm
by v0101

PostPosted: Jul 12, 2003 @ 12:15am
by Pejo Software - Per

PostPosted: Jul 12, 2003 @ 12:41am
by Guest
Thank you so much PejoSoftware! It works perfectly now on both compilers.

I got my syntax in my first post from a book called "C++ Template: The Complete Guide" by Vandevoorde and Josuttis.

By the way, you can do this
list<vector<int>>
you just need spaces between vector and list
list< vector<int> >

PostPosted: Jul 12, 2003 @ 12:53am
by Pejo Software - Per

PostPosted: Jul 12, 2003 @ 1:32am
by Kzinti

PostPosted: Jul 12, 2003 @ 10:13am
by Pejo Software - Per

PostPosted: Jul 13, 2003 @ 3:53am
by damian

PostPosted: Jul 13, 2003 @ 4:44am
by Kzinti
The holy standard specifies that parsing should eat as many characters as possible when generating tokens. "<" is parsed as a "<" token. ">>" is parsed as a ">>" token.

Later on, the sementic analyser will differentiate "<" used in a template syntax from an operator "<". It can do so using the context.

When the sementic analyser see ">>" it is already too late. ">>" will then be interpreted as an operator as there is no other possibility. The sementic phase is not allowed to split the token into ">" + ">".

Any compiler that doesn't work that way is not standard compliant. It is a really known "problem", just live with it.