다음을 통해 공유


CollectionsMarshal.GetValueRefOrNullRef<TKey,TValue> 메서드

정의

의 에 대한 참조 TValue 또는 에 Dictionary<TKey,TValue> 없는 경우 참조 nulldictionary가져옵니다.

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> 없는 경우 참조 null 입니다 dictionary.

설명

ref TValue 를 사용하는 동안 항목은 에서 Dictionary<TKey,TValue> 추가하거나 제거해서는 안 됩니다.

참조 null 는 를 호출 System.Runtime.CompilerServices.Unsafe.IsNullRef<T>(T)하여 검색할 수 있습니다.

적용 대상