This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Intersting C++ error message.


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]