Discussion about this post

User's avatar
Anders Karlsson's avatar

Useful for return but I also like to sometimes use it on arguments, e.g. having an argument that is used in release build but not in debug build, or when are implementing an interface and an argument is not really needed in that context. void foo(int n, [[nodiscard]] int m) -- if the compiler switch is on for treating such as an error.

Expand full comment
1 more comment...

No posts