System::Collections::Concurrent::ConcurrentDictionary::TryAdd 方法

ConcurrentDictionary::TryAdd method

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

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

ReturnValue

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

另见