On 15/11/2013 14:31, Antony Polukhin wrote:
type_info::construct<T>() works with the type T, while boost::type_id_rtti_only(variable) attempts to determinate the real type of variable.
OK, I see, thank you. Do you think getting the type info of the "current" type of a variable (as opposed to it's real type) could sometimes prove useful ? Could it be worth adding a function in TypeIndex ? Also using a local type as a template argument is illegal in C++03 (not in C++11 any more). For instance : void f() { struct s {}; boost::type_id< s >(); // illegal in C++03 typeid( s ); // legal } Maybe it should be stated in the documentation as this is an area where boost::type_id is not a drop-in replacement for typeid (in C++03) ? Cheers, MAT.