C++ Logo

std-proposals

Advanced search

Re: [std-proposals] template catch block

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 23 Sep 2023 12:31:15 -0400
On Sat, Sep 23, 2023 at 8:09 AM Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
>
>
>
> On Saturday, September 23, 2023, Andrey Semashev wrote:
>>
>>
>> This is insane, you have no idea what you're talking about. No gigs of RAM will save you in a moderately sized project with thousands of types, let alone something like Chromium. Don't even get me started about how the compiler is supposed to know every type in the program.
>
>
>
> It only needs to know every type encountered so far in the translation unit.
>
> Give me a link to one of those Chromium source files, I'll run it through a preprocessor to get a translation unit, and then I'll run my own proprietary parser on it to get all the types -- let's see if it's in the thousands, and let's see how many of the implementations have identical machine code.

What does that matter?

The compiler would have to generate code for each one in order to see
if it's "identical" (by some definition of that term) to some previous
version. It would have to spend the time to instantiate each template
for every such type. And it would have to do this every single time
you compile that TU.

That makes it a non-starter.

Received on 2023-09-23 16:31:27