C++ (Qt)template <class T>struct base{ base() { std::clog << "Enter to class " << typeid(T).name() << std::endl; }}; struct myclass : public base<myclass>{...};
C++ (Qt)struct myclass { myclass() { LOG(myclass) // обычный макрос ... }};
C++ (Qt)RegisterClass<MyClass1>();RegisterClass<MyClass2>();...RegisterClass<MyClass888>();
C++ (Qt)struct myclass { MyAgent<myclass> agent; // завернуть в макруху
C++ (Qt)template <class T>struct MyAgent { MyAgent ( void ) { std::clog << "Enter to class " << typeid(T).name() << std::endl; } ...
C++ (Qt)#ifdef DEBUG#define LOG(T) struct logger_##T \{ logger_##T() { std::clog << "Enter to class " << #T << std::endl; } }; \ logger_##T _logger_##T;#else#define LOG(T)#endif class myclass{ LOG(myclass)}; int main(){ myclass myobject;}
C++ (Qt)class base{ LOG(base)}; class derived : public base{ LOG(derived) REMOVE_LOG(base)};
C++ (Qt)class base{ LOG(base)}; class derived : public base{ LOG(derived) REMOVE_LOG(base)}; Это в принципе можно сделать..