home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18522 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  1.3 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!foucault.berkeley.edu!jbuck
  2. From: jbuck@foucault.berkeley.edu (Joe Buck)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: template disappointments ... (suggestions?)
  5. Date: 29 Dec 1992 23:36:06 GMT
  6. Organization: U. C. Berkeley
  7. Lines: 21
  8. Distribution: world
  9. Message-ID: <1hqnd6INNe83@agate.berkeley.edu>
  10. References: <DSCHIEB.92Dec29133556@muse.cv.nrao.edu> <24508@alice.att.com>
  11. NNTP-Posting-Host: foucault.berkeley.edu
  12.  
  13. In article <24508@alice.att.com> ark@alice.UUCP () writes:
  14. >In article <DSCHIEB.92Dec29133556@muse.cv.nrao.edu> dschieb@muse.cv.nrao.edu (Darrell Schiebel) writes:
  15. >>         list<vector<int>> list_vec_int;
  16. >
  17. >Huh?? This works fine -- just remember to put a space between the
  18. >two > characters so the >> won't be taken for a shift-right symbol.
  19.  
  20. This is such a common error (and is so ugly) that compiler writers
  21. would be well advised to add productions to their grammar that catch
  22. it, or magic that splits the >> token into two tokens in this case
  23. if that fits in with the compiler's structure.
  24.  
  25. Yes, I know that the rules of lexical analysis force the >> to be one
  26. token, but list<vector<int>> is a perfectly natural way of writing
  27. this thing, so perhaps it should be permitted even at the cost of
  28. adding an ugly rule to the grammar.
  29.  
  30.  
  31.  
  32. --
  33. Joe Buck    jbuck@ohm.berkeley.edu
  34.