home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!allegra!alice!bs
- From: bs@alice.att.com (Bjarne Stroustrup)
- Newsgroups: comp.lang.c++
- Subject: Re: About class template names
- Message-ID: <24568@alice.att.com>
- Date: 7 Jan 93 16:01:42 GMT
- Article-I.D.: alice.24568
- References: <C0H9sA.BGw@newsserver.technet.sg>
- Organization: AT&T Bell Laboratories, Murray Hill NJ
- Lines: 24
-
-
-
- arthur@solomon.technet.sg (Arthur Sombrito) writes
-
- > Hi,
- >
- > According to the ARM, a class template name must be unique in a program
- > and may not be declared to refer to any other template, class, function,
- > object, value, or type in the same scope.
- >
- > Does this mean that a name previously used as a class template name
- > can't be reused in another scope? For example:
- >
- > template <class T> class U {};
- > enum U {}; // This should be an error. I am wondering why GNU
- // and Borland accepted this.
-
- They shouldn't accept it.
-
- > f() {
- > union U {}; // So is this an error?
- > }
-
- No. That's OK. U is not in the global scope and hides the global U within f().
-