[C++-sig] How to check if object is of specific type?

Marcus Jannes jannes80 at hotmail.de
Tue Feb 19 16:05:19 CET 2008


Thank you, exactly what i needed :-)


----------------------------------------
> Date: Tue, 19 Feb 2008 09:25:27 -0500
> From: seefeld at sympatico.ca
> To: c++-sig at python.org
> Subject: Re: [C++-sig] How to check if object is of specific type?
> 
> Marcus Jannes wrote:
>> Hello,
>> 
>> I want to do something similar to the PyObject_TypeCheck() in boost.python. How can i check the type of an object that is passed to a function?
> 
> object o = ...;
> extract e(o);
> if (e.check())
> {
>    expected_type a = e();
>    // now use 'a'
> }
> 
> HTH,
> 		Stefan
> 
> -- 
> 
>        ...ich hab' noch einen Koffer in Berlin...
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig

_________________________________________________________________
Neu: Internet Explorer 7 optimiert für MSN!
http://optimize.de.msn.com/default.aspx?mkt=de-de


More information about the Cplusplus-sig mailing list