当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Cython interface of C++ inline operators like

问题描述:

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++?

分享给朋友:
您可能感兴趣的文章:
随机阅读: