C++ Logo

std-proposals

Advanced search

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

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Thu, 12 Oct 2023 15:12:34 +0200
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_at_[hidden]> Gesendet:Do 12.10.2023 14:50 Betreff:Re: [std-proposals] Attribute [[discard]] and attributes on expressions Anlage:untitled An:std-proposals_at_[hidden]; CC:Giuseppe D‘Angelo <giuseppe.dangelo_at_[hidden]>; 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_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals  

Received on 2023-10-12 13:12:35