method Set.remove
Removes x; true when it was in the set.
Example:
fn main() io {
var s: Set<i32> = Set.new()
s.insert(5)
print("{s.remove(5)} {s.remove(5)}")
}Вывод
true false
Removes x; returns false when it was not in the set.
Example:
fn main() io {
var s = Set<i32>.new()
s.insert(1)
print("{s.remove(1)} {s.remove(1)}")
}Вывод
true false
pub(api) var fn remove(x: T) -> boolСложность. O(1) on average.
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
x | T |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/collections.oxl:1074