Commits

wlav committed 6b1de00

make STL-life easier

  • Participants
  • Parent commits 4d1ca3a
  • Branches reflex-support

Comments (0)

Files changed (2)

File pypy/module/cppyy/src/reflexcwrapper.cxx

 
 int cppyy_num_bases(cppyy_type_t handle) {
     Reflex::Type t = type_from_handle(handle);
+    std::string name = t.Name(Reflex::FINAL|Reflex::SCOPED);
+    if (5 < name.size() && name.substr(0, 5) == "std::") {
+        // special case: STL base classes are usually unnecessary,
+        // so either build all (i.e. if available) or none
+        for (int i=0; i < (int)t.BaseSize(); ++i)
+            if (!t.BaseAt(i)) return 0;
+    }
     return t.BaseSize();
 }
 

File pypy/module/cppyy/test/stltypes.xml

   <namespace name="std" />
 
   <class pattern="std::vector<*>" />
-  <class pattern="std::_Vector_base<*>" />
-  <class pattern="std::_Vector_base<*>::_Vector_impl" />
   <class pattern="std::vector<*>::iterator" />
   <class pattern="std::vector<*>::const_iterator" />
 
   <class pattern="std::list<*>" />
-  <class pattern="std::_List_base<*>" />
   <class pattern="std::list<*>::iterator" />
   <class pattern="std::list<*>::const_iterator" />
   <class name="std::__detail::_List_node_base" />
 
   <class pattern="__gnu_cxx::__normal_iterator<*>" />
+
+  <!-- the following are for testing, not for iteration -->
   <function name="__gnu_cxx::operator=="/>
   <function name="__gnu_cxx::operator!="/>