次の方法で共有


CollectionsMarshal.GetValueRefOrNullRef メソッド

定義

オーバーロード

GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)
GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey)

内の への TValue 参照を取得するか、 に Dictionary<TKey,TValue> 存在しない場合は参照 null を取得します dictionary

GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)

public:
generic <typename TKey, typename TValue, typename TAlternateKey>
 static TValue % GetValueRefOrNullRef(System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> dictionary, TAlternateKey key);
public static ref TValue GetValueRefOrNullRef<TKey,TValue,TAlternateKey> (System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> dictionary, TAlternateKey key);
static member GetValueRefOrNullRef : System.Collections.Generic.Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey> * 'AlternateKey -> 'Value
Public Shared Function GetValueRefOrNullRef(Of TKey, TValue, TAlternateKey) (dictionary As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey), key As TAlternateKey) As TValue

型パラメーター

TKey
TValue
TAlternateKey

パラメーター

key
TAlternateKey

戻り値

TValue

適用対象

GetValueRefOrNullRef<TKey,TValue>(Dictionary<TKey,TValue>, TKey)

ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs

内の への TValue 参照を取得するか、 に Dictionary<TKey,TValue> 存在しない場合は参照 null を取得します dictionary

public:
generic <typename TKey, typename TValue>
 static TValue % GetValueRefOrNullRef(System::Collections::Generic::Dictionary<TKey, TValue> ^ dictionary, TKey key);
public static ref TValue GetValueRefOrNullRef<TKey,TValue> (System.Collections.Generic.Dictionary<TKey,TValue> dictionary, TKey key);
static member GetValueRefOrNullRef : System.Collections.Generic.Dictionary<'Key, 'Value> * 'Key -> 'Value
Public Shared Function GetValueRefOrNullRef(Of TKey, TValue) (dictionary As Dictionary(Of TKey, TValue), key As TKey) As TValue

型パラメーター

TKey

キーの型。

TValue

値の型。

パラメーター

dictionary
Dictionary<TKey,TValue>

ref TValue の取得元のディクショナリ。

key
TKey

参照に使用されるキー。

戻り値

TValue

内の へのTValue参照、または 内に存在dictionaryしない場合は 参照nullDictionary<TKey,TValue>

注釈

ref TValue が使用されている間は、 からDictionary<TKey,TValue>項目を追加または削除しないでください。

ref null は を呼び出 System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T)すことによって検出できます。

適用対象