X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=321197%2Fpyside.ii.7;fp=321197%2Fpyside.ii.7;h=51c73856fd2822cef067a5c9cce7ec256c19c711;hp=0000000000000000000000000000000000000000;hb=bd3239d2bbe0de3a200b266503e3330b1e391489;hpb=dbff64cb4b7530861c2309c794efdd4e0cf47a23 diff --git a/321197/pyside.ii.7 b/321197/pyside.ii.7 new file mode 100644 index 0000000..51c7385 --- /dev/null +++ b/321197/pyside.ii.7 @@ -0,0 +1,58 @@ +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(); +}