Topic: Is 'Result (*)(Arg) fp;' a legal declaration?
Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Sun, 25 Sep 1994 03:07:47 GMT Raw View
In article <35nhl1$pl0@trixie.rtpnc.epa.gov> plessel@vislab.epa.gov writes:
>
>
>I ran across this declaration in STL:
> Result (*)(Arg) fp;
If that's supposed to be a declaration, I don't think it's a valid one.
>assuming it means the same as:
> Result (*fp)(Arg);
I don't think the two are equivalent.
>Is it (or will it be) legal ANSI C++?
I don't believe so. I think the first one (above) is a syntax error.
>(The SGI Delta compiler doesn't accept it.)
OK. So now we've heard from SGI and RFG. Would any more of you three
letter acronyms out there like to chime in? :-)
--
-- Ron Guilmette, Sunnyvale, CA ---------- RG Consulting -------------------
---- domain addr: rfg@netcom.com ----------- Purveyors of Compiler Test ----
---- uucp addr: ...!uunet!netcom!rfg ------- Suites and Bullet-Proof Shoes -
Author: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Date: Mon, 26 Sep 1994 01:10:12 GMT Raw View
rfg@netcom.com (Ronald F. Guilmette) writes:
>plessel@vislab.epa.gov writes:
>>
>>I ran across this declaration in STL:
>> Result (*)(Arg) fp;
>
>If that's supposed to be a declaration, I don't think it's a valid one.
>
>>(The SGI Delta compiler doesn't accept it.)
>
>OK. So now we've heard from SGI and RFG. Would any more of you three
>letter acronyms out there like to chime in? :-)
I agree with SGI and RFG, the declaration is a syntax error.
FJH. ;-)
--
Fergus Henderson - fjh@munta.cs.mu.oz.au
Author: pkron@corona.com (Peter Kron)
Date: Mon, 26 Sep 1994 20:07:25 PDT Raw View
From: plessel@oz.rtpnc.epa.gov (Todd Plessel)
> I ran across this declaration in STL:
> Result (*)(Arg) fp;
> assuming it means the same as:
> Result (*fp)(Arg);
> Is it (or will it be) legal ANSI C++?
> (The SGI Delta compiler doesn't accept it.)
It is illegal, although the following is legal:
void fp1();
Result (*fp2)(Arg) = (Result (*)(Arg))fp1;
---
NeXTMail:peter.kron@corona.com
Corona Design, Inc.
P.O. Box 51022
Seattle, WA 98115-1022
Author: plessel@oz.rtpnc.epa.gov (Todd Plessel)
Date: 20 Sep 1994 20:45:21 GMT Raw View
I ran across this declaration in STL:
Result (*)(Arg) fp;
assuming it means the same as:
Result (*fp)(Arg);
Is it (or will it be) legal ANSI C++?
(The SGI Delta compiler doesn't accept it.)
Thanks.
Todd