Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ranges

Ranged Features

Index

Functions

adjacent_find

  • adjacent_find<Range>(range: Range, pred?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Find the first adjacent element.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value pred: Comparator<IForwardContainer.ValueType<Range>> = equal_to

      A binary function predicates two arguments are equal. Default is equal_to.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element of adjacent find.

all_of

  • all_of<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether all elements meet a specific condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns boolean

    Whether the pred returns always true for all elements.

any_of

  • any_of<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether any element meets a specific condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns boolean

    Whether the pred returns at least a true for all elements.

binary_search

  • binary_search<Range>(range: Range, val: IForwardContainer.ValueType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether a value exists in sorted range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      Value to search for.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether the value exists or not.

copy

  • copy<Range, OutputIterator>(range: Range, output: OutputIterator): OutputIterator
  • Copy elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

copy_backward

  • copy_backward<Range, OutputIterator>(range: Range, output: OutputIterator): OutputIterator

copy_if

  • copy_if<Range, OutputIterator>(range: Range, output: OutputIterator, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): OutputIterator
  • Copy specific elements by a condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

copy_n

  • copy_n<Range, OutputIterator>(range: Range, n: number, output: OutputIterator): OutputIterator
  • Copy n elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • n: number

      Number of elements to copy.

    • output: OutputIterator

      Output iterator of the first position.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

count

  • count<Range>(range: Range, val: IForwardContainer.ValueType<Range>): number
  • Count matched value in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      The value to count.

    Returns number

    The matched count.

count_if

  • count_if<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): number
  • Count matched condition in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns number

    The matched count.

equal

  • equal<Range1, Range2>(range1: Range1, range2: Range2): boolean
  • equal<Range1, Range2>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer<Range1, Range2>): boolean
  • Test whether two ranges are equal.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns boolean

    Whether two ranges are equal.

  • Test whether two ranges are equal.

    Type parameters

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • pred: BinaryPredicatorInferrer<Range1, Range2>

      A binary function predicates two arguments are equal.

    Returns boolean

    Whether two ranges are equal.

equal_range

  • equal_range<Range>(range: Range, val: IForwardContainer.ValueType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): Pair<IForwardContainer.IteratorType<Range>, IForwardContainer.IteratorType<Range>>
  • Get range of equal elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      Value to search for.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns Pair<IForwardContainer.IteratorType<Range>, IForwardContainer.IteratorType<Range>>

    Pair of lower_bound and upper_bound.

fill

  • fill<Range>(range: Range, value: IForwardContainer.ValueType<Range>): void
  • Fill range elements

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • value: IForwardContainer.ValueType<Range>

    Returns void

    Output Iterator of the last position by advancing.

fill_n

  • fill_n<Range>(range: Range, n: number, value: IForwardContainer.ValueType<Range>): IForwardContainer.IteratorType<Range>
  • Fill n elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • n: number

      Number of elements to fill.

    • value: IForwardContainer.ValueType<Range>

    Returns IForwardContainer.IteratorType<Range>

    Output Iterator of the last position by advancing.

find

  • find<Range>(range: Range, val: IForwardContainer.ValueType<Range>): IForwardContainer.IteratorType<Range>
  • Find a value in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      The value to find.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element to equal_to the value.

find_end

  • find_end<Range1, Range2>(range1: Range1, range2: Range2): IForwardContainer.IteratorType<Range1>
  • find_end<Range1, Range2>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer<Range1, Range2>): IForwardContainer.IteratorType<Range1>
  • Find the last sub range.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the last sub range.

  • Find the last sub range.

    Type parameters

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • pred: BinaryPredicatorInferrer<Range1, Range2>

      A binary function predicates two arguments are equal.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the last sub range.

find_first_of

  • find_first_of<Range1, Range2>(range1: Range1, range2: Range2): IForwardContainer.IteratorType<Range1>
  • find_first_of<Range1, Range2>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer<Range1, Range2>): IForwardContainer.IteratorType<Range1>
  • Find the first sub range.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the first sub range.

  • Find the first sub range.

    Type parameters

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • pred: BinaryPredicatorInferrer<Range1, Range2>

      A binary function predicates two arguments are equal.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the first sub range.

find_if

  • find_if<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Find a matched condition in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element pred returns true.

find_if_not

  • find_if_not<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Find a mismatched condition in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element pred returns false.

