TryAdd()
Contents
[
Hide
]System::Text::Json::JsonCollectionExtensions::TryAdd(const TCollection&, const TKey&, const TValue&) function
Attempts to add the specified key and value to the dictionary, returning true on success.
template<typename TCollection,typename TKey,typename TValue> bool System::Text::Json::JsonCollectionExtensions::TryAdd(const TCollection &dictionary, const TKey &key, const TValue &value)
Template parameters
| Parameter | Description |
|---|---|
| TCollection | The dictionary-like collection type. |
| TKey | The key type. |
| TValue | The value type. |
Arguments
| Parameter | Type | Description |
|---|---|---|
| dictionary | const TCollection& | The dictionary to add the pair to. |
| key | const TKey& | The key to add. |
| value | const TValue& | The value to add. |
Return Value
True if the pair was added, false if the key already existed.
See Also
- Namespace System::Text::Json::JsonCollectionExtensions
- Library Aspose.Slides