class QString { public: inline QString(const int i);}; class QGenericArgument {}; class ExtensionOption {}; template< typename T2 > struct if_ { typedef T2 type; }; template struct c_imp { typedef const T& param_type; }; template struct call_traits { typedef typename c_imp< T >::param_type param_type; }; class object; template struct rvalue_from_python_storage {}; template struct rvalue_from_python_data : rvalue_from_python_storage { ~rvalue_from_python_data(); }; template struct extract_rvalue { typedef typename if_::param_type >::type result_type; mutable rvalue_from_python_data m_data; }; template struct select_extract { typedef typename if_< extract_rvalue >::type type; }; template struct extract : select_extract::type { private: typedef typename select_extract::type base; public: typedef typename base::result_type result_type; operator result_type() const {} extract(object const&); }; template class QHash { public: inline QHash() {} T &operator[](const Key &key); }; class type_details { typedef QGenericArgument(*func_python_to_cpp_type)(const object&); public: template static type_details* create_value_type_details() { type_details* self = new type_details(); self->m_func_python_to_cpp = &python_to_value_type; } func_python_to_cpp_type m_func_python_to_cpp; template static QGenericArgument python_to_value_type(const object& obj) { T* val = new T(extract(obj)); } }; class type_manager { public: static type_manager& instance(); template void register_value_type() { m_type_map[0] = type_details::create_value_type_details(); } QHash m_type_map; }; void foo() { type_manager::instance().register_value_type(); }