Date: Tue, 19 May 2026 16:16:09 -0700
On Tuesday, 19 May 2026 12:58:24 Pacific Daylight Time Ville Voutilainen via
Std-Proposals wrote:
> In case this idea had actual convincing motivation, there's no reason
> *whatsoever* to do it with an attribute.
Actually, an attribute might be appropriate here and simply let the compiler
warn if the function is actually called in code, instead of making it a hard
error. It would not be the end of the world if helper functions that are
usually used to compute a type more easily than a sequence of
std::conditional_t got actually called.
Most of the time, such functions are private in some form or another, so only
the author of the code in question is even going to call them. The author can
already do a static_assert on a type-dependent false like std::declval does,
but will they bother to write that code?
Std-Proposals wrote:
> In case this idea had actual convincing motivation, there's no reason
> *whatsoever* to do it with an attribute.
Actually, an attribute might be appropriate here and simply let the compiler
warn if the function is actually called in code, instead of making it a hard
error. It would not be the end of the world if helper functions that are
usually used to compute a type more easily than a sequence of
std::conditional_t got actually called.
Most of the time, such functions are private in some form or another, so only
the author of the code in question is even going to call them. The author can
already do a static_assert on a type-dependent false like std::declval does,
but will they bother to write that code?
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Data Center - Platform & Sys. Eng.
Received on 2026-05-19 23:16:14
