5.4 C++ Nuances

(This section was written by Joel B. Mohler. Many of the tricks come from Martin Albrecht and David Harvey.)

Cython can generate C++ for wrapping of C++ libraries. There are just a few things to keep in mind though. Cython doesn't know specifically about C++ features like function and operator overloading. Therefore, your library must have unique function names or you must alias them. Other issues which arise have to do with functions taking references and pointer dereferencing since C does not support either of these.

You can see real live examples for many of these concepts in the NTL wrapper classes. These are in the Sage tree at sage/libs/ntl/.



Subsections
See About this document... for information on suggesting changes.