for_each

  • for_each<Range, Func>(range: Range, fn: Func): Func
  • Apply a function to elements in range.

    Type parameters

    • Range: Array<any> | IForwardContainer<any>

    • Func: (val: IForwardContainer.ValueType<Range>) => any

    Parameters

    • range: Range

      An iterable ranged container.

    • fn: Func

      The function to apply.

    Returns Func

    The function fn itself.

for_each_n

  • for_each_n<Range, Func>(range: Range, n: number, fn: Func): IForwardContainer.IteratorType<Range>
  • Apply a function to elements in steps.

    Type parameters

    • Range: Array<any> | IForwardContainer<any>

    • Func: (val: IForwardContainer.ValueType<Range>) => any

    Parameters

    • range: Range

      An iterable ranged container.

    • n: number

      Steps to maximum advance.

    • fn: Func

      The function to apply.

    Returns IForwardContainer.IteratorType<Range>

    Iterator advanced from first for n steps.

generate

  • generate<Range>(range: Range, gen: () => IForwardContainer.ValueType<Range>): void
  • Generate range elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • gen: () => IForwardContainer.ValueType<Range>

      The generator function.

        • (): IForwardContainer.ValueType<Range>
        • Returns IForwardContainer.ValueType<Range>

    Returns void

generate_n

  • generate_n<Range>(range: Range, n: number, gen: () => IForwardContainer.ValueType<Range>): IForwardContainer.IteratorType<Range>
  • Generate n elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • n: number

      Number of elements to generate.

    • gen: () => IForwardContainer.ValueType<Range>

      The generator function.

        • (): IForwardContainer.ValueType<Range>
        • Returns IForwardContainer.ValueType<Range>

    Returns IForwardContainer.IteratorType<Range>

    Forward Iterator to the last position by advancing.

includes

  • includes<Range1, Range2>(range1: Range1, range2: Range2, comp?: Comparator<IForwardContainer.ValueType<Range1>>): boolean
  • Test whether two sorted ranges are in inclusion relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether [first, last1) includes [first2, last2).

inplace_merge

  • inplace_merge<Range>(range: Range, middle: IteratorType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): void
  • Merge two sorted & consecutive ranges.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • middle: IteratorType<Range>

      Bidirectional iterator of the initial position of the 2nd range.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

is_heap

  • is_heap<Range>(range: Range, comp?: Comparator<ValueType<Range>>): boolean
  • Test whether a range is heap.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether the range is heap.

is_heap_until

  • Find the first element not in heap order.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IteratorType<Range>

    Iterator to the first element not in heap order.

is_partitioned

  • is_partitioned<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether a range is partitioned.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates partition. Returns true, if an element belongs to the first section, otherwise false which means the element belongs to the second section.

    Returns boolean

    Whether the range is partition or not.

is_permutation

  • is_permutation<Range1, Range2>(range1: Range1, range2: Range2, pred?: Comparator<IForwardContainer.ValueType<Range1>>): boolean
  • Test whether two ranges are in permutation relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • Default value pred: Comparator<IForwardContainer.ValueType<Range1>> = <any>equal_to

      A binary function predicates two arguments are equal. Default is equal_to.

    Returns boolean

    Whether permutation or not.

is_sorted

  • is_sorted<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether a range is sorted.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether sorted or not.

is_sorted_until

  • is_sorted_until<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Find the first unsorted element in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element who violates the order.

lexicographical_compare

  • lexicographical_compare<Range1, Range2>(range1: Range1, range2: Range2, comp?: BinaryPredicatorInferrer<Range1, Range1>): boolean
  • Compare lexicographically.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • Default value comp: BinaryPredicatorInferrer<Range1, Range1> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether the 1st range precedes the 2nd.

lower_bound

  • lower_bound<Range>(range: Range, val: IForwardContainer.ValueType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Get iterator to lower bound.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      Value to search for.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element equal or after the val.

make_heap

  • make_heap<Range>(range: Range, comp?: Comparator<ValueType<Range>>): void
  • Make a heap.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

max_element

  • max_element<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Get the maximum element in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the maximum element.

merge

  • merge<Range1, Range2, OutputIterator>(range1: Range1, range2: Range2, output: OutputIterator, comp?: Comparator<IForwardContainer.ValueType<Range1>>): OutputIterator
  • Merge two sorted ranges.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    • OutputIterator: Writeonly<IForwardIterator<IForwardContainer.ValueType<Range1>, OutputIterator>>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

min_element

  • min_element<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Get the minimum element in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the minimum element.

minmax_element

  • minmax_element<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): Pair<IForwardContainer.IteratorType<Range>, IForwardContainer.IteratorType<Range>>
  • Get the minimum & maximum elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns Pair<IForwardContainer.IteratorType<Range>, IForwardContainer.IteratorType<Range>>

    A Pair of iterators to the minimum & maximum elements.

