C++ Logo

std-proposals

Advanced search

Re: Static Failure - Custom Compile-Time Errors

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Fri, 18 Jun 2021 13:52:25 -0400
Since nobody's mentioned it yet:
    static_assert(sizeof(T) != 0, "this condition is dependent, yet always
false");
No wording change needed.

On Fri, Jun 18, 2021 at 12:16 PM Михаил Найденов via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> If both are called static_* then it will be odd to be called at different
> times.
>
> Assuming we don't want to change how static_assert works, I think this is
> better solved by an overload to pick the time of evaluation
>
> static_assert(std::instantiation/lazy/whatever, ...);
>
> It also be interesting if consteval can be used
>
> consteval { assert(...); }
>
> or
>
> consteval(when) { assert(...); }
>
> In any case, this feature seems affected by code injection, so I don't see
> a chance for 23
>
> On Fri, Jun 18, 2021 at 4:59 AM David Braun via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> *From:* David Braun
>> *Sent:* Thursday, June 17, 2021 12:29 AM
>> *To:* lwgchair_at_[hidden]
>> *Subject:* C++ 23 Language Proposal for new type of static assertion
>>
>>
>>
>> Here is my proposal for C++ 23.
>>
>> Thank You!
>>
>>
>>
>> David Aaron Braun
>>
>> 519-680-9822
>>
>> 226-236-4898
>>
>> da.braun1_at_[hidden]
>>
>>
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2021-06-18 12:52:38