Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2025-05-07 20:43:26


AMDG

On 5/6/25 10:17 PM, Jean-Louis Leroy via Boost wrote:
>> 7. boost::openmethod::type_id is a type alias for std::uintptr_t. I
>> would try to avoid such an alias, since it doesn't add much and makes
>> code more difficult to read. It might be misleading given the
>> existence of the typeid operator.
>
> Hmmm yeah maybe. std::uintptr_t is a bit hard to type...
>

I think it's fine to have a type alias. type_id is easily
confused as being related to typeid/std::type_info/std::type_index,
but std::uintptr_t isn't any better, as it's just another
integer type and doesn't indicate what it's for.

>> I don't know if having a virtual destructor is common in custom RTTI
>> scenarios, but I'm inclined to think that it's not, as AFAIK a virtual
>> destructor adds standard RTTI information to a type.
>
> I'm pretty sure it doesn't.
>

According to the standard, it does (any virtual function
adds RTTI), but those using custom RTTI typically use a
non-conforming implementation by disabling standard RTTI.

In Christ,
Steven Watanabe


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