#include <boost/type_index.hpp>
#include <iostream>
class MyObject { public: virtual ~MyObject() {} };
struct Derived : MyObject {};
int main() {
MyObject o;
Derived d;
std::cout << boost::typeindex::type_id<MyObject>().pretty_name() << "\n";
std::cout << boost::typeindex::type_id<Derived>().pretty_name() << "\n";
MyObject& r = d;
std::cout << boost::typeindex::type_id_runtime(r).pretty_name() << "\n";
}
|