I have used a LOG_MACRO(..) in my project which I want to upgrade it to not do anything if its used in some defined classes. I did it by template specialization. but I get compile error in static functions. since 'this' is not available there.
I need a magical macro to give me the class of current member function. if I use it in static function it must gives void.
template<class T> struct ZZLogDisable { static constexpr bool Value = false; };
//this will give me compile error if used in static functions since this is not available there
#define LOG_MACRO(msg) if(!ZZLogDisable<std::remove_reference<decltype(*this)>::type>::Value) { printf(msg); }
//disable logging for a class
#define DISABLE_LOG(Class) template<> struct ZZLogDisable<Class> { static constexpr bool Value = true; };