_stl_deque中Iterator实现机制
Note:deque方便进行前增和后增,但是修改效率极低!如果要实现排序或其它操作,最好先复制到其它容器操作后再复制回
类中定义了typedef T** map_pointer,作为中继器,起到类似于块表的作用,保存指向各个分开存储的块的指针;
Note:deque方便进行前增和后增,但是修改效率极低!如果要实现排序或其它操作,最好先复制到其它容器操作后再复制回
类中定义了typedef T** map_pointer,作为中继器,起到类似于块表的作用,保存指向各个分开存储的块的指针;
Iterator中定义了成员函数map_pointer,cur_pointer,first_pointer,last_pointer分别对应所在deque中map_pointer的node,当前指向的指针,当前node的最前最后指针;
P.S.:cppreference 中 deque::insert 的说明:All iterators, including the past-the-end iterator, are invalidated. References are invalidated too, unless pos == begin() or pos == end(), in which case they are not invalidated.