专用于块状链表计算的rope容器
库中模板计算基本和string一样简单
string的基本用法
但内部是用平衡树实现,各种操作的复杂度都是O(log n),十分方便高效
需要增加的预处理指令:
#include<ext/rope>
using namespace __gnu_cxx;
rope的库函数提供的基本操作:
rope list;
list.insert(p,str) //在p的位置插入str
list.erase(p,c) //删除list的从p开始的c个节点
list.substr(p,c) //提取list的p位置开始的c个节点
list.copy(p,c,str) //将list的p位置开始的c个节点复制给str