C++ Logo

std-proposals

Advanced search

Re: std::is_constexpr_constructible (/ std::is_constexpr)

From: Edward Catmur <ecatmur_at_[hidden]>
Date: Sun, 24 Oct 2021 19:30:29 +0100
On Sun, 24 Oct 2021 at 17:57, Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Also, virtual destructors aren't constexpr. So unless you're violating The
> First Rule of Virtual (the destructor is virtual), your condition is a
> constant false.
>

That's an archaic rule, from before we understood how to write type-erasing
deleters. The current guideline[1] is that the base class destructor should
*either* be virtual *or* protected.

1.
https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-nonvirtual

Received on 2021-10-24 13:30:42