C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Optimize away VTBL when using single inheritance

From: Smith, Jim <jim.smith_at_[hidden]>
Date: Sat, 25 Nov 2023 20:28:37 +0000
> You're still describing devirtualisation. This already exists.

I'm sorry, what I mentioned was for a C++ standard based implementation that would be available across the board.

> You need to explain why devirtualisation isn't enough for your needs and why this change
> needs to be in the standard.

If it's not part of the standard there's no certainty it'll be available when building with another compiler?

> To do what?

When mentioning std::is_same in <type_traits> , it was only to suggest that a similar mechanism could be used for devirtualization so,
it would be a standard C++ feature.

Also I did stray from the original post because a C++ compiler optimization wouldn't be standard.



--James S.

> On Saturday, 25 November 2023 10:34:41 PST Smith, Jim via Std-Proposals wrote:
>
> > That's pretty much what I'm thinking could be accomplished at compile-time.
> > In the GoogleTests code for example the base may only consist of pure
> > virtual functions for the interface.
>
>
> You're still describing devirtualisation. This already exists. You need to
> explain why devirtualisation isn't enough for your needs and why this change
> needs to be in the standard.
>
> > In the C++ standard there are templates for compile-time conditions, i.e.,
> > std::is_same in <type_traits>so my first thought is that using the same
> > template based approach could work in this scenario.
>
>
> To do what?
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DCAI Cloud Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2023-11-25 20:28:55