I have this function:
int SOMECLASS::ADDTABLE(const DBTABLE* old)// both classes (SOMECLASS &
ADDTABLE) are __gc classes
{
old->GetName(); //<-- ERROR: 'GetName' cannot convert 'this' pointer
from 'const DBTABLE' to 'DBTABLE __gc &' Conversion loses qualifiers
//blah,blah....
}
If I remove the const modifier it compiles fine, however I don't want to
remove it. How can I get around this error?
Thank You
josh
Nadav - 04 Oct 2004 12:55 GMT
You can use 'const_cast' but this will be the same as removing the const
definition of the ;old; parameter.
> I have this function:
>
[quoted text clipped - 11 lines]
> Thank You
> josh
Jack Hanebach - 05 Oct 2004 18:59 GMT
> int SOMECLASS::ADDTABLE(const DBTABLE* old)// both classes (SOMECLASS
> & ADDTABLE) are __gc classes
[quoted text clipped - 6 lines]
> If I remove the const modifier it compiles fine, however I don't want
> to remove it. How can I get around this error
declare GetName() as const method of DBTABLE. (if you have access to
the source code, that is)