Windows Dev Center

IVector<T>.IndexOf method

Retrieves the index of a specified item in the vector.

Syntax


bool IndexOf(
  T^ value, 
  [OutAttribute] unsigned int index
)

Parameters

value

Type: T

The item to find in the vector.

index (out parameter)

Type: UInt32

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Return value

Type: Boolean

true if the item is found; otherwise, false.

Remarks

When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.IList<T> interface.

If the index parameter is 0, it indicates that the item is the first item in the array or that the item was not found. To determine whether the item found is the first item, check the return value of this method before you check the index parameter. If the return value is true and index is 0, then the item is the first item in the array. If the return value is false, then the item was not found and index is 0.

Requirements (Windows 10 device family)

Device family

API contract

Namespace

Windows::Foundation::Collections

Metadata

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

Namespace

Windows::Foundation::Collections

Metadata

Windows.winmd

See also

IVector<T>

 

 

Show:
© 2015 Microsoft