Menu ▾ ▴

#13 Overloaded methods with const parameters

v3.5.0
open
nobody
5
2001-08-24
2001-08-24
No

Paul Kierstead on Fri, 2 Jul 1999 12:37:58 -0400

Sorry if this is a repeat, but I am new to the
list and I didn't see it in the archives.

Enviroment:
- WinNT 4.0 SP5
- ActivePerl 5.005_03

Bug: Two (or more) methods with the same name but
slightly different parameters get their comments
merged and lose all methods but the last one
(duplicating it for the others). In particular,
the parameters must be 'const'.

For example:
//: C1
// Comment 1
int operator-(const A& a, const B& b);

//: C2
// Comment 2
int operator-\(const C& a, const D& b\);

results in (using template in example 2):

int operator-(const C& a, const D& b)

C1C2
Comment 1 Comment 2
----------------------------------------------------------------------------
----

int operator-(const C& a, const D& b)

C1C2
Comment 1 Comment 2

This seems to be because the mangling algorithm
considers the type to be 'const' making it look
like the same method, i.e the bookmark is
#SampleClass_operator__constconst__

Discussion


Log in to post a comment.