C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 25 Nov 2023 11:48:26 -0800
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

Received on 2023-11-25 19:48:28