System.Generics.Collections.TArray.LastIndexOf

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

class function LastIndexOf<T>(const Values: array of T; const Item: T): NativeInt; overload; static;
class function LastIndexOf<T>(const Values: array of T; const Item: T;
Index: NativeInt): NativeInt; overload; static;
class function LastIndexOf<T>(const Values: array of T; const Item: T;
const Comparer: IComparer<T>; Index, Count: NativeInt): NativeInt; overload; static;

C++

template<typename T> static System::NativeInt __fastcall LastIndexOf(const T *Values, const System::NativeInt Values_High, const T Item)/* overload */;
template<typename T> static System::NativeInt __fastcall LastIndexOf(const T *Values, const System::NativeInt Values_High, const T Item, System::NativeInt Index)/* overload */;
template<typename T> static System::NativeInt __fastcall LastIndexOf(const T *Values, const System::NativeInt Values_High, const T Item, const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > Comparer, System::NativeInt Index, System::NativeInt Count)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TArray


説明

配列内にある Value の最後のインスタンスに対する 0 から始まるインデックスを取得します。 要素が見つからない場合は、-1 を返します。

要素の検索はリニアなので、これは、n エントリを持つ配列に対する O(n) 操作になります。


関連項目