C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Attribute [[discard]] and attributes on expressions

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 12 Oct 2023 15:48:12 +0200
On 12/10/2023 15:12, Sebastian Wittmeier via Std-Proposals wrote:
> template <typename... Args>
> void foo_other_platform([[maybe_unused]] Args... args)
> {
> }
>
> template <typename... Args>
> void foo(Args... args)
> {
> #if SOME_PLATFORM
> use(args...);
> #else
> foo_other_platform(args...);
> #endif
> }

I don't get it -- why having `foo_other_platform` at all?
[[maybe_unused]] is already doing the right thing, just put it on
`foo`'s arguments?

-- 
Giuseppe D'Angelo

Received on 2023-10-12 13:48:15