[[nodiscard]]
int func()
{
return 0;
}
int main()
{
func();
return 0;
}
// Compiler Warning: warning C4834: discarding return value of function
with 'nodiscard' attribute
References:https://en.wikipedia.org/wiki/C%2B%2B17
https://infektor.net/posts/2017-01-19-using-cpp17-attributes-today.html
No comments:
Post a Comment