From koffice Sat Jul 22 22:49:01 2000 From: David Faure Date: Sat, 22 Jul 2000 22:49:01 +0000 To: koffice Subject: Re: CPP Q X-MARC-Message: https://marc.info/?l=koffice&m=96430638629817 On Sat, 22 Jul 2000, Thomas Zander wrote : >Can anyone tell me what my compiler means (egcs) ? > >kword_frame.cc:2070: warning: passing `const KWGroupManager' as `this' > argument of `struct KWGroupManager::Cell * KWGroupManager::getCell(int)' > discards const > >method: >KWGroupManager::KWGroupManager( const KWGroupManager &original ) >line 2070: > if(original.getCell(i)) { Well, the compiler is right: you are calling a non-const method on a const object. If getCell doesn't modify the object (given the name, I guess it doesn't), then add "const" in the definition of the getCell method, _after_ the parameter list, both in the .h and in the .cc A good C++ book would help :-) -- David FAURE, david@mandrakesoft.com, faure@kde.org http://home.clara.net/faure/, http://www.konqueror.org/ KDE, Making The Future of Computing Available Today See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2