Or

 

 
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
}

But then again, foo_other_platform could be called discard.
 
-----Ursprüngliche Nachricht-----
Von: Giuseppe D‘Angelo via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 12.10.2023 14:50
Betreff: Re: [std-proposals] Attribute [[discard]] and attributes on expressions
Anlage: untitled
An: std-proposals@lists.isocpp.org;
CC: Giuseppe D‘Angelo <giuseppe.dangelo@kdab.com>;
Hello,

On 12/10/2023 14:29, Bjorn Reese via Std-Proposals wrote:
>> The purpose of [[discard]] is really for expressions, I don't see much
>> value at discarding a pack as-is?
> template <typename... Args>
> void foo(Args... args)
> {
> #if SOME_PLATFORM
>       use(args...);
> #else
>       discard(args...);
> #endif
> }

But this can be spelled like this today, without discarding:

> template <typename... Args>
> void foo([[maybe_unused]] Args... args)
> {
> #if SOME_PLATFORM
>       use(args...);
> #endif
> }

Thank you,
--
Giuseppe D'Angelo
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals