: A nodiscard call is a function call expression that
calls a function previously declared
nodiscard, or
whose return type is a possibly cv-qualified class or enumeration type
marked
nodiscard. Appearance of a nodiscard call as
a potentially-evaluated discarded-value expression (Clause
[expr])
is discouraged unless explicitly cast to
void. Implementations are encouraged to issue a warning in such cases
. This is typically because discarding the return value
of a nodiscard call has surprising consequences
. —
end note