C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Detect non overriden function

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 19 Mar 2022 08:36:24 -0700
On Saturday, 19 March 2022 06:56:25 PDT organicoman via Std-Proposals wrote:
> Expl:struct base{ virtual void foo(){};};struct derived: public base{}int
> main(){ derived d; d.foo(); // i would like to receive a warning here
> telling me that I'm using the base class implementation

You haven't said why you'd like that and why a pure virtual won't help you. It
would be a compilation error, not a warning, though.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2022-03-19 15:36:26