C++ Logo


Advanced search

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

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Mon, 8 Apr 2024 09:53:30 -0400
On Mon, Apr 8, 2024 at 9:45 AM Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Monday 8 April 2024 05:00:50 CDT Frederick Virchanza Gotham via
> Std-Proposals wrote:
> > On Mon, Apr 8, 2024 at 4:04 AM Thiago Macieira wrote:
> > > That section starts with "There has been recent discussion about making
> > > major additions to" but doesn't link to papers or committee minutes
> where
> > > said discussion happened. Therefore, I am discounting it as "it never
> > > happened".
> > Arthur brought it up in a post a few weeks ago here. Do I have to
> > prove Arthur's existence?
> No. I think it would be acceptable to link to blog posts by respected
> luminaries, or some of the maintainers of relevant libraries who've voiced
> opinions. But discussions on a mailing list, even this one, don't really
> count
> if there's no obvious conclusion, and the vast majority of mailing list
> discussions sputter out without one.
> Either way, you need to provide references.

FWIW, the sentence is:
> There has been recent discussion about making major additions to
std::type_info, for example to record the sizeof, alignof and
std::is_polymorphic_v of the type.

I never suggested that std::type_info should have those things in it. (
*Maybe* I used those examples as reductio ad absurdum of the idea that you
could just stuff everything you ever wanted into std::type_info. I don't
even *remember* doing *that*, but I *might* have.)

I've also been involved with `std::try_cast` — now, very sadly, renamed by
LEWG to the doubly redundant `std::exception_ptr_cast` — but that proposal
is explicitly about more ergonomic syntax for something you could *already*
do with an exception's typeinfo, definitely not about stuffing anything
*new* into the exception's typeinfo.

Now, if you were going to redesign type_info from scratch (which we're
never going to), I'd recommend my presentation "dynamic_cast from scratch"
as a good starting point. ;) It ends with some benchmarks showing a speedup
over the Itanium ABI. But it never went anywhere, and I don't expect it to.


Received on 2024-04-08 13:53:44