C++ Logo

std-proposals

Advanced search

Re: is_complete type trait?

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Sat, 13 Nov 2021 09:52:09 +0000
On Fri, 12 Nov 2021 13:37:40 -0500
Jason Cobb via Std-Proposals <std-proposals_at_[hidden]> wrote:

> On 11/12/21 12:45, Lénárd Szolnoki via Std-Proposals wrote:
> > A more useful "trait" would be something like an eagerly evaluated
> > `__is_complete(T)` (not suggesting this name), that doesn't risk
> > ODR-violation at least on the trait itself. Otherwise I think even a
> > concept is subject to ODR rules to evaluate to the same thing
> > within a TU, but I'm not a 100% sure on that. I think I saw cached
> > concept results when I played around with that.
>
>
> [temp.constr.atomic]/3:
>
> > If, at different points in the program, the satisfaction result is
> > different for identical atomic constraints and template arguments,
> > the program is ill-formed, no diagnostic required.
> > <http://eel.is/c++draft/temp.constr#atomic-3.sentence-5>
>

Hi,

Thanks, I wasn't aware of that paragraph. While it's strongly related
to concepts, concepts are not necessarily constraints until they are
actually included in requires clauses/type constraints/etc..., or are
they?

Anyway, I think https://eel.is/c++draft/temp.point#7.sentence-4 apply
to concepts even if they are not included in constraints (if this makes
sense).

Good to know that with atomic constraints you can basically break ODR
without actually having a named entity you are breaking the definition
of.

Cheers,
Lénárd

Received on 2021-11-13 03:52:26