Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ForwardList<T>

Singly Linked List.

author

Jeongho Nam - https://github.com/samchon

Type parameters

  • T

Hierarchy

  • ForwardList

Implements

Index

Constructors

constructor

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<T>

assign

  • assign(n: number, val: T): void
  • assign<T, InputIterator>(first: InputIterator, last: InputIterator): void

before_begin

  • before_begin(): Iterator<T>

begin

  • begin(): Iterator<T>

clear

  • clear(): void

empty

  • empty(): boolean

end

  • end(): Iterator<T>

erase_after

  • erase_after(it: Iterator<T>): Iterator<T>
  • erase_after(first: Iterator<T>, last: Iterator<T>): Iterator<T>
  • Erase an element.

    Parameters

    • it: Iterator<T>

      Position to erase after.

    Returns Iterator<T>

    Iterator to the erased element.

  • Erase elements.

    Parameters

    • first: Iterator<T>

      Range of the first position to erase after.

    • last: Iterator<T>

      Rangee of the last position to erase.

    Returns Iterator<T>

    Iterator to the last removed element.

front

  • front(): T
  • front(val: T): void

insert_after

  • insert_after(pos: Iterator<T>, val: T): Iterator<T>
  • insert_after(pos: Iterator<T>, n: number, val: T): Iterator<T>
  • insert_after<T, InputIterator>(pos: Iterator<T>, first: InputIterator, last: InputIterator): Iterator<T>
  • Insert an element.

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • val: T

      Value to insert.

    Returns Iterator<T>

    An iterator to the newly inserted element.

  • Inserted repeated elements.

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • n: number

      Number of elements to insert.

    • val: T

      Value to insert repeatedly.

    Returns Iterator<T>

    An iterator to the last of the newly inserted elements.

  • Insert range elements.

    Type parameters

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • first: InputIterator

      Input iterator of the first position.

    • last: InputIterator

      Input iteartor of the last position.

    Returns Iterator<T>

    An iterator to the last of the newly inserted elements.

merge

  • merge(from: ForwardList<T>, comp?: Comparator<T>): void

pop_front

  • pop_front(): void

push_front

  • push_front(val: T): void

remove

  • remove(val: T): void

remove_if

  • remove_if(pred: UnaryPredicator<T>): void

reverse

  • reverse(): void

size

  • size(): number

sort

  • sort(comp?: Comparator<T>): void

splice_after

  • splice_after(pos: Iterator<T>, from: ForwardList<T>): void
  • splice_after(pos: Iterator<T>, from: ForwardList<T>, before: Iterator<T>): void
  • splice_after(pos: Iterator<T>, from: ForwardList<T>, first_before: Iterator<T>, last: Iterator<T>): void
  • Transfer elements.

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • from: ForwardList<T>

      Target container to transfer.

    Returns void

  • Transfer a single element.

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • from: ForwardList<T>

      Target container to transfer.

    • before: Iterator<T>

      Previous position of the single element to transfer.

    Returns void

  • Transfer range elements.

    Parameters

    • pos: Iterator<T>

      Position to insert after.

    • from: ForwardList<T>

      Target container to transfer.

    • first_before: Iterator<T>
    • last: Iterator<T>

      Rangee of the last position to transfer.

    Returns void

swap

toJSON

  • toJSON(): Array<T>

unique

  • unique(binary_pred?: BinaryPredicator<T>): void

Generated using TypeDoc