TryAdd()

HashSet::TryAdd(const T&) method

Adds element into set.

bool System::Collections::Generic::HashSet<T>::TryAdd(const T &item)

Arguments

ParameterTypeDescription
itemconst T&Item to add.

Return Value

True if element was added, false if already exists.

See Also