Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public interface class IVectorView : IIterable<T>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)] /// [Windows.Foundation.Metadata.Guid(3152149068, 45283, 17795, 186, 239, 31, 27, 46, 72, 62, 86)] template <typename T> struct IVectorView : IIterable<T>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)] [Windows.Foundation.Metadata.Guid(3152149068, 45283, 17795, 186, 239, 31, 27, 46, 72, 62, 86)] public interface IReadOnlyList<T> : IEnumerable<T>
Public Interface IReadOnlyList(Of T) Implements IEnumerable(Of T)
Windows 10 (introduced in 10.0.10240.0)
Windows.Foundation.FoundationContract (introduced in v1.0)
For read-write collections, the IVectorView<T> interface is still relevant, because the IVector.GetView method returns an IVectorView<T> instance.
If the underlying collection changes, methods and properties of the IVectorView<T> interface may throw an exception.
C++/WinRT If the underlying collection has changed, methods and properties may throw a
C++/CX If the underlying collection has changed, methods and properties may throw a
When programming with .NET, this interface is hidden and developers should use the IReadOnlyList<T> interface if they want to implement a read-only vector/list type. In any case where a Windows Runtime type has implemented IVectorView<T>, .NET code can use the APIs of IReadOnlyList<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.
C++/WinRT extension functions
Extension functions exist on the C++/WinRT projection types for certain Windows Runtime APIs. For example, winrt::Windows::Foundation::IAsyncAction is the C++/WinRT projection type for IAsyncAction. The extension functions aren't part of the application binary interface (ABI) surface of the actual Windows Runtime types, so they're not listed as members of the Windows Runtime APIs. But you can call them from within any C++/WinRT project. See C++/WinRT functions that extend Windows Runtime APIs.
auto begin() const;
Returns an iterator to the first element of the collection, for use in C++ algorithms such as range-based
auto end() const;
Returns an iterator to one past the last element of the collection, for use in C++ algorithms such as range-based
Gets the number of items in the vector view.
Returns the item at the specified index in the vector view.
Retrieves multiple items from the vector view beginning at the given index.
Retrieves the index of a specified item in the vector view.