Need encouraging...

Steven Schveighoffer schveiguy at yahoo.com
Thu Oct 4 06:40:50 PDT 2007


"Arlen Albert Keshabyan" wrote
> Bill Baxter Wrote:
>
>> If you're patient enough to translate 150,000 lines of code to D then
>> maybe you can be patient enough to take just a few moments to explain to
>> us how JUCE uses multiple inheritance.
>>
>> --bb
>
> ...most of the time, JUCE uses multiple inheritance to add a 'listener' 
> type to your class. If you want to listen to any specific events then you 
> may inherit from several listener classes to get all that listener types 
> within your class. Then you may pass your class pointer to other classes 
> that expect one of your inherited listener type to let you receive desired 
> events (virtual functions).

Do the listener types have any implementation?  If not, you can code them as 
interfaces, and you don't need multiple inheritance.  The JUCE project may 
have used multiple inheritance to emulate interfaces because interfaces are 
not available with C++. 





More information about the Digitalmars-d mailing list