According to the Cython documentation ,I write the following cython code as follows:
In [1]:%load_ext Cython
In [2]: %%cython
from libcpp.vector c
As an alternative to @romeric's answer, the documentation for ipython Cython magic suggests using
%%cython --cplus
to turn on C++ mode. Help for the command can also be accessed by running %%cython?
in the IPython console.
Personally I think there's a lot to be said for using the distutils comment approach, since it links the language with the code that requires it.