llvm::hasNItemsOrLess

hasNItemsOrLess overloads

Synopses

Declared in <llvm/ADT/STLExtras.h>

Return true if container C has at most N items.

template<typename ContainerTy>
bool
hasNItemsOrLess(
    ContainerTy&& C,
    unsigned int N);
» more...

Return true if []Begin, End) contains at most N counted items.

template<
    typename IterTy,
    typename Pred = bool(*)( constdecltype(*std::declval<IterTy>())&)>
bool
hasNItemsOrLess(
    IterTy&& Begin,
    IterTy&& End,
    unsigned int N,
    Pred&& ShouldBeCounted = [](const decltype(*std::declval<IterTy>()) &) {
      return true;
    });
» more...

Return Value

  • True if C has at most N items.
  • True if the range contains at most N counted items.

Parameters

NameDescription
CContainer to inspect.
NMaximum number of items allowed.
BeginIterator to the first element.
EndIterator past the last element.
ShouldBeCountedPredicate selecting which items count toward N.