Skip to content

Latest commit

 

History

History
402 lines (246 loc) · 11.6 KB

platform-collections-vectoriterator-class.md

File metadata and controls

402 lines (246 loc) · 11.6 KB
titledescriptionms.datems.topicf1_keywordshelpviewer_keywords
Platform::Collections::VectorIterator class
Learn more about: Platform::Collections::VectorIterator Class
03/27/2019
reference
COLLECTION/Platform::Collections::VectorIterator::VectorIterator
VectorIterator Class

Platform::Collections::VectorIterator class

Provides a Standard Template Library iterator for objects derived from the Windows Runtime IVector interface.

VectorIterator is a proxy iterator that stores elements of type VectorProxy<T>. However, the proxy object is almost never visible to user code. For more information, see Collections (C++/CX).

Syntax

template <typename T> classVectorIterator;

Parameters

T
The typename of the VectorIterator template class.

Members

Public Typedefs

NameDescription
difference_typeA pointer difference (ptrdiff_t).
iterator_categoryThe category of a random access iterator (::std::random_access_iterator_tag).
pointerA pointer to an internal type, Platform::Collections::Details::VectorProxy<T>, that is required for the implementation of VectorIterator.
referenceA reference to an internal type, Platform::Collections::Details::VectorProxy<T>, that is required for the implementation of VectorIterator.
value_typeThe T typename.

Public constructors

NameDescription
VectorIterator::VectorIteratorInitializes a new instance of the VectorIterator class.

Public operators

NameDescription
VectorIterator::operator- OperatorSubtracts either a specified number of elements from the current iterator yielding a new iterator, or a specified iterator from the current iterator yielding the number of elements between the iterators.
VectorIterator::operator-- OperatorDecrements the current VectorIterator.
VectorIterator::operator!= OperatorIndicates whether the current VectorIterator is not equal to a specified VectorIterator.
VectorIterator::operator* OperatorRetrieves a reference to the element specified by the current VectorIterator.
VectorIterator::operator[]Retrieves a reference to the element that is a specified displacement from the current VectorIterator.
VectorIterator::operator+ OperatorReturns a VectorIterator that references the element at the specified displacement from the specified VectorIterator.
VectorIterator::operator++ OperatorIncrements the current VectorIterator.
VectorIterator::operator+= OperatorIncrements the current VectorIterator by the specified displacement.
VectorIterator::operator< OperatorIndicates whether the current VectorIterator is less than a specified VectorIterator.
VectorIterator::operator<= OperatorIndicates whether the current VectorIterator is less than or equal to a specified VectorIterator.
VectorIterator::operator-= OperatorDecrements the current VectorIterator by the specified displacement.
VectorIterator::operator== OperatorIndicates whether the current VectorIterator is equal to a specified VectorIterator.
VectorIterator::operator> OperatorIndicates whether the current VectorIterator is greater than a specified VectorIterator.
VectorIterator::operator-> OperatorRetrieves the address of the element referenced by the current VectorIterator.
VectorIterator::operator>= OperatorIndicates whether the current VectorIterator is greater than or equal to a specified VectorIterator.

Inheritance Hierarchy

VectorIterator

Requirements

Header:collection.h

Namespace:Platform::Collections

VectorIterator::operator-> operator

Retrieves the address of the element referenced by the current VectorIterator.

Syntax

Detail::ArrowProxy<T> operator->() const;

Return Value

The value of the element that is referenced by the current VectorIterator.

The type of the return value is an unspecified internal type that is required for the implementation of this operator.

VectorIterator::operator-- operator

Decrements the current VectorIterator.

Syntax

VectorIterator& operator--(); VectorIterator operator--(int);

Return Value

The first syntax decrements and then returns the current VectorIterator. The second syntax returns a copy of the current VectorIterator and then decrements the current VectorIterator.

Remarks

The first VectorIterator syntax pre-decrements the current VectorIterator.

The second syntax post-decrements the current VectorIterator. The int type in the second syntax indicates a post-decrement operation, not an actual integer operand.

VectorIterator::operator* operator

Retrieves the address of the element specified by the current VectorIterator.

Syntax

reference operator*() const;

Return Value

