Cython提供了一种简单的方法来导入C++标准库的数据结构,例如:
from libcpp.vector cimport vector
from libcpp.utility cimport pair
但是关于C++11引入的新容器,比如std::unordered_map
,std::unordered_set
等,它们是否被同样支持?我找不到适当的导入语句。
/usr/local/lib/python2.7/dist-packages/Cython/Compiler/Main.py:554: UserWarning: got unknown compilation options, please remove: extra_link_args, extra_compile_args
(然后它会因为C++11相关错误而失败)。我的setup.py看起来像这样:ext_modules = cythonize('x.pyx', language='c++', <options>)
。 - David Nemeskey