C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Samuel Alonso Rodríguez <samuelalonso26_at_[hidden]>
Date: Tue, 18 Mar 2025 10:13:46 +0000
The fixed message stating that the function is unimplemented is the divergence from raw = delete, and sure, since C++26, users could simply do something like = delete(“unimplemented function!”), but the compiler outcome could differ and tools inspecting the compiler output may not be able to easily detect that

> On 18 Mar 2025, at 10:08, Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> 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
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-03-18 10:14:04