Thread: 3D vector

  1. #16
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248
    [Note that this is in that case a bug in the compiler, really]
    The standard says the following:
    3 After name lookup (3.4) finds that a name is a template-name, if this name is followed by a <, the < is
    always taken as the beginning of a template-argument-list and never as a name followed by the less-than
    operator. When parsing a template-id, the first non-nested > is taken as the end of the template argument- list rather than a greater-than operator. [Example:
    Code:
    template<int i> class X { /* ... */ };
    X< 1>2 > x1; // syntax error
    X<(1>2)> x2; // OK
    template<class T> class Y { /* ... */ };
    Y< X<1> > x3; // OK
    Y<X<6>> 1> > x4; // OK: Y< X< (6>>1) > >     <----------
    This does not concern the shift operator, but it (line <-------) seems to indicate that the end of two nested templates must be separated by a blank space..

    ps: how do I color a line in my thread?
    Last edited by MarkZWEERS; 07-24-2008 at 02:08 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  2. syntax help?
    By scoobygoo in forum C++ Programming
    Replies: 1
    Last Post: 08-07-2007, 10:38 AM
  3. Certain functions
    By Lurker in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2003, 01:26 AM
  4. My 3D Vector class
    By Lurker in forum C++ Programming
    Replies: 105
    Last Post: 11-16-2003, 05:58 PM
  5. Operators for 3D Vector Mathematics
    By Anarchist in forum C++ Programming
    Replies: 10
    Last Post: 01-31-2003, 07:33 PM