Can a C++ function be declared such that the return value cannot be ignored?

后端 未结 4 1520
青春惊慌失措
青春惊慌失措 2020-12-29 20:52

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

4条回答
  •  不知归路
    2020-12-29 21:49

    If you use MFC , you may try Check_return before your function declaration. See more about it on Annotating function behavior

提交回复
热议问题