Windows Dev Center

Vector::First Method

Returns an iterator that points to the first element in the Vector.

virtual Windows::Foundation::Collections::IIterator <T>^ 
   First();

An iterator that points to the first element in the Vector.

A convenient way to hold the iterator returned by First() is to assign the return value to a variable that is declared with the auto type deduction keyword. For example, auto x = myVector->First();. This iterator knows the length of the collection.

When you need a pair of iterators to pass to an STL function, use the free functions Windows::Foundation::Collections::begin and Windows::Foundation::Collections::end

Header: collection.h

Namespace: Platform::Collections

Show:
© 2015 Microsoft