Re: [gtkmm] Slots from non-Gtk subclasses.



>> classes that use the same base class.  The classic "diamond" inheritance
>> tree shows what happens.
>>             A       A(1)    A(2)
>>            / \       \       /
>>           B   C       B     C
>>            \ /         \   /
>>             D            D
>>
>> If B & C didn't inherit virtually from A, then calling B::foo propagates
>> to A(1)::foo, while calling C::foo propagates to A(2)::foo.  So then
>> you've got two base classes (B & C) whose ancestors (A(1) & A(2)) are
>> easily in inconsistent states.  These bugs cause wierd behavior more
>> often than segfaults, and it's not always clear when debugging why
>> variables became inconsistent.
>
>A good compiler will catch this bug at compile time. I know gcc 3.2 catches 
>the bug.

and i can promise you that gcc2.9X does not. make of this what you will.

--p



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