The element specified by the current VectorIterator.

VectorIterator::operator== operator

Indicates whether the current VectorIterator is equal to a specified VectorIterator.

Syntax

booloperator==(const VectorIterator& other) const;

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is equal to other; otherwise, false.

VectorIterator::operator> operator

Indicates whether the current VectorIterator is greater than a specified VectorIterator.

Syntax

booloperator>(const VectorIterator& other) const

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is greater than other; otherwise, false.

VectorIterator::operator>= operator

Indicates whether the current VectorIterator is greater than or equal to the specified VectorIterator.

Syntax

booloperator>=(const VectorIterator& other) const

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is greater than or equal to other; otherwise, false.

VectorIterator::operator++ operator

Increments the current VectorIterator.

Syntax

VectorIterator& operator++(); VectorIterator operator++(int);

Return Value

The first syntax increments and then returns the current VectorIterator. The second syntax returns a copy of the current VectorIterator and then increments the current VectorIterator.

Remarks

The first VectorIterator syntax pre-increments the current VectorIterator.

The second syntax post-increments the current VectorIterator. The int type in the second syntax indicates a post-increment operation, not an actual integer operand.

VectorIterator::operator!= operator

Indicates whether the current VectorIterator is not equal to a specified VectorIterator.

Syntax

booloperator!=(const VectorIterator& other) const;

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is not equal to other; otherwise, false.

VectorIterator::operator< operator

Indicates whether the current VectorIterator is less than a specified VectorIterator.

Syntax

booloperator<(const VectorIterator& other) const

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is less than other; otherwise, false.

VectorIterator::operator<= operator

Indicates whether the current VectorIterator is less than or equal to a specified VectorIterator.

Syntax

booloperator<=(const VectorIterator& other) const

Parameters

other
Another VectorIterator.

Return Value

true if the current VectorIterator is less than or equal to other; otherwise, false.

VectorIterator::operator- operator

Subtracts either a specified number of elements from the current iterator yielding a new iterator, or a specified iterator from the current iterator yielding the number of elements between the iterators.

Syntax

VectorIterator operator-(difference_type n) const; difference_type operator-(const VectorIterator& other) const;

Parameters

n
A number of elements.

other
Another VectorIterator.

Return Value

The first operator syntax returns a VectorIterator object that is n elements less than the current VectorIterator. The second operator syntax returns the number of elements between the current and the otherVectorIterator.

VectorIterator::operator+= operator

Increments the current VectorIterator by the specified displacement.

Syntax

VectorIterator& operator+=(difference_type n);

Parameters

n
A integer displacement.

Return Value

The updated VectorIterator.

VectorIterator::operator+ operator

Returns a VectorIterator that references the element at the specified displacement from the specified VectorIterator.

Syntax

VectorIterator operator+(difference_type n); template <typename T> inline VectorIterator<T> operator+( ptrdiff_t n, const VectorIterator<T>& i);

Parameters

T
In the second syntax, the typename of the VectorIterator.

n
An integer displacement.

i
In the second syntax, a VectorIterator.

Return Value

In the first syntax, a VectorIterator that references the element at the specified displacement from the current VectorIterator.

In the second syntax, a VectorIterator that references the element at the specified displacement from the beginning of parameter i.

Remarks

The first syntax example

VectorIterator::operator-= operator

Decrements the current VectorIterator by the specified displacement.

Syntax

VectorIterator& operator-=(difference_type n);

Parameters

n
An integer displacement.

Return Value

The updated VectorIterator.

VectorIterator::operator[] operator

Retrieves a reference to the element that is a specified displacement from the current VectorIterator.

Syntax

reference operator[](difference_type n) const;

Parameters

n
An integer displacement.

Return Value

The element that is displaced by n elements from the current VectorIterator.

VectorIterator::VectorIterator constructor

Initializes a new instance of the VectorIterator class.

Syntax

VectorIterator(); explicitVectorIterator( Windows::Foundation::Collections::IVector<T>^ v);

Parameters

v
An IVector<T> object.

Remarks

The first syntax example is the default constructor. The second syntax example is an explicit constructor that is used to construct a VectorIterator from an IVector<T> object.

See also

Platform Namespace

close