Re: Gtkmm: gratitude and suggestions



Murray Cumming wrote:

       > About const functions: widgets are non-constant objects by
       their nature.
       > They can change by outside events, like DND. Aren't these
const > functions "misconcept" api and bloat documentation? const means whatever you choose it to mean. Most get functions
       don't
       change any state of the object whatsoever, so they should
       obviously be
       const.

But you still have to have non-const counterparts because widgets
usually (always in most gui code) are not const objects.

There is no problem with calling a const method on a non-const object.

Murray


Hmm... Those non-const "counterparts" are needed only for getter functions which return somehow "tied" objects which should be as const as widget itself (for example Label::get_layout). Right?

Ok, API is good (I especially like the ability to have widgets as class members), my suggestions were cosmetical.

Maxim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]