add


Description:

public bool add (owned T element)

Adds an element to the set. If the element already exists, the set is not modified.

Example:

    var set = new HashSet<string> (GLib.str_hash, GLib.str_equal);
assert (set.add ("apple"));
assert (!set.add ("apple"));
assert (set.size () == 1);

Parameters:

element

the element to add.

Returns:

true if the element was added, false if already present.