I\'m trying to determine whether a C++ function can be declared in such a way that the return value cannot be ignored (ideally detected at compile time). I tried to declare
If you use MFC , you may try Check_return before your function declaration. See more about it on Annotating function behavior