C++ Logo

std-proposals

Advanced search

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

From: Gašper Ažman <gasper.azman_at_[hidden]>
Date: Thu, 11 Apr 2024 13:28:36 +0100
Not without an ABI break, but you could do it. I'm not helping, I
personally see no reason to use std::any, and if I need it, I can write my
own. I'm just here saying that if you wanna do the work, that's quite
doable without changing type_info, which would be a colossal ABI break.

On Thu, Apr 11, 2024 at 1:26 PM Giuseppe D'Angelo via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> 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
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-04-11 12:28:48