mismatch

  • mismatch<Range1, Range2>(range1: Range1, range2: Range2): Pair<IForwardContainer.IteratorType<Range1>, IForwardContainer.IteratorType<Range2>>
  • mismatch<Range1, Range2>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer<Range1, Range2>): Pair<IForwardContainer.IteratorType<Range1>, IForwardContainer.IteratorType<Range2>>
  • Find the first mistmached position between two ranges.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: Array<any> | IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns Pair<IForwardContainer.IteratorType<Range1>, IForwardContainer.IteratorType<Range2>>

    A Pair of mismatched positions.

  • Find the first mistmached position between two ranges.

    Type parameters

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • pred: BinaryPredicatorInferrer<Range1, Range2>

      A binary function predicates two arguments are equal.

    Returns Pair<IForwardContainer.IteratorType<Range1>, IForwardContainer.IteratorType<Range2>>

    A Pair of mismatched positions.

next_permutation

  • next_permutation<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): boolean
  • Transform to the next permutation.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether the transformation was meaningful.

none_of

  • none_of<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): boolean
  • Test whether any element doesn't meet a specific condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      A function predicates the specific condition.

    Returns boolean

    Whether the pred doesn't return true for all elements.

nth_element

  • nth_element<Range>(range: Range, nth: IteratorType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): void
  • Rearrange for the n'th element.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • nth: IteratorType<Range>

      Random access iterator the n'th position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

partial_sort

  • partial_sort<Range>(range: Range, middle: IteratorType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): void
  • Sort elements in range partially.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • middle: IteratorType<Range>

      Random access iterator of the middle position between [first, last). Elements only in [first, middle) are fully sorted.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

partial_sort_copy

  • partial_sort_copy<Range, Output>(range: Range, output: Output, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Output>
  • Copy elements in range with partial sort.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container of input.

    • output: Output

      An iterable ranged container of output.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

    Returns IForwardContainer.IteratorType<Output>

    Output Iterator of the last position by advancing.

partition

  • partition<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IteratorType<Range>
  • Partition a range into two sections.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates partition. Returns true, if an element belongs to the first section, otherwise false which means the element belongs to the second section.

    Returns IteratorType<Range>

    Iterator to the first element of the second section.

partition_copy

  • partition_copy<Range, OutputIterator1, OutputIterator2>(range: Range, output_true: OutputIterator1, output_false: OutputIterator2, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): Pair<OutputIterator1, OutputIterator2>
  • Partition a range into two outputs.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output_true: OutputIterator1

      Output iterator to the first position for the first section.

    • output_false: OutputIterator2

      Output iterator to the first position for the second section.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates partition. Returns true, if an element belongs to the first section, otherwise false which means the element belongs to the second section.

    Returns Pair<OutputIterator1, OutputIterator2>

    Iterator to the first element of the second section.

partition_point

  • partition_point<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Get partition point.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates partition. Returns true, if an element belongs to the first section, otherwise false which means the element belongs to the second section.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element of the second section.

pop_heap

  • pop_heap<Range>(range: Range, comp?: Comparator<ValueType<Range>>): void
  • Pop an element from heap.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

prev_permutation

  • prev_permutation<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): boolean
  • Transform to the previous permutation.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns boolean

    Whether the transformation was meaningful.

push_heap

  • push_heap<Range>(range: Range, comp?: Comparator<ValueType<Range>>): void
  • Push an element into heap.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

remove

  • remove<Range>(range: Range, val: IForwardContainer.ValueType<Range>): IForwardContainer.IteratorType<Range>
  • Remove specific value in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      The specific value to remove.

    Returns IForwardContainer.IteratorType<Range>

    Iterator tho the last element not removed.

remove_copy

  • remove_copy<Range, OutputIterator>(range: Range, output: OutputIterator, val: IForwardContainer.ValueType<Range>): OutputIterator
  • Copy range removing specific value.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the last position.

    • val: IForwardContainer.ValueType<Range>

      The condition predicates remove.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

remove_copy_if

  • remove_copy_if<Range, OutputIterator>(range: Range, output: OutputIterator, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): OutputIterator
  • Copy range removing elements by a condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the last position.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates remove.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

remove_if

  • remove_if<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Remove elements in range by a condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates remove.

    Returns IForwardContainer.IteratorType<Range>

    Iterator tho the last element not removed.

