views:

356

answers:

3

Hi,

which boost library should I use to implement RTTI in my project?? Is it Statechart library?

Thanks and Regards, Jabez.

+6  A: 

RTTI is built into the C++ language, with features like dynamic_cast and typeid. You don't need boost to use it.

Terry Mahaffey
+1  A: 

A simple RTTI is built into the C++ language, although you can opt out of it (decreases binary size). You can read about RTTI in C++ here.

If you're searching for something more robust (e.g. Reflection) unfortunately there's no simple solution for that, but it's planned for after-C++0x. There was a Reflection library suggested for Boost, but it hasn't been accepted (yet?). You can find it here : http://boost-extension.blogspot.com/

Kornel Kisielewicz
+3  A: 

RTTI is built into the C++ language. However, you'll find a few RTTI-related, convenient tools in Boost, e.g. Boost.TypeTraits which enables you to checks such as is_base_of(), has_trivial_constructor() and loads of other stuff. Boost.FunctionTypes might also be worth checking out.

larsm