C++ Logo


Advanced search

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

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Mon, 26 Feb 2024 14:43:34 +0300
On 2/26/24 13:22, Frederick Virchanza Gotham via Std-Proposals wrote:
> The point I want to make here is as follows: So long as 'v' points to
> a polymorphic type, it is not necessary to know that that type is.
> Therefore I think that the functionality of 'dynamic_cast' should be
> expanded to allow 'v' to be a pointer to void -- with the note that
> the behaviour is undefined if 'v' points to a non-polymorphic object.

dynamic_cast from void* to void* is currently well-defined. So what
you're suggesting is a breaking change for seemingly no reason, as you
haven't given any rationale why such a change is needed.

Received on 2024-02-26 11:43:37