Closed vladfolts closed 3 years ago
What does it solve / improve?
It solves compilation with VS2019. I guess VS2019 is more strict with following C++ standard, the most relevant topic I found here: https://en.cppreference.com/w/cpp/language/dependent_name (see "Lookup rules"). The compilation issue is also reproducible with the latest clang so this is not some VS2019 quirk.
Alternatively, you can make sure that every from
specialization is declared before all its calls (all the specializations are visible from the template definition context). I tried it first and it works but it looks bad since the current design suggests that you are declaring specialized from
along with py::object
subclasses.
Writing
py::translate<decltype(i)>::from(i)
everywhere instead ofpy::from(i)
doesn't look impressive.
Yeah, I think it can be mitigated somehow using yet another helper function/class but I did not think much about it since I did not encounter many such cases...
I see. So much for "backwards compatibility" 🤦
What does it solve / improve? Writing
py::translate<decltype(i)>::from(i)
everywhere instead ofpy::from(i)
doesn't look impressive.