C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Tue, 18 Mar 2025 22:16:51 +0100
> On 18 Mar 2025, at 21:23, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Tuesday, 18 March 2025 12:44:30 Pacific Daylight Time Hans Åberg via Std-
> Proposals wrote:
>> With an error, one must handle the case when the definition is in a source
>> file and the unimplemented directive in a header file, which must be
>> overridden somehow if used in another source file. With a warning one gets
>> a correct compile.
>
> Sorry, not following this sentence. Either a method is implemented or it's not
> implemented. There's no such thing as a schrödinmethod that is both
> implemented and unimplemented. So if the method is marked unimplemented in a
> header, then no source file will think it's implemented.
>
> What's the point of making it a warning?

Features in a new language version that are not yet implemented can be marked, and the user will know, and at need implement, as in the example in my first post of this thread.

One may need preprocessor macros so that when implemented by the compiler, the ones done by the user are inhibited.

> Under what conditions would some code compile with the attribute, not print
> the warning, and would not compile with =delete?

Compiler options can regulate that. The main point is that it is marked, so that the compiler can recognize the situation.

Received on 2025-03-18 21:17:10