C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Extend std::type_info with more information

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 11 Apr 2024 14:26:15 +0200
On 11/04/2024 14:21, Gašper Ažman via Std-Proposals wrote:
>
> all you need is some way to get a typelist of bases and you can codegen
> the code, on assignment. You *already* have to do that in a compilation
> unit where the full definition of the stored class is available. You can
> ask for it in a compilation unit where only a forward-decl is available,
> and that's alright, you'll be going through an extern template that you
> generated in the other compilation unit.
>
> It's really not difficult if you've ever done your own type-erasure.

Do you mean that this design can be retrofitted in existing std::any
without breaking BC, or are we talking about std::any_v2 ? (So while at
it, we could also store sizeof(T), alignof(T), all the attributes of the
type, the complete inheritance tree, etc.)

My 2 c,
--
Giuseppe D'Angelo

Received on 2024-04-11 12:26:21