I use #warning to mark some unfinished functions, so that when someone compiles the code later, they see a hint that they still need to continue to implement. for example:
class HttpDownloadJobAndroid : public HttpDownloadJob
{
public:
virtual void Download() override
{
#warning "Please complete the implementation of the function : HttpDownloadJobAndroid::Download"
Finished = true;
Success = false;
}
};
This works great, but there is a small problem that every time I copy and paste this warning into a new function, I always need to change the function name in it. This will undoubtedly affect some work efficiency. So I thought, is it possible to pack a C++ macro like __FUNCTION__
into this string so I can copy this warning anywhere.
#define _ME_PP_TEXT(Expr) #Expr
#define ME_PP_TEXT(Expr) _ME_PP_TEXT(Expr)
// not work
#warning "Please complete the implementation of the function : " __FUNCTION__
// not work too...
#warning "Please complete the implementation of the function : " ME_PP_TEXT(__FUNCTION__)
I've tried this method, but it doesn't seem to work.
Of course, if there are other better solutions, please teach me, thank you.
my compiler is Clang 5.0, target platform is android.