CollectionsMarshal.GetValueRefOrNullRef メソッド

定義

オーバーロード

名前 説明
GetValueRefOrNullRef<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey)

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

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

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

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

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

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

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) where TAlternateKey : allows ref struct;
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

ディクショナリ内の検索用の代替キーの型。

パラメーター

dictionary
Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

TValueの参照を取得するディクショナリ。

key
TAlternateKey

検索に使用されるキー。

返品

TValue

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

注釈

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

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

適用対象

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

ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
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>

TValueの参照を取得するディクショナリ。

key
TKey

検索に使用されるキー。

返品

TValue

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

注釈

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

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

適用対象