OxL Справочник OxL
РусскийEnglish

method Set.remove

Removes x; true when it was in the set.

Example:

oxl✓ проверяется в CI
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:

oxl✓ проверяется в CI
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

Параметры

ИмяТип
xT

Возвращает

bool

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/collections.oxl:1074

См. также