WingNews logo WingNews
top | new | best | ask | show | jobs
top | item 46745197

(no title)

listeria | 1 month ago

may I introduce you to the nodiscard attribute[1]?

  enum (class)? [[nodiscard]] Error {
    Ok,
    NoMem,
    ...
  };
[1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc...

discuss

order

drysine|1 month ago

   C attribute: nodiscard (since C23)
[1] https://en.cppreference.com/w/c/language/attributes/nodiscar...

senderista|1 month ago

FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020.
powered by hn/api // news.ycombinator.com