我如何在 Xcode 中使用 C++ STL 中的绳索

How do I use the rope from C++ STL in Xcode

抱歉,我问的是一个愚蠢的新手问题。我是 C++ 的新手(熟悉 C 和 objective C),想使用标准模板库中的绳索。这是否包含在 Xcode 使用的库中?我已成功尝试 #include <vector> 和相同的地图以及 ext/hash_map。但是绳索似乎不可用。我是否只需要下载源代码并将其包含在我的项目中?

不幸的是"Rope"不是C++标准的一部分!

C++ 概述:http://www.cplusplus.com/reference/

来自您发布的link:

This distribution of the STL consists entirely of header files: there is no need to link to any library files.

这意味着使用它的步骤是:

  • 下载 SGI 的 STL 实现的源代码

  • 将它们添加到您的包含路径

  • 在您的代码中包含必要的文件

  • 编译

也就是说,您发布的 link 不是 C++ 标准库。它是 STL(C++ 标准库的前身)的一个实现,添加了一些(非标准的)内容。特别是,您发现的 rope 实现是非标准添加。