C++ Logo

std-proposals

Advanced search

Re: is_complete type trait?

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Fri, 12 Nov 2021 13:31:10 +0300
On 12/11/2021 13:26, Ville Voutilainen via Std-Proposals wrote:
> On Fri, 12 Nov 2021 at 11:47, Giuseppe D'Angelo via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> Hi,
>>
>> On 12/11/2021 10:39, Bjorn Reese via Std-Proposals wrote:
>>>> Yes, this is why I asked if there have been any proposals, as they would
>>>> have to address such topics.
>>> Furthermore, many existing type traits requires complete types, so the
>>> standard C++ library implementations must check for completeness today.
>>
>> Those type traits have completeness as a _precondition_, meaning that if
>> you violate it, the behaviour is undefined.
>
> Yep, but if you evaluate such a trait in a mandatory-constant
> expression evaluation context,
> that UB needs to render the program ill-formed, like other constexpr UB does. :P

Library UB doesn't need to be diagnosed. https://timsong-cpp.github.io/cppwp/n4868/expr.const#5.sentence-2

Received on 2021-11-12 04:31:14