Skip to content

algorithm.h

Vlad Riscutia edited this page Nov 7, 2016 · 1 revision

Algorithms are declared in namespace pipe::algorithm. Pipe currently implements the following algorithms:

  • accumulate combines all elements yielded by the input generator using the given BinaryOperation starting from a given initial_value
  • all returns true if the given Predicate returns true for all elements yielded by the input generator
  • collect inserts all elements yielded by the input generator into the given OutputIterator
  • drop_n skips n elements yielded by the input generator and yields the remaining elements
  • drop_until skips elements yielded by the input generator until the given Predicate returns true for an element, then yields the remaining elements
  • drop_while skips elements yielded by the input generator while the given Predicate returns true for an element, then yields the remaining elements
  • filter filters out elements yielded by the input generator that don't conform to the given Predicate, yielding the remaining elements
  • for_each applies the given UnaryFunction to each element yielded by the input generator
  • fold combines all elements yielded by the input generator using the given BinaryOperation, returns the generator's value type default value if no elements are generated
  • length returns the number of elements yielded by the input generator
  • map applies the given UnaryOperation to each element yielded by the input generator and yields the results
  • max returns the maximum element yielded by the input generator or the generator's value type default value if no elements are generated
  • min returns the minimum element yielded by the input generator or the generator's value type default value if no elements are generated
  • none returns true if the given Predicate returns false for all elements yielded by the input generator
  • some returns true if the given Predicate returns true for at least one element yielded by the input generator
  • take_n yields the first n elements yielded by the input generator and discards the remaining elements
  • take_until yields elements yielded by the input generator until the given Predicate returns true for an element and discards the remaining elements
  • take_while yields elements yielded by the input generator while the given Predicate returns true for an element and discards the remaining elements
  • zip_with zips each element from the input generator with elements from the generator provided as an argument yielding std::pair of elements
Clone this wiki locally