Muokkaa

Jaa


Platform::Collections::VectorViewIterator Class

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

ViewVectorIterator 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>
class VectorViewIterator;

Parameters

T
The typename of the VectorViewIterator template class.

Members

Public Typedefs

Name Description
difference_type A pointer difference (ptrdiff_t).
iterator_category The category of a random access iterator (::std::random_access_iterator_tag).
pointer A pointer to an internal type that is required for the implementation of VectorViewIterator.
reference A reference to an internal type that is required for the implementation of VectorViewIterator.
value_type The T typename.

Public Constructors

Name Description
VectorViewIterator::VectorViewIterator Initializes a new instance of the VectorViewIterator class.

Public Operators

Name Description
VectorViewIterator::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.
VectorViewIterator::operator-- Operator Decrements the current VectorViewIterator.
VectorViewIterator::operator!= Operator Indicates whether the current VectorViewIterator is not equal to a specified VectorViewIterator.
VectorViewIterator::operator* Operator Retrieves a reference to the element specified by the current VectorViewIterator.
VectorViewIterator::operator[] Retrieves a reference to the element that is a specified displacement from the current VectorViewIterator.
VectorViewIterator::operator+ Operator Returns a VectorViewIterator that references the element at the specified displacement from the specified VectorViewIterator.
VectorViewIterator::operator++ Operator Increments the current VectorViewIterator.
VectorViewIterator::operator+= Operator Increments the current VectorViewIterator by the specified displacement.
VectorViewIterator::operator< Operator Indicates whether the current VectorViewIterator is less than a specified VectorViewIterator.
VectorViewIterator::operator<= Operator Indicates whether the current VectorViewIterator is less than or equal to a specified VectorViewIterator.
VectorViewIterator::operator-= Operator Decrements the current VectorViewIterator by the specified displacement.
VectorViewIterator::operator== Operator Indicates whether the current VectorViewIterator is equal to a specified VectorViewIterator.
VectorViewIterator::operator> Operator Indicates whether the current VectorViewIterator is greater than a specified VectorViewIterator.
VectorViewIterator::operator-> Operator Retrieves the address of the element referenced by the current VectorViewIterator.
VectorViewIterator::operator>= Operator Indicates whether the current VectorViewIterator is greater than or equal to a specified VectorViewIterator.

Inheritance Hierarchy

VectorViewIterator

Requirements

Header: collection.h

Namespace: Platform::Collections

VectorViewIterator::operator-> Operator

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

Syntax

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

Return Value

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

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

VectorViewIterator::operator-- Operator

Decrements the current VectorViewIterator.

Syntax

VectorViewIterator& operator--();
VectorViewIterator operator--(int);

Return Value

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

Remarks

The first VectorViewIterator syntax pre-decrements the current VectorViewIterator.

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

VectorViewIterator::operator* Operator

Retrieves a reference to the element specified by the current VectorViewIterator.

Syntax

reference operator*() const;

Return Value

The element specified by the current VectorViewIterator.

VectorViewIterator::operator== Operator

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

Syntax

bool operator==(const VectorViewIterator& other) const;

Parameters

other
Another VectorViewIterator.

Return Value

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

VectorViewIterator::operator> Operator

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

Syntax

bool operator>(const VectorViewIterator& other) const;

Parameters

other
Another VectorViewIterator.

Return Value

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

VectorViewIterator::operator>= Operator

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

Syntax

bool operator>=(const VectorViewIterator& other) const;

Parameters

other
Another VectorViewIterator.

Return Value

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

VectorViewIterator::operator++ Operator

Increments the current VectorViewIterator.

Syntax

VectorViewIterator& operator++();
VectorViewIterator operator++(int);

Return Value

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

Remarks

The first VectorViewIterator syntax pre-increments the current VectorViewIterator.

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

VectorViewIterator::operator!= Operator

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

Syntax

bool operator!=(const VectorViewIterator& other) const;

Parameters

other
Another VectorViewIterator.

Return Value

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

VectorViewIterator::operator< Operator

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

Syntax

bool operator<(const VectorViewIterator& other) const;

Parameters

other
Another VectorIterator.

Return Value

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

VectorViewIterator::operator<= Operator

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

Syntax

bool operator<=(const VectorViewIterator& other) const;

Parameters

other
Another VectorIterator.

Return Value

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

VectorViewIterator::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

VectorViewIterator operator-(difference_type n) const;

difference_type operator-(const VectorViewIterator& other) const;

Parameters

n
A number of elements.

other
Another VectorViewIterator.

Return Value

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

VectorViewIterator::operator+= Operator

Increments the current VectorViewIterator by the specified displacement.

Syntax

VectorViewIterator& operator+=(difference_type n);

Parameters

n
A integer displacement.

Return Value

The updated VectorViewIterator.

VectorViewIterator::operator+ Operator

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

Syntax

VectorViewIterator operator+(difference_type n) const;

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

Parameters

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

n
An integer displacement.

i
In the second syntax, a VectorViewIterator.

Return Value

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

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

VectorViewIterator::operator-= Operator

Decrements the current VectorIterator by the specified displacement.

Syntax

VectorViewIterator& operator-=(difference_type n);

Parameters

n
An integer displacement.

Return Value

The updated VectorIterator.

VectorViewIterator::operator[]

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

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

VectorViewIterator::VectorViewIterator Constructor

Initializes a new instance of the VectorViewIterator class.

Syntax

VectorViewIterator();

explicit VectorViewIterator(
   Windows::Foundation::Collections::IVectorView<T>^ v
);

Parameters

v
An IVectorView<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 VectorViewIterator from an IVectorView<T> object.

See also

Platform Namespace