Matthias Melcher schrieb:
>
> On 04.05.2012, at 15:30, Edzard Egberts wrote:
>> Is it necessary, that a group is a widget? What do you think of
>> this:
>>
>> class Fl_Group: public Fl_Widget, public Fl_Basic_Group
>>
>> class Fl_Composed_Widget: public Fl_Input, public Fl_Basic_Group
>>
>> The approach is not to derive, but to assemble.
>
> Multiple inheritance in C++? You are a brave brave man ;-).
Really? I'm using it extensive, is there a problem? I don't like to copy
code and this is a way, to code it once, but use it often. The other way
would be to use an object:
class Fl_Group: public Fl_Widget
{
Fl_Basic_Group manage;
}
> We use quite a lot of pointer casting the old way, which can break multiple
> inheritance quite easily.
You mean, the "this" pointer will be casted to a slice? Normally not
when you are casting to (void*).
> And then there is the diamond inheritance issue... .
I don't think so, because I started to ask "Is it necessary, that a
group is a widget?". Fl_Basic_Group is not a widget, so I can't see the
diamond. To me it's the same like adding an additional object, just more
easy to access.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev