=?UTF-8?B?QWxpIMOHZWhyZWxp?= wrote:
a virtual function like accept() can do the trick
This would require changes in the whole class hierarchy.
But because of
The actual type of the object is implicitly stored in the
vtbl of each type.
and in addition, because the statement
| writeln(
class C{}
class C1:C{}
// ...
class Cn:C{}
C getC(){ return new Cn;} // might be extern
// and deliver some Ci
void visit( C1 fp){}
// ...
void visit( Cn fp){}
void main(){
visit( getC); // dispatch?
}
-manfred
On 10/14/2013 02:09 PM, Manfred Nowak wrote:
class C{}
class C1:C{}
// ...
class Cn:C{}
C getC(){ return new Cn;} // might be extern
// and deliver some Ci
void visit( C1 fp){}
// ...
void visit( Cn fp){}
void main(){
visit( getC); //