On Thu, Apr 11, 2024 at 4:40 PM Tiago Freire via Std-Proposals <std-proposals@lists.isocpp.org> wrote:


> All I'm saying is that asking for `any` to support taking out an instance of a base class instead of the actual class stored in it is not unreasonable.


Yes, adding an extra feature to std::any is not unreasonable. And dynamic_cast is not the only form of RTTI in the standard, exceptions requires the ability to do it without a vtable, traversing some form of type_info information must already exist to be able to support that, it just so happens to be implementation specific.


The problem is the OP is not about changing std::any, but adding sizeof and alignof to std::type_info, which doesn’t help at all to solve any existing issue, including with std::any.

If the OP drops the proposal to change `type_info` and prepares a proposal for changes to `any` instead, would your objections be addressed? Maybe that's the feedback to give?

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.