C++ Logo

std-proposals

Advanced search

Re: [std-proposals] dynamic_cast<void*>(void*)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 27 Feb 2024 07:57:42 -0800
On Tuesday, 27 February 2024 01:28:05 PST Frederick Virchanza Gotham via Std-
Proposals wrote:
> On Mon, Feb 26, 2024 at 11:24 PM Thiago Macieira wrote:
> > And why would we want that? dynamic_cast does work on non-polymorphic
> > types; the fact that it knows the answer statically and you could have
> > used static_cast are irrelevant.
>
> I'm not sure what you're saying here . . . the following doesn't
> compile on all g++, clang++, intel:
>
> https://godbolt.org/z/1MEW6b1zY

Never mind, then. I've never used dynamic_cast in that scenario precisely
because static_cast works, so I didn't actually remember it was already
forbidden.

Still, we're missing your examination of use-cases.

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

Received on 2024-02-27 15:58:04