IRandomAccessIterator<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.

public:
 int distance(Microsoft::VisualC::StlClr::Generic::IRandomAccessIterator<TValue> ^ _Right);
public int distance (Microsoft.VisualC.StlClr.Generic.IRandomAccessIterator<TValue> _Right);
abstract member distance : Microsoft.VisualC.StlClr.Generic.IRandomAccessIterator<'Value> -> int
Public Function distance (_Right As IRandomAccessIterator(Of TValue)) As Integer

参数

_Right
IRandomAccessIterator<TValue>

一个有效迭代器,与当前迭代器指向同一个容器。A valid iterator that points to the same container as the current iterator.

返回

当前迭代器指向的元素与 _Right 指向的元素之间的距离,以元素数为单位。The distance, in number of elements, between the element that the current iterator is pointing to and the element that _Right is pointing to. 如果 _Right 指向的元素位于当前迭代器指向的元素之前,则此数字为负数。This number is negative if _Right points to an element that is before the element that the current iterator points to.

适用于