C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 20 Mar 2025 16:15:10 -0700
On Thursday, 20 March 2025 14:39:22 Pacific Daylight Time Hans Ã…berg wrote:
> > The most common use will not the in the Standard Library. Please design it
> > with the most common use-case in mind.
>
> The intended design is for use in the standard library.

I don't think so. I don't see the point of this in the Standard Library.

> > And fixing [[unimplemented]] is still work. If the original party adds the
> > function, now we have two definitions and the linking may fail (ODR
> > violations are IFNDR) - it will fail if linking statically.
>
> There is no work needed; the workaround implementation will be not called,
> and its single occurrence can be removed at some point.

It will fail to link. Therefore, it requires work.

> So forget about the issue, or make your own solution, because this is the
> only I could find.

To what problem? It isn't clear what you're trying to solve in the first place.

The example you've given is that of a runtime function that is not specified in
the standard. Attempting to override a function from a library that isn't
designed to be overridden is a recipe for trouble. If the library in question
means for you to complement it, then they already have a solution for doing
that. They probably have a macro telling you whether the functionality is
present in the first place, so you can use #if to decide whether you need to
complement what is missing or avoid it altogether.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2025-03-20 23:15:13