CollectionsMarshal.GetValueRefOrNullRef<TKey,TValue> メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
内への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<TKey,TValue>参照、または .. に存在dictionary
しない場合は参照null
。
注釈
ref TValue
が使用中の間は、項目をDictionary<TKey,TValue>追加したり削除したりしないでください。
ref null
は呼び出 System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T)すことによって検出できます。