Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r71528:646b4e87506c
Date: 2014-05-14 23:37 -0700
http://bitbucket.org/pypy/pypy/changeset/646b4e87506c/
Log: enable lazy lookup of templated functions
diff --git a/pypy/module/cppyy/src/reflexcwrapper.cxx
b/pypy/module/cppyy/src/reflexcwrapper.cxx
--- a/pypy/module/cppyy/src/reflexcwrapper.cxx
+++ b/pypy/module/cppyy/src/reflexcwrapper.cxx
@@ -370,9 +370,12 @@
// unsorted std::vector anyway, so there's no gain to be had in using the
// Scope::FunctionMemberByName() function
int num_meth = s.FunctionMemberSize();
+ std::string::size_type name_sz = strlen(name);
for (int imeth = 0; imeth < num_meth; ++imeth) {
Reflex::Member m = s.FunctionMemberAt(imeth);
- if (m.Name() == name) {
+ const std::string& mName = m.Name();
+ if (mName.find(name) == 0 && (mName.size() == name_sz /* exact match
*/ ||
+ (mName.size() > name_sz && mName[name_sz] == '<') /* template */
)) {
if (m.IsPublic())
result.push_back((cppyy_index_t)imeth);
}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit