py::overload_cast
does not work in the presence of a templated function with the same name
#5395
Unanswered
crisluengo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that
py::overload_cast
works fine to findbar()
in the example below, distinguishing it frombar(int)
, but cannot findbaz()
. The only difference is that there is a templated functionbaz<T>(T)
.This is the compiler's (Clang) error message:
Using
does work correctly, so I do have a workaround. But code that calls
baz()
compiles just fine, I fail to understand why the template resolution fails to infer template argumentReturn
in this case. What am I missing? Or is something that should be fixed in Pybind11?I think this is related to the question at #4736.
Beta Was this translation helpful? Give feedback.
All reactions