toggle method
add or remove given value from current Set
the value will removed if it was already included in Set
Implementation
bool toggle(T value) {
if (contains(value)) {
remove(value);
return false;
}
add(value);
return true;
}
add or remove given value from current Set
the value will removed if it was already included in Set
bool toggle(T value) {
if (contains(value)) {
remove(value);
return false;
}
add(value);
return true;
}