home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: Nested Templates in g++
- Message-ID: <1992Nov23.233331.5003@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Nov23.045517.10090@pasteur.Berkeley.EDU> <1992Nov23.061246.113768@watson.ibm.com>
- Date: Mon, 23 Nov 1992 23:33:31 GMT
- Lines: 25
-
- magerman@watson.ibm.com (David Magerman;046923) writes:
-
-
- >Using the xlC++ 1.1.1, trying to
- >refer to B<A<X,Y>> generates a syntax error, because the compiler
- >tries to interpret the >> as an operator. If I use B<A<X,Y> >, it
- >compiles and runs fine.
-
- >However, since you're using g++, this might be irrelevant. (Could two
- >independently written compilers have the same stupid error?)
-
- This is not a compiler error, but the way the language is defined.
-
- In the initial phases of translation of the C++ source program, the
- source is broken up into tokens. A token is the longest sequence
- of characters which could be a token.
-
- In the example above, the sequence ">>" is taken to be the single token
- ">>" and never as the two tokens "> >", no matter what the context.
-
- This concept is not new in C or C++, and appears in K&R1.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-