Hacker News new | ask | show | jobs
by jjgreen 51 days ago
New in C23, juicy!
1 comments

[[nodiscard]] is new, but returning structs worked before of course (at least since C99).

You can even integrate the struct declaration right into the return type:

https://www.godbolt.org/z/GGraK61M6

(which tbf though has limited usability)