IRandomAccessIterator<TValue> 接口

定义

定义随机访问迭代器的接口。Defines the interface for a random access iterator. 随机访问迭代器支持以下操作:通过调用 operator++ 向前移动一个位置、通过调用 operator-- 向后移动一个位置、通过使用 operator[] 访问元素以及通过使用指针算法访问元素。Random access iterators support the following operations: moving forward one position by calling operator++, moving backward one position by calling operator--, accessing an element by using operator[], and accessing an element by using pointer arithmetic.

generic <typename TValue>
public interface class IRandomAccessIterator : Microsoft::VisualC::StlClr::Generic::IBidirectionalIterator<TValue>
public interface IRandomAccessIterator<TValue> : Microsoft.VisualC.StlClr.Generic.IBidirectionalIterator<TValue>
type IRandomAccessIterator<'Value> = interface
    interface IBidirectionalIterator<'Value>
Public Interface IRandomAccessIterator(Of TValue)
Implements IBidirectionalIterator(Of TValue)

类型参数

TValue

受控序列中的元素的类型。The type of an element in the controlled sequence.

派生
实现

方法

Clone()

创建作为当前实例副本的新对象。Creates a new object that is a copy of the current instance.

(继承自 ICloneable)
container()

获取迭代器正在遍历的容器。Gets the container that the iterator is traversing.

(继承自 IBaseIterator<TValue>)
distance(IRandomAccessIterator<TValue>)

确定当前迭代器指向的元素与给定迭代器指向的元素之间的距离。Determines the distance between the element that the current iterator is pointing to and the element that the given iterator is pointing to.

equal_to(IInputIterator<TValue>)

确定两个 IInputIterator<TValue> 对象是否相等。Determines whether two IInputIterator<TValue> objects are equal.

(继承自 IInputIterator<TValue>)
get_bias()

获取迭代器的偏移。Gets the bias of the iterator. 偏移是迭代器相对于元素零的偏移量。The bias is the offset of the iterator from element zero.

(继承自 IBaseIterator<TValue>)
get_cref()

返回对迭代器当前指向的元素的常量引用。Returns a constant reference to the element that the iterator is currently pointing to.

(继承自 IInputIterator<TValue>)
get_node()

获取迭代器指向的节点或元素。Gets the node, or element, that the iterator is pointing to.

(继承自 IBaseIterator<TValue>)
get_ref()

返回对迭代器当前指向的元素的引用。Returns a reference to the element that the iterator is currently pointing to.

(继承自 IOutputIterator<TValue>)
less_than(IRandomAccessIterator<TValue>)

确定容器中当前迭代器指向的元素是否位于给定迭代器指向的元素之前。Determines whether the current iterator is pointing to an element in the container that precedes the element that the given iterator points to.

move(Int32)

按给定的元素数移动迭代器。Moves the iterator by the given number of elements.

next()

将迭代器递增到基础容器中的下一个位置,如果已完全遍历该容器,则递增到容器末尾以外的第一个位置。Increments the iterator to the next position in the underlying container, or to the first position beyond the end of container if the container has been completely traversed.

(继承自 IBaseIterator<TValue>)
prev()

将迭代器定位到紧靠当前元素之前的元素。Positions the iterator to the element immediately before the current element.

(继承自 IBidirectionalIterator<TValue>)
valid()

确定迭代器是否有效并可安全用于遍历基础容器。Determines whether the iterator is valid and can be safely used to traverse the underlying container.

(继承自 IBaseIterator<TValue>)

适用于