http://qs321.pair.com?node_id=389071


in reply to Re: Terrible Trouble With Typemaps (XS Question)
in thread Terrible Trouble With Typemaps (XS Question)

Thanks for the help, to be honest I didn't consider the preprocessor since I tend to avoid it as much as possible in the interests of readability.. but in this case it may have a use.

Just so you know, it will be more a case of:

int MyClass::countItemsIn (...) CODE: if (SV_IS_MYLIST(ST(0))) { THIS->countItemsIn ( CAST_SV_TO_MYLIST(ST(0)) ); } elsif (SV_IS_MYHASH(ST(0)) { THIS->countItemsIn ( CAST_SV_TO_MYHASH(ST(0)) ); }; OUTPUT: RETVAL

..where the SV_IS_MYLIST/CAST_SV_TO_MYLIST parts are all macros.