| 1949 | } |
| 1950 | |
| 1951 | inline void add_class_method(object &cls, const char *name_, const cpp_function &cf) { |
| 1952 | cls.attr(cf.name()) = cf; |
| 1953 | if (std::strcmp(name_, "__eq__") == 0 && !cls.attr("__dict__").contains("__hash__")) { |
| 1954 | cls.attr("__hash__") = none(); |
| 1955 | } |
| 1956 | } |
| 1957 | |
| 1958 | /// Type trait to rebind a member function pointer's class to `Derived`, preserving all |
| 1959 | /// cv/ref/noexcept qualifiers. The primary template has no `type` member, providing SFINAE |