Formal review request: TypeIndex library

Hi, I'd like to ask to add Boost.TypeIndex to review queue. Introduction TypeIndex is an extended C++11 type_index library, that * works with disabled RTTI * can store const-volatile-reference info about types (if user requested it) * has all the functionality of std::type_index * has portable across compilers and platforms functionality for getting demangled type names * works across modules/shared libraries * does not require C++11 to work Docs: http://apolukhin.github.com/type_index/index.html Git: https://github.com/apolukhin/type_index Sources (zipped): https://github.com/apolukhin/type_index/zipball/master Git contains `patched` folder with TypeIndex'ed (and untested) versions of some existing boost libraries (Boost.Any, Boost.Graph, Boost.Math, Boost.MSM, Boost.PropertyMap, Boost.PropertyTree). Those libraries now do not require RTTI to compile. More libraries could be added to this list. Previous threads (checking interest): * Is there interest in typeid(TYPE).name() like function that does not require RTTI http://lists.boost.org/Archives/boost/2012/05/193491.php * [boost] Is there interest in copyable type_info that does not require RTTI (was: Is there interest in typeid(TYPE).name() like function that does not require RTTI) http://lists.boost.org/Archives/boost/2012/05/193519.php * [boost] [type_index] C++03 implementation in boost? http://lists.boost.org/Archives/boost/2012/07/194627.php P.S.: Additional thanks to Agustín K-ballo Bergé for pointing out and fixing some bugs. P.P.S.: It would be great to schedule review to the end of September. -- Best regards, Antony Polukhin

Antony Polukhin wrote:
TypeIndex is an extended C++11 type_index library, that
* works with disabled RTTI * can store const-volatile-reference info about types (if user requested it) * has all the functionality of std::type_index * has portable across compilers and platforms functionality for getting demangled type names * works across modules/shared libraries * does not require C++11 to work
Is there a list of supported compilers in the doc? Currently, clang-3.1 is not supported. (On clang-3.1, `template_id_with_cvr<int const&>().name_demangled()` returns `const int &>::n() [T = const `.) Please note that, in general, clang does not recommend to use version checks, because the version number of clang is not consistent between the vendors. For example, LLVM project's clang-3.1 is different from Apple clang-3.1. `template_id_with_cvr<...>().name_demangled()` returns the correct name on the latter compiler, but it returns incorrect name on the former compiler. To distinguish these compilers, you cannot use `__clang_major__` and `__clang_minor__` macros; maybe you need to use `__clang_version__` macro. Regards, Michel

2012/7/23 Michel Morin <mimomorin@gmail.com>:
Is there a list of supported compilers in the doc? Currently, clang-3.1 is not supported. (On clang-3.1, `template_id_with_cvr<int const&>().name_demangled()` returns `const int &>::n() [T = const `.)
TypeIndex has been tested on MSVC2010, GCC-4.5, Clang-2.9. There is currently no list of supported compilers. If TypeIndex would be accepted into boost, support for all compilers running regression tests will be added. You can also define BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP and BOOST_TYPE_INDEX_CTTI_END_SKIP for your compiler. Consider the following example: BOOST_CURRENT_FUNCTION for boost::detail::ctti<int>:: returns "const char *__cdecl boost::detail::ctti<int>::n(void)". Then you shall set BOOST_TYPE_INDEX_CTTI_BEGIN_SKIP to sizeof("const char *__cdecl boost::detail::ctti<") - 1 and BOOST_TYPE_INDEX_CTTI_END_SKIP to sizeof(">::n(void)") - 1 I`ll add documentation for those macroses and fix TypeIndex on clang-3.1 ASAP.
Please note that, in general, clang does not recommend to use version checks, because the version number of clang is not consistent between the vendors. For example, LLVM project's clang-3.1 is different from Apple clang-3.1. `template_id_with_cvr<...>().name_demangled()` returns the correct name on the latter compiler, but it returns incorrect name on the former compiler. To distinguish these compilers, you cannot use `__clang_major__` and `__clang_minor__` macros; maybe you need to use `__clang_version__` macro.
Thanks for a good advise! -- Best regards, Antony Polukhin

Hi Antony, Thanks for your explanation, and sorry for the delayed response. Antony Polukhin wrote:
2012/7/23 Michel Morin <mimomorin@gmail.com>:
Is there a list of supported compilers in the doc? Currently, clang-3.1 is not supported. (On clang-3.1, `template_id_with_cvr<int const&>().name_demangled()` returns `const int &>::n() [T = const `.)
TypeIndex has been tested on MSVC2010, GCC-4.5, Clang-2.9. There is currently no list of supported compilers. If TypeIndex would be accepted into boost, support for all compilers running regression tests will be added.
OK, understood. I'm looking forward to a Boost's public utility function for getting demangled type names (with cv and ref qualifiers). Regards, Michel
participants (2)
-
Antony Polukhin
-
Michel Morin