[pypy-commit] pypy reflex-support: do not remove "const" in template parameters

wlav noreply at buildbot.pypy.org
Wed Mar 20 21:55:02 CET 2013


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r62579:3b0d430e7067
Date: 2013-03-20 13:54 -0700
http://bitbucket.org/pypy/pypy/changeset/3b0d430e7067/

Log:	do not remove "const" in template parameters

diff --git a/pypy/module/cppyy/helper.py b/pypy/module/cppyy/helper.py
--- a/pypy/module/cppyy/helper.py
+++ b/pypy/module/cppyy/helper.py
@@ -3,7 +3,12 @@
 
 #- type name manipulations --------------------------------------------------
 def _remove_const(name):
-    return "".join(rstring.split(name, "const")) # poor man's replace
+    tmplt_start = name.find("<")
+    if 0 <= tmplt_start:
+        # only replace const within the class name, not in the template parameters
+        return "".join(rstring.split(name[:tmplt_start], "const"))+name[tmplt_start:]
+    else:
+        return "".join(rstring.split(name, "const"))
 
 def remove_const(name):
     return _remove_const(name).strip(' ')


More information about the pypy-commit mailing list