I have a class with many methods and would like to check for pre/post conditions, such as is mMember == null and invoke function x() if not.
Is it possible to add pre/post conditions to every member of that class automatically? The class is defined in class.h and all methods are defined in class.cpp. Being able to define a macro at the start of the class.cpp would be ideal that would be inserted on every function entry in that file only.
I know I can manually add the same precondition/postcondition (using destructors) manually on every function entry but I keep running into this problem time and time again. This is not ideal as I can not check these changes in and must maintain them locally and they bit root from other people's changes.