🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1097

Re: Operator -> cannot return non-class types?

#1097
From: Steve Clamage
Date: Sat, 14 Nov 1992 22:03
18 lines
1102 bytes
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
Technical Details
Message-ID: <1992Nov14.220318.13570@taumet.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!taumet!steve
References: <1992Nov11.092316.306@aut.abb.se> <1992Nov11.184341.1@vax1.bham.ac.uk> <KANZE.92Nov13191617@slsvhat.us-es.sel.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++,comp.lang.c++
Path: arc1-ca.pugleaf.net!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