🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: implicit pointer of pointer argument promotion legal C++?

#10
From: mccauleyba
Date: Thu, 29 Oct 1992 19:55
17 lines
1439 bytes
In article <23999@alice.att.com>, ark@alice.att.com (Andrew Koenig) writes:
> 
> Incidentally, I conjecture that conversion from T** to const T * const *
> (pointer to constant pointer to constant T) is always safe,
> but I don't have a proof.

There is another point that follows from all this when considering function
pointers. The current standard does not allow any promotion of function
pointers but can anyone say definitively if something like...

int strcmp(const char*,const char*);
int (*p)(char *,char*) = strcmp;

... could be safely allowed.

I can see no hazard in permitting conversion from (*)(const T*) to (*)(T*)
but then I hadn't seen the danger of converting T** to const T**.
Technical Details
Message-ID: <1992Oct29.195546.1@vax1.bham.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!uknet!news.cs.bham.ac.uk!bham!bhamvx!mccauleyba
References: <1992Oct8.162653.12028@urbana.mcd.mot.com> <23842@alice.att.com> <23849@alice.att.com> <1992Oct15.222018.16565@urbana.mcd.mot.com> <23922@alice.att.com> <1992Oct22.212802.839@urbana.mcd.mot.com> <23999@alice.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!uknet!news.cs.bham.ac.uk!bham!bhamvx!mccauleyba
From: mccauleyba@vax1.bham.ac.uk
Newsgroups: comp.std.c++
Subject: Re: implicit pointer of pointer argument promotion legal C++?
Message-ID: <1992Oct29.195546.1@vax1.bham.ac.uk>
Date: 29 Oct 92 19:55:46 GMT
References: <1992Oct8.162653.12028@urbana.mcd.mot.com> <23842@alice.att.com> <23849@alice.att.com> <1992Oct15.222018.16565@urbana.mcd.mot.com> <23922@alice.att.com> <1992Oct22.212802.839@urbana.mcd.mot.com> <23999@alice.att.com>
Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
Organization: University of Birmingham
Lines: 17