[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]Overriding C++ virtual methods in C#
From: |
Gopal V |
Subject: |
Re: [DotGNU]Overriding C++ virtual methods in C# |
Date: |
Sat, 7 Dec 2002 01:16:16 +0530 |
User-agent: |
Mutt/1.2.5i |
If memory serves me right, Adam Treat wrote:
> void virtualMethod1()
> {
> virtualMethod1_Callback();
> }
>
> void virtualMethod2()
> {
> virtualMethod2_Callback();
> }
......
> Does this work?
I know it does ... but that doesn't put the point across ... you need
to override *each* virtual method for each class in this scenario ...
(Just comment out virtualMethod2 in SubWidget and try again...)
So this adds up to n classes x m virtual methods .... (equals a lot of
glue code)... almost 400 classes of code for this... which is as bad as
depending on QtC ? ..
This would work *even* in a multiple inheritance scenario ..... IMHO
this the "ugly but possible" way .... (overriding every method is a
way out of the ambiguity of the MI diamond).
But I guess we've reached a solution here ... cumbersome maybe, but a
workable solution still...
All I can say is that I tried my best to think up a "clean" and OO idea ,
but couldn't ... :-(
Gopal
--
The difference between insanity and genius is measured by success