all method

bool all(
  1. bool predicate(
    1. T element
    )
)

Returns true if all elements match the given predicate.

Implementation

bool all(bool Function(T element) predicate) {
  if (this is KtCollection && (this as KtCollection).isEmpty()) return true;
  for (final element in iter) {
    if (!predicate(element)) {
      return false;
    }
  }
  return true;
}