From: Erez Haba Date: January 18, 2008 7:00:55 PM CST To: "mpi-21@mpi-forum.org" Subject: RE: [mpi-21] const MPI C++ handles Reply-To: mpi-21@XXXXXXXXXXXXX > Just trying to be cautious: would there ever be a reason to have a > non- > const version of the Set_* functions? Yes, if the impl caches info in its own objects and change it when the Set_* function is called. (but then it can use the mutable keyword :)) Thanks, .Erez -----Original Message----- From: owner-mpi-21@XXXXXXXXXXXXX On Behalf Of Jeff Squyres Sent: Friday, January 18, 2008 11:19 AM To: mpi-21@XXXXXXXXXXXXX Subject: Re: [mpi-21] const MPI C++ handles On Jan 18, 2008, at 2:11 PM, Erez Haba wrote: > I looked up this issue and did not find a C++ *standard* that spans > that many platforms and compilers. > > The ISO C++ 98 standard itself does have libraries, but they provide > the headers which are less ambiguous. (including various const > values (like INT_MAX)) (think ABI :)) Hah! Surely you're not implying that C++ compilers produce code that is ABI-compatible with other C++ compilers? :-D > I agree that we'll need to enable the recommendation in the standard > interface. We'll need to agree that the semantic of changing the > underlying MPI handle is not changing the object (and thus can > define the method as const). > > I don't think you'll need an overloaded function for the Set_* > functions; const methods are good for non const objects. Good point -- a const method will match a corresponding non-const (*this). Just trying to be cautious: would there ever be a reason to have a non- const version of the Set_* functions? -- Jeff Squyres Cisco Systems