Issue 5854: 1.16.3 Extraction from any (cxx_revision) Source: (, ) Nature: Revision Severity: Minor Summary: The question is about 99-07-41.pdf, as far as I know the latest C++ mapping specification. "1.41.5 Any Class" prescribes "Boolean operator>>=(const Any&, const char*&);" for unbounded strings, and "1.16.3 Extraction from any" says that unbounded strings are extracted by value. This seems to be contradictory: I seem to remember that const char* cannot be delete'd, though I don't find it in ISO/IEC 14882:1998(E). But, regardless of anything imposed by C++, the current mapping precludes a safe technique like (safe as in exception-proof): >> String_var theString; if(!(theAny>>=theString.out())){ ... } << I therefore propose that the mapping be changed to "Boolean operator>>=(const Any&, char*&);". This seems to work all right on my implementation (RayORB), for gcc 3.2 (MS VC++ 6.0 doesn't seem to care one way or the other, but I suppose that is wrong, although I'm not entirely sure). Resolution: Revised Text: Actions taken: February 10, 2003: received issue Discussion: deferred in June 2011 to the next RTF End of Annotations:===== From: webmaster@omg.org Date: 10 Feb 2003 09:08:37 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Raf Schietekat Company: Connox N.V. mailFrom: Raf_Schietekat@ieee.org Notification: Yes Specification: C++ Language Mapping Specification Section: 1.16.3 Extraction from any FormalNumber: 99-07-41 Version: June 1999 RevisionDate: 06/01/99 Page: 1-55 Nature: Revision Severity: Minor HTTP User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 Description The question is about 99-07-41.pdf, as far as I know the latest C++ mapping specification. "1.41.5 Any Class" prescribes "Boolean operator>>=(const Any&, const char*&);" for unbounded strings, and "1.16.3 Extraction from any" says that unbounded strings are extracted by value. This seems to be contradictory: I seem to remember that const char* cannot be delete'd, though I don't find it in ISO/IEC 14882:1998(E). But, regardless of anything imposed by C++, the current mapping precludes a safe technique like (safe as in exception-proof): >> String_var theString; if(!(theAny>>=theString.out())){ ... } << I therefore propose that the mapping be changed to "Boolean operator>>=(const Any&, char*&);". This seems to work all right on my implementation (RayORB), for gcc 3.2 (MS VC++ 6.0 doesn't seem to care one way or the other, but I suppose that is wrong, although I'm not entirely sure). Date: Tue, 25 Feb 2003 08:03:00 +1000 (EST) From: Michi Henning X-X-Sender: michi@diadora.client.uq.net.au Reply-To: Michi Henning To: Juergen Boldt cc: "cxx_revision@omg.org" , Subject: Re: issue 5854 -- C++ RTF issue Organization: Triodia Technologies On Mon, 24 Feb 2003, Juergen Boldt wrote: > 1.16.3 Extraction from any > > The question is about 99-07-41.pdf, as far as I know the latest C++ >mapping > specification. "1.41.5 Any Class" prescribes "Boolean >operator>>=(const > Any&, const char*&);" for unbounded strings, and "1.16.3 Extraction >from > any" says that unbounded strings are extracted by value. This seems >to be > contradictory: I seem to remember that const char* cannot be >delete'd, > though I don't find it in ISO/IEC 14882:1998(E). It used to be that way in classic C++. In standard C++, calling delete on a const char * is legal. > But, regardless of > anything imposed by C++, the current mapping precludes a safe > technique > like (safe as in exception-proof): >> String_var theString; > if(!(theAny>>=theString.out())){ ... } << I therefore propose that > the > mapping be changed to "Boolean operator>>=(const Any&, > char*&);". This > seems to work all right on my implementation (RayORB), for gcc 3.2 > (MS VC++ > 6.0 doesn't seem to care one way or the other, but I suppose that is > wrong, > although I'm not entirely sure). I don't think making this change would be possible -- it would break hundreds or thousands of existing programs. Cheers, Michi. -- Michi Henning Ph: +61 4 1118-2700 Triodia Technologies http://www.triodia.com/staff/mich