问题描述:

Lets presume I have the following C++ class:

class Foo {

// implementation of the class

}

inline Foo operator+ (const Foo & a, const Foo & b){

// implementation of the operator

}

Implementing the operators as inline functions are preferred.

How would the Cython interface look like for the inline operator definition?

The Chython documentation only describes member function operator definitions. I'm quite new to Cython, sorry if this is obvious.

Also would be interested how would you do the same thing if you implement the operators as friend functions in C++?

相关阅读:
Top