Boost logo

Boost :

Subject: Re: [boost] Formal review request: TypeIndex library
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2012-07-25 07:29:16


2012/7/23 Michel Morin <mimomorin_at_[hidden]>:
> 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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk