System::Collections::Concurrent::ConcurrentDictionary::TryAdd method

ConcurrentDictionary::TryAdd method

尝试向字典中添加键/值对。

bool System::Collections::Concurrent::ConcurrentDictionary<TKey, TValue>::TryAdd(const TKey &key, const TValue &value)
ParameterType描述
const TKey&要添加的键。
valueconst TValue&要添加的值。

ReturnValue

如果键/值对成功添加则为 True,否则为 false。

另见