C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Tue, 18 Mar 2025 11:08:36 +0100
Il 18/03/25 10:47, Samuel Alonso Rodríguez via Std-Proposals ha scritto:
> This attribute is meant to be used in function (member or free, static
> or non-static, template or non-template) declarations to indicate that
> the function declaration is left unimplemented (without a definition)
> with an additional diagnostic message that can be fixed or opt-in thru
> an unevaluated string literal.
>
> The interesting bit comes from its behaviour: defining any function
> marked with such attribute, lleads to an ill-formed program (preferably
> with a diagnostic message), making calls to it be always diagnosable in
> non-linking time, because no TU can ever define this.
>
> The only catch so far is: redeclarations w/o this attribute would break
> that assumption. I thought of straight banning redeclarations but I
> think that’s too much. Maybe forcing redeclarations to have this
> attribute aswell, once the former declaration has it, could be an
> interesting idea to explore.

Could you please elaborate a bit more on what's your use case for
something like this? For instance, how is this different from just
`=delete` the function?

Thank you,
--
Giuseppe D'Angelo

Received on 2025-03-18 10:08:40