CollectionsMarshal.GetValueRefOrNullRef<TKey,TValue> メソッド

定義

内へのTValueDictionary<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

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

注釈

ref TValue が使用中の間は、項目をDictionary<TKey,TValue>追加したり削除したりしないでください。

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

適用対象