Tag: [[nodiscard]]
![C++20 [[nodiscard]] Attribute C++20 [[nodiscard]] Attribute](http://i0.wp.com/www.rangakrish.com/wp-content/uploads/2021/01/Example1-src.jpg?resize=675%2C240&ssl=1)
[[nodiscard]] attribute “encourages” the compiler to issue a warning when the return value from a function is ignored. It was introduced in C++ 17 and enhanced in C++ 20 to include a string literal that can be used as an explanation of the warning. Let us look at different cases one by one. Case-1: An enumeration […]
Recent Comments