replace

  • replace<Range>(range: Range, old_val: IForwardContainer.ValueType<Range>, new_val: IForwardContainer.ValueType<Range>): void
  • Replace specific value in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • old_val: IForwardContainer.ValueType<Range>

      Specific value to change

    • new_val: IForwardContainer.ValueType<Range>

      Specific value to be changed.

    Returns void

replace_copy

  • replace_copy<Range, OutputIterator>(range: Range, output: OutputIterator, old_val: IForwardContainer.ValueType<Range>, new_val: IForwardContainer.ValueType<Range>): OutputIterator
  • Copy range replacing specific value.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • old_val: IForwardContainer.ValueType<Range>

      Specific value to change

    • new_val: IForwardContainer.ValueType<Range>

      Specific value to be changed.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

replace_copy_if

  • replace_copy_if<Range, OutputIterator>(range: Range, output: OutputIterator, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>, new_val: IForwardContainer.ValueType<Range>): OutputIterator
  • Copy range replacing specfic condition.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates the change.

    • new_val: IForwardContainer.ValueType<Range>

      Specific value to be changed.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

replace_if

  • replace_if<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>, new_val: IForwardContainer.ValueType<Range>): void
  • Replace specific condition in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates the change.

    • new_val: IForwardContainer.ValueType<Range>

      Specific value to be changed.

    Returns void

reverse

  • reverse<Range>(range: Range): void

reverse_copy

  • reverse_copy<Range, OutputIterator>(range: Range, output: OutputIterator): OutputIterator
  • Copy reversed elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

rotate

  • rotate<Range>(range: Range, middle: IForwardContainer.IteratorType<Range>): IForwardContainer.IteratorType<Range>
  • Rotate elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • middle: IForwardContainer.IteratorType<Range>

      Input iteartor of the initial position of the right side.

    Returns IForwardContainer.IteratorType<Range>

    Input iterator of the final position in the left side; middle.

rotate_copy

  • rotate_copy<Range, OutputIterator>(range: Range, middle: IForwardContainer.IteratorType<Range>, output: OutputIterator): OutputIterator
  • Copy rotated elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • middle: IForwardContainer.IteratorType<Range>

      Input iteartor of the initial position of the right side.

    • output: OutputIterator

      Output iterator of the last position.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

sample

  • sample<Range, OutputIterator>(range: Range, first: OutputIterator, n: number): OutputIterator
  • Pick sample elements up.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • first: OutputIterator
    • n: number

      Number of elements to pick up.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

search

  • search<Range1, Range2>(range1: Range1, range2: Range2): IForwardContainer.IteratorType<Range1>
  • search<Range1, Range2>(range1: Range1, range2: Range2, pred: BinaryPredicatorInferrer<Range1, Range2>): IForwardContainer.IteratorType<Range1>
  • Search sub range.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: Array<any> | IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the sub range.

  • Search sub range.

    Type parameters

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • pred: BinaryPredicatorInferrer<Range1, Range2>

      A binary function predicates two arguments are equal.

    Returns IForwardContainer.IteratorType<Range1>

    Iterator to the first element of the sub range.

search_n

  • search_n<Range>(range: Range, count: number, val: IForwardContainer.ValueType<Range>, pred?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Search specific and repeated elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • count: number

      Count to be repeated.

    • val: IForwardContainer.ValueType<Range>

      Value to search.

    • Default value pred: Comparator<IForwardContainer.ValueType<Range>> = equal_to

      A binary function predicates two arguments are equal. Default is equal_to.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element of the repetition.

set_difference

  • set_difference<Range1, Range2, OutputIterator>(range1: Range1, range2: Range2, output: OutputIterator, comp?: Comparator<IForwardContainer.ValueType<Range1>>): OutputIterator
  • Combine two sorted ranges to difference relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    • OutputIterator: Writeonly<IForwardIterator<IForwardContainer.ValueType<Range1>, OutputIterator>>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

set_intersection

  • set_intersection<Range1, Range2, OutputIterator>(range1: Range1, range2: Range2, output: OutputIterator, comp?: Comparator<IForwardContainer.ValueType<Range1>>): OutputIterator
  • Combine two sorted ranges to intersection relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    • OutputIterator: Writeonly<IForwardIterator<IForwardContainer.ValueType<Range1>, OutputIterator>>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

set_symmetric_difference

  • set_symmetric_difference<Range1, Range2, OutputIterator>(range1: Range1, range2: Range2, output: OutputIterator, comp?: Comparator<IForwardContainer.ValueType<Range1>>): OutputIterator
  • Combine two sorted ranges to symmetric difference relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    • OutputIterator: Writeonly<IForwardIterator<IForwardContainer.ValueType<Range1>, OutputIterator>>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

set_union

  • set_union<Range1, Range2, OutputIterator>(range1: Range1, range2: Range2, output: OutputIterator, comp?: Comparator<IForwardContainer.ValueType<Range1>>): OutputIterator
  • Combine two sorted ranges to union relationship.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    • OutputIterator: Writeonly<IForwardIterator<IForwardContainer.ValueType<Range1>, OutputIterator>>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    • output: OutputIterator

      Output iterator of the first position.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range1>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

shuffle

  • shuffle<Range>(range: Range): void

sort

  • sort<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): void
  • Sort elements in range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

