C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Similar to [[no_discard]], but store in a variable, maybe call it [[must_store]]

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 22 Jul 2025 15:38:52 +0200
I agree with what you said. But for suppressing a warning and not prolonging the lifetime one could put a scope around it. { auto discard = f(); } It does, what it should. Is it short? Is it pretty? Not sure. -----Ursprüngliche Nachricht----- Von:Jan Schultke via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 22.07.2025 14:38 Betreff:Re: [std-proposals] Similar to [[no_discard]], but store in a variable, maybe call it [[must_store]] There's also a question of how to suppress a warning produced by [[must_store]].

Received on 2025-07-22 13:48:37