Intersting C++ error message.

Kevin Atkinson kevinatk@home.com
Wed Aug 25 22:34:00 GMT 1999


skip-t.hh:44: warning: choosing `clone_ptr<FilterItrPart>::operator
FilterItrPart *()' over `clone_ptr<FilterItrPart>::operator const
FilterItrPart *() const'
skip-t.hh:44: warning:   for conversion from `clone_ptr<FilterItrPart>'
to `const FilterItrPart *'
skip-t.hh:44: warning:   because conversion sequence for the argument is
better

Doing so is harmless as the offending methods are.

  operator Class * () {return ptr;}
  operator const Class * () const {return ptr;}

But, I would like to know:

1) Why does it chose the nonconst method over the const one?
2) Sense this is harmless is there any way to suppress the warning?
- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/


More information about the Gcc mailing list