insert method

bool insert(
  1. T element
)

Inserts a new element into the set. Time complexity: O(log N).

Returns true if the element was added, or false if it was already present.

Implementation

bool insert(T element) {
  return _container.add(element);
}