55 template <
class PyClass>
56 void visit(PyClass& cl)
const {
57 cl.def(
"type_info", &boost_type_info, bp::arg(
"self"),
58 "Queries information of the type of *this as a " 59 "boost::typeindex::type_index (can work without RTTI).");
60 cl.def(
"boost_type_info", &boost_type_info, bp::arg(
"self"),
61 "Queries information of the type of *this as a " 62 "boost::typeindex::type_index (can work without RTTI).");
63 cl.def(
"std_type_info", &std_type_info, bp::arg(
"self"),
64 "Queries information of the type of *this as a std::type_index.");
68 static boost::typeindex::type_index boost_type_info(
const C& self) {
69 return boost::typeindex::type_id_runtime(self);
72 static std::type_index std_type_info(
const C& self) {
return typeid(self); }