As an alternative to (void) cast or static_cast<void>() I suggest using a (empty) function "discard" to intentionally discard a [[nodiscard]] value: `template<typename T> void discard(const T&) {} [[nodiscard]] int foo () {return 0;} int main () { (void) foo(); static_cast<void>(foo()); discard(foo()); }` This avoids a cast and is more readable.