Re: [gtkmm] gtkmm 2.4 questions



Hello!

From the user's perspective, if a method may be reasonably called upon a constant object, it should be declared const. Whether it actually changes the internal state is irrelevant; if it appears that it does not, then const it should be. That's what mutable is for, as has been mentioned.

Then I don't see the difference against making all objects and methods constant and declare all member data mutable.

But to be honest, I never really understand for what mutable was introduced. I read the chapter about mutable in Stroustroup several times with getting the point.

It's not good style, but had your code been written for gtkmm 2.4 to start with, you would no doubt have developed a more elegant solution.

Maybe. But for dynamically calulated content I don't see a solution yet. Maybe there is a better solution for my problem now (I render directly from an internal and rather complex data structure the treeview; it's the wanted behaviour to recalculate the content every time a redraw is done; this was elegant to implement with a own specialized CellRenderer).

I'm with Murray on it being right to have get_size_vfunc be const though.

Then my question, why is get_size_vfunc const? What's the difference compared to render_vfunc for example?


Regards,
Frank



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