Boost logo

Boost :

Subject: Re: [boost] [type_index] C++03 implementation in boost?
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2012-07-02 19:55:44

On 02/07/2012 02:17 a.m., Antony Polukhin wrote:
> 2012/7/2 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:
>> It's considerably simpler than `extended_type_info`. It's just a wrapper
>> around a `std::type_info const*` that is usable as a key in associative
>> sequences (both ordered and unordered). Nothing more, nothing less.
> See TpeIndex library:
> It has the functionality of c++11 std::type_index (has all the
> comparators, hash functions and ostream operators), but can also work
> with disabled RTTI, store const-volatile-reference modifiers(if
> required) and has a full set of workarounds for broken compilers.

Looks like an interesting library, but has a much wider scope than that
of `std::type_index`

> I`ll request a formal review in a week or two.
> Any advices, for improvement are welcomed!

The documentation needs some work. There are a considerable number of
typos, most notable 'retruns' -> 'returns'.

Hashing the type names could be suboptimal compared to a native
implementation of `type_info::hash_code`. The compiler knows the entire
set of values, so it *should* be able to provide a perfect hash
function. You should use the native implementation in those cases where
its available.

I'm no expert in locales, but I believe your implementation of `before`
may be susceptible to global locale changes.

I'm not particularly keen on `name` and `name_demangled` returning
different string types. Would it make sense to have `name_demangled`
cache the result, and return a `char const*` instead?

Agustín K-ballo Bergé.-

Boost list run by bdawes at, gregod at, cpdaniel at, john at