11-4 四 迭代器运算 *iter Return a reference to the element referred to by the iterator iter. 返回迭代器 iter 所指向的元素的引用 iter->mem Dereference iter and fetch the member named mem from the underlying element. Equivalent to (*iter).mem. 对 iter 进行解引用,获取指定元素中名为 mem 的成员。等效于 (*iter).mem ++iter iter++ Increment iter to refer to the next element in the container. 给 iter 加 1,使其指向容器里的下一个元素 --iter iter-- Decrement iter to refer to the previous element in the container. 给 iter 减 1,使其指向容器里的前一个元素 iter1 == iter2 iter1 != iter2 Compare two iterators for equality (inequality). Two iterators are equal if they refer to the same element of the same container or if they are the off-the-end iterator (Section 3.4, p. 97) for the same container. 比较两个迭代器是否相等(或不等)。当两个迭代器指向同一个容器中的同一个元素,或者当它们都指向同一个容器的超出末端的下一位置时,两个迭代器相等 容器类型的别名 size_type Unsigned integral type large enough to hold size of largest possible container of this container type 无符号整型,足以存储此容器类型的最大可能容器长度 iterator Type of the iterator for this container type 此容器类型的迭代器类型 const_iterator Type of the iterator that can read but not write the elements 元素的只读迭代器类型 reverse_iterator Iterator that addresses elements in reverse order 按逆序寻址元素的迭代器 const_reverse_iterator Reverse iterator that can read but not write the elements 元素的只读(不能写)逆序迭代器 difference_type Signed integral type large enough to hold the difference, which might be negative, between two iterators 足够存储两个迭代器差值的有符号整型,可为负数 value_type Element type 元素类型 reference Element's lvalue type; synonym for value_type& 元素的左值类型,是 value_type& 的同义词 const_reference Element's const lvalue type; same as const value_type& 元素的常量左值类型,等效于 const value_type&