home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.std.c++:1572 comp.lang.c++:16355
- Newsgroups: comp.std.c++,comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: Operator -> cannot return non-class types?
- Message-ID: <1992Nov14.220318.13570@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Nov11.092316.306@aut.abb.se> <1992Nov11.184341.1@vax1.bham.ac.uk> <KANZE.92Nov13191617@slsvhat.us-es.sel.de>
- Date: Sat, 14 Nov 1992 22:03:18 GMT
- Lines: 18
-
- kanze@us-es.sel.de (James Kanze) writes:
-
- >Basically, I don't offhand see anything in the language definition
- >that would restrict an operator->() (the function) from returning
- >whatever it wishes. On the other hand, there is no way to use this
- >operator *unless* it returns a pointer to a class.
-
- ARM 13.4.6:
-
- "... operator->() must return either a pointer to a class or an object
- of or a reference to a class for which operator->() is defined."
-
- That seems pretty clear. The compiler was correct to reject a
- declaration with any other sort of return type.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-