llancet has asked for the wisdom of the Perl Monks concerning the following question:
$var = INT2PTR(MyClass*, SvIV(SvRV($arg)));
When the object address is set into SV in descendant method wrapper, and is extracted in parent method wrapper, the address of the parent object will always same with the address of the descendant object. However, in some C++ cases, the address of an parent object is different from the address of the object itself. So the address may be incorrect.
How can I process such issue? It seems RTTI must be used, as the type need to be casted at run time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perlxs and C++ inheritance
by Anonymous Monk on Apr 22, 2014 at 09:40 UTC | |
by llancet (Friar) on Apr 24, 2014 at 09:13 UTC | |
by Anonymous Monk on Apr 24, 2014 at 09:51 UTC | |
by llancet (Friar) on May 04, 2014 at 03:05 UTC |