C++ Logo

std-proposals

Advanced search

Re: [std-proposals] template catch block

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 23 Sep 2023 19:22:59 -0400
On Sat, Sep 23, 2023 at 6:37 PM Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Sat, Sep 23, 2023 at 10:04 PM Thiago Macieira wrote:
> >
> > The source code for Chromium is readily available on the Internet. It's not at
> > all easy to build (you need Node.js to generate the build files), but it's
> > doable and lots of people do it every day.
> >
> > Anyway, if after the feedback you've already received you still think this is
> > an idea worth pursuing, I suggest you implement it in one of the compilers and
> > see if it can be done with
> > a) reasonable amount of memory for the compiler
> > b) reasonable time spent compiling
> > c) non-explosive code expansion in the resulting binaries
>
>
> The biggest program I've ever written, which I started writing about
> 14 years ago, is now 41 object files. It's linked with Boost and
> wxWidgets. On Linux, I can get all the typeinfo's at the command line
> as follows:

Why do you think the number of `typeinfo` objects is relevant here?

`typeinfo`s are only generated if you statically do something that
*requires* such a type to exist. Like calling `typeid` on it, or maybe
using `dynamic_cast`. If your program never uses `typeid` on those
types, then `typeinfo` objects won't exist for them.

But the compiler does not, and *cannot*, know what exception types get
bubbled through a particular function. Therefore, in order for your
feature suggestion to work, it would have to use every single type.

Received on 2023-09-23 23:23:11