I want to wrap a C++ struct which has a comparison operator using Cython:
struct myStruct {
float a;
float b;
float c;
float d;
bool operator==(const myStruct &myStr) const = default;
};
I am struggling to figure out how to perform the operator overload in Cython.
cdef struct myStruct:
np.float32_t a;
np.float32_t b;
np.float32_t c;
np.float32_t d;
# Operator overload???
I did not specify the operator overload in the cython definition of the struct, and the build succeeded. I thought it would fail with an error.