Remove paddle/platform/must_check.h
Created by: wangkuiyi
I listed my doubts about this PR in https://github.com/PaddlePaddle/Paddle/pull/2629#discussion_r124430464:
- The naming is confusing
I checked the definition of __must_check
. It means "must use the returned value", and has nothing about "check".
-
Breaks the code style
According to Google C++ style, a macro should be all captital, e.g.,
MUST_USED_RETVALUE
. It breaks the style. -
Don't throw errors to users
The best place to handle the error is at where it happens, where we have the most sufficient information to recover, to report, or to fail. Let us don't use __must_check to require users to handle the error, try handle the error as much as we could and try not to return it.