🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #14

Re: C++ comment on warnings about overloaded functions (Bug?)

#14
From: Andy Dent
Date: Thu, 19 Oct 1995 13:42
36 lines
1706 bytes
In article <julian-1810951406510001@julian.cs.auckland.ac.nz>,
julian@cs.auckland.ac.nz (Julian Harris) wrote:

>Type: gotcha :)
Agreed - a warning would be nice
>
>Take this code below. The subclassed virtual function omits the 'const'.
>This appears to MW C++ as a new overloaded function 

>Could I suggest that when the
>return type differs only in 'const' that this could be flagged as a
>warning as well?

You're confusing things here. The const after the function parameters has
nothing to do with the return type. Each method has an implied first
parameter of 'this' so const has the effect:

void someClass::A(int b) 
can be read as (parameter-wise)
void  A(someClass&, int b)


so 
void someClass::A(int b) const 
varies in the first parameter
void  A(const someClass&, int b)


IN GENERAL, CodeWarrior 1.3 seems a bit shaky when the only difference
between parameters is constness. (When I've time to produce a clear bug
report I will.)

Andy Dent, Product Architect, A.D. Software, Western Australia
OOFILE - "the cross-platform OODBMS that speaks c++"
ftp://ftp.highway1.com.au/pub/adsoftware/oofile/
http://www.highway1.com.au/adsoftware/oofile.html
Technical Details
Message-ID: <dent-1910952142310001@adsoftware.highway1.com.au>
Path: arc1-ca.pugleaf.net!adsoftware.highway1.com.au!user
References: <julian-1810951406510001@julian.cs.auckland.ac.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!adsoftware.highway1.com.au!user
From: dent@highway1.com.au (Andy Dent)
Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++
Subject: Re: C++ comment on warnings about overloaded functions (Bug?)
Date: Thu, 19 Oct 1995 21:42:31 +0800
Organization: A.D. Software
Message-ID: <dent-1910952142310001@adsoftware.highway1.com.au>
References: <julian-1810951406510001@julian.cs.auckland.ac.nz>
NNTP-Posting-Host: adsoftware.highway1.com.au
X-Newsreader: Value-Added NewsWatcher 2.0b27+