home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18792 < prev    next >
Encoding:
Text File  |  1993-01-07  |  971 b   |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!wupost!udel!darwin.sura.net!jvnc.net!newsserver.jvnc.net!newsserver.technet.sg!arthur
  3. From: arthur@solomon.technet.sg (Arthur Sombrito)
  4. Subject: About class template names
  5. Message-ID: <C0H9sA.BGw@newsserver.technet.sg>
  6. Sender: news@newsserver.technet.sg
  7. Nntp-Posting-Host: solomon.technet.sg
  8. X-Newsreader: TIN [version 1.1 PL8]
  9. Date: Thu, 7 Jan 1993 09:45:44 GMT
  10. Lines: 17
  11.  
  12. Hi,
  13.  
  14. According to the ARM, a class template name must be unique in a program
  15. and may not be declared to refer to any other template, class, function,
  16. object, value, or type in the same scope.
  17.  
  18. Does this mean that a name previously used as a class template name
  19. can't be reused in another scope? For example:
  20.  
  21.    template <class T> class U {};
  22.    enum U {};    // This should be an error. I am wondering why GNU
  23.                  // and Borland accepted this.
  24.    f() {
  25.      union U {}; // So is this an error?
  26.    }
  27.  
  28. Thanks for any replies.
  29.