home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / std / cplus / 1572 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  1.1 KB

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