Issue 781: C++ mapping for IN object references (cxx_revision) Source: (, ) Nature: Uncategorized Issue Severity: Significant Summary: Summary: According to C++ mapping spec in the POA document (table 2, section 16.18.1) the signature for an object reference in argument should be "objref_ptr", not the more likely "const objref_ptr". this is an conflict with the convention for all other in args except numeric, and is in contrast with the table 3, that specifies "const objref_var&". Resolution: Duplicate of issue 188 - closed Revised Text: Actions taken: November 19, 1997: received issue November 25, 1997: moved to cxx_revision February 19, 1999: closed issue Discussion: closed issue End of Annotations:===== Return-Path: Date: Wed, 19 Nov 1997 14:58:30 -0500 From: Paul H Kyzivat Organization: NobleNet To: issues@omg.org Subject: C++ mapping for IN object references According to the C++ mapping spec in the POA document (Table 2, section 16.18.1) the signature for an object reference in argument should be "objref_ptr", not the more likely "const objref_ptr". This is in conflict with the convention for all other in args except numerics, and is in contrast with the table 3, that specifies "const objref_var&". This means that objref_var.in() must yield a non-const objref_ptr, even for const vars, which is counterintuitive at best. This means that the ability to use compiler diagnostics to catch errors is reduced. Is this a mistake, or is it intended? And, is it normative? Return-Path: Sender: jon@biggar.org Date: Wed, 19 Nov 1997 18:16:22 -0800 From: Jonathan Biggar To: Paul H Kyzivat CC: issues@omg.org Subject: Re: C++ mapping for IN object references References: <347344E6.93699216@noblenet.com> Paul H Kyzivat wrote: > According to the C++ mapping spec in the POA document (Table 2, section > 16.18.1) the signature for an object reference in argument should be > "objref_ptr", not the more likely "const objref_ptr". This is in > conflict with the convention for all other in args except numerics, and > is in contrast with the table 3, that specifies "const objref_var&". > > This means that objref_var.in() must yield a non-const objref_ptr, even > for const vars, which is counterintuitive at best. > > This means that the ability to use compiler diagnostics to catch errors > is reduced. > > Is this a mistake, or is it intended? And, is it normative? This is no mistake and is as intended. The C++ mapping has assigned no meaning to a "const" object_ptr, because an object_ptr is not like a normal C++ pointer, and IDL has no concept of a "const" object either. If you think of an object_ptr like another built-in C++ type, like int, you will see that the const is unnecessary on an "in" parameter, because an "in" parameter is being passed by value, not by reference. Jon Biggar jon@biggar.org