Is it possible to check (at compile or runtime) if function or class method has an an empty body?
E.g
void empty_body_function(){}
void non_empty_body_function(){int i;}
int main()
{
assert(magic(empty_body_function) == true);
assert(magic(non_empty_body_function) == false);
}
P.S.I define non empty body like that: function/method does have non empty body if and only if it has any code(valid C++ code, for sure) inside {} after preprocessing
P.P.S Answering "why" question: What I'm trying to achieve is to check if particular interface implementation "does nothing". No side effects, no calculations, etc