Received: from store.z.zembu.com (nat.zembu.com [209.128.96.253]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4MKZ0A70491 for ; Tue, 22 May 2001 16:35:00 -0400 (EDT) (envelope-from ncm@zembu.com) Received: by store.z.zembu.com (Postfix, from userid 509) id B7582FDFB; Tue, 22 May 2001 13:34:58 -0700 (PDT) Date: Tue, 22 May 2001 13:34:58 -0700 To: pgsql-hackers@postgresql.org Subject: Re: C++ Headers Message-ID: <20010522133458.H18121@store.zembu.com> Reply-To: pgsql-hackers@postgresql.org References: <3B08D94D.AE828050@petig-baender.de> <200105220419.f4M4JfQ29720@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105220419.f4M4JfQ29720@candle.pha.pa.us>; from pgman@candle.pha.pa.us on Tue, May 22, 2001 at 12:19:41AM -0400 From: ncm@zembu.com (Nathan Myers) X-Archive-Number: 200105/948 X-Sequence-Number: 9222 On Tue, May 22, 2001 at 12:19:41AM -0400, Bruce Momjian wrote: > > This in fact has happened within ECPG. But since sizeof(bool) is passed to > > libecpg it was possible to figure out which 'bool' is requested. > > > > Another issue of C++ compatibility would be cleaning up the usage of > > 'const' declarations. C++ is really strict about 'const'ness. But I don't > > know whether postgres' internal headers would need such a cleanup. (I > > suspect that in ecpg there is an oddity left with respect to host variable > > declaration. I'll check that later) > > We have added more const-ness to libpq++ for 7.2. Breaking link compatibility without bumping the major version number on the library seems to me serious no-no. To const-ify member functions without breaking link compatibility, you have to add another, overloaded member that is const, and turn the non-const function into a wrapper. For example: void Foo::bar() { ... } // existing interface becomes void Foo::bar() { ((const Foo*)this)->bar(); } void Foo::bar() const { ... } Nathan Myers ncm@zembu.com