Third standard attribute
Explore the [[nodiscard]] attribute introduced in C++17, which helps ensure important function return values are used. Understand how it applies to functions and types to improve error handling and prevent bugs, and see how it is extended in C++20.
We'll cover the following...
We'll cover the following...
The third standard attribute we get in C++17 is:
[[nodiscard]] attribute
[[nodiscard]] can be applied on a function or a type declaration to mark the importance of the
returned value:
The ...