sort_heap

  • sort_heap<Range>(range: Range, comp?: Comparator<ValueType<Range>>): void
  • Sort elements of a heap.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

stable_partition

  • stable_partition<Range>(range: Range, pred: UnaryPredicator<IForwardContainer.ValueType<Range>>): IteratorType<Range>
  • Partition a range into two sections with stable ordering.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • pred: UnaryPredicator<IForwardContainer.ValueType<Range>>

      An unary function predicates partition. Returns true, if an element belongs to the first section, otherwise false which means the element belongs to the second section.

    Returns IteratorType<Range>

    Iterator to the first element of the second section.

stable_sort

  • stable_sort<Range>(range: Range, comp?: Comparator<IForwardContainer.ValueType<Range>>): void
  • Sort elements in range stably.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns void

swap_ranges

  • swap_ranges<Range1, Range2>(range1: Range1, range2: Range2): IForwardContainer.IteratorType<Range2>
  • Swap values of two ranges.

    Type parameters

    • Range1: Array<any> | IForwardContainer<any>

    • Range2: IForwardContainer.SimilarType<Range1>

    Parameters

    • range1: Range1

      The 1st iterable ranged container.

    • range2: Range2

      The 2nd iterable ranged container.

    Returns IForwardContainer.IteratorType<Range2>

    Forward Iterator of the last position of the 2nd range by advancing.

transform

  • transform<Range, OutputIterator>(range: Range, result: OutputIterator, op: UnaryOperatorInferrer<Range, OutputIterator>): OutputIterator
  • transform<Range1, Range2, OutputIterator>(range: Range1, first: Range2, result: OutputIterator, op: BinaryOperatorInferrer<Range1, Range2, OutputIterator>): OutputIterator
  • Transform elements.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • result: OutputIterator
    • op: UnaryOperatorInferrer<Range, OutputIterator>

      Unary function determines the transform.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

  • Transform elements.

    Type parameters

    Parameters

    • range: Range1
    • first: Range2
    • result: OutputIterator
    • op: BinaryOperatorInferrer<Range1, Range2, OutputIterator>

      Binary function determines the transform.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

unique

  • unique<Range>(range: Range, pred?: BinaryPredicator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Remove duplicated elements in sorted range.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • Default value pred: BinaryPredicator<IForwardContainer.ValueType<Range>> = equal_to

      A binary function predicates two arguments are equal. Default is equal_to.

    Returns IForwardContainer.IteratorType<Range>

    Input iterator to the last element not removed.

unique_copy

  • unique_copy<Range, OutputIterator>(range: Range, output: OutputIterator, pred?: BinaryPredicator<IForwardContainer.ValueType<Range>>): OutputIterator
  • Copy elements in range without duplicates.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • output: OutputIterator

      Output iterator of the last position.

    • Default value pred: BinaryPredicator<IForwardContainer.ValueType<Range>> = equal_to

      A binary function predicates two arguments are equal. Default is equal_to.

    Returns OutputIterator

    Output Iterator of the last position by advancing.

upper_bound

  • upper_bound<Range>(range: Range, val: IForwardContainer.ValueType<Range>, comp?: Comparator<IForwardContainer.ValueType<Range>>): IForwardContainer.IteratorType<Range>
  • Get iterator to upper bound.

    Type parameters

    Parameters

    • range: Range

      An iterable ranged container.

    • val: IForwardContainer.ValueType<Range>

      Value to search for.

    • Default value comp: Comparator<IForwardContainer.ValueType<Range>> = less

      A binary function predicates x element would be placed before y. When returns true, then x precedes y. Default is less.

    Returns IForwardContainer.IteratorType<Range>

    Iterator to the first element after the key.

Generated using TypeDoc