IVector<T> interface

IVector<T> interface

Represents a random-access collection of elements.

.NET:  This interface appears to .NET code as System.Collections.Generic.IList<T> due to .NET language projection. In any case where a Windows Runtime type has implemented IVector<T>, .NET code can use the APIs of IList<T> instead.


generic<typename T>
public interface class IVector : IIterable<T>

Type parameters


The type of the values in the vector.


The IVector interface inherits from IIterable(T). IVector also has these types of members:


The IVector interface has these methods. It also inherits methods from the Object class.

Append Appends an item to the end of the vector.
Clear Removes all items from the vector.
GetAt Returns the item at the specified index in the vector.
GetMany Retrieves the items that start at the specified index in the vector.
GetView Returns an immutable view of the vector.
IndexOf Retrieves the index of a specified item in the vector.
InsertAt Inserts an item at a specified index in the vector.
RemoveAt Removes the item at the specified index in the vector.
RemoveAtEnd Removes the last item from the vector.
ReplaceAll Replaces all the items in the vector with the specified items.
SetAt Sets the value at the specified index in the vector.



The IVector interface has these properties.

PropertyAccess typeDescription



Gets the number of items in the vector.



When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.IList<T> interface if they want to implement a vector/list type. In any case where a Windows Runtime type has implemented IVector<T>, .NET code can use the APIs of IList<T> instead. This includes all the existing Windows Runtime API and also scenarios such as using the APIs of Windows Runtime components originally implemented in Visual C++ component extensions (C++/CX) from a C# or Visual Basic app.

The IVector<T> interface represents a collection of objects of a specified type that can be individually accessed by index. Properties and methods of IVector<T> support list-type functionality, such as getting the size of the collection, and adding and removing items at specified locations in the collection. Additionally, the GetView method provides a snapshot of the vector whose observable state does not change. The snapshot is useful when you need a view of the collection to refer to in subsequent operations that involve IVector<T>.

Interface inheritance

IVector inherits IIterable. Types that implement IVector also implement the interface members of IIterable. Similarly, if you're using .NET, there is support for IEnumerable<T>.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.FoundationContract, introduced version 1.0





Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8







See also

Collections (C++/CX)



© 2016 Microsoft