Commit 1d779be4 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #1550 from al13n321/master

A few more wrappers in libcpp.algorithm and libcpp.vector
parents 04cf0f8b 48fec8d6
...@@ -7,6 +7,14 @@ cdef extern from "<algorithm>" namespace "std" nogil: ...@@ -7,6 +7,14 @@ cdef extern from "<algorithm>" namespace "std" nogil:
bool binary_search[Iter, T, Compare](Iter first, Iter last, const T& value, bool binary_search[Iter, T, Compare](Iter first, Iter last, const T& value,
Compare comp) Compare comp)
Iter lower_bound[Iter, T](Iter first, Iter last, const T& value)
Iter lower_bound[Iter, T, Compare](Iter first, Iter last, const T& value,
Compare comp)
Iter upper_bound[Iter, T](Iter first, Iter last, const T& value)
Iter upper_bound[Iter, T, Compare](Iter first, Iter last, const T& value,
Compare comp)
void partial_sort[Iter](Iter first, Iter middle, Iter last) void partial_sort[Iter](Iter first, Iter middle, Iter last)
void partial_sort[Iter, Compare](Iter first, Iter middle, Iter last, void partial_sort[Iter, Compare](Iter first, Iter middle, Iter last,
Compare comp) Compare comp)
...@@ -14,6 +22,10 @@ cdef extern from "<algorithm>" namespace "std" nogil: ...@@ -14,6 +22,10 @@ cdef extern from "<algorithm>" namespace "std" nogil:
void sort[Iter](Iter first, Iter last) void sort[Iter](Iter first, Iter last)
void sort[Iter, Compare](Iter first, Iter last, Compare comp) void sort[Iter, Compare](Iter first, Iter last, Compare comp)
# Removing duplicates
Iter unique[Iter](Iter first, Iter last)
Iter unique[Iter, BinaryPredicate](Iter first, Iter last, BinaryPredicate p)
# Binary heaps (priority queues) # Binary heaps (priority queues)
void make_heap[Iter](Iter first, Iter last) void make_heap[Iter](Iter first, Iter last)
void make_heap[Iter, Compare](Iter first, Iter last, Compare comp) void make_heap[Iter, Compare](Iter first, Iter last, Compare comp)
...@@ -29,4 +41,3 @@ cdef extern from "<algorithm>" namespace "std" nogil: ...@@ -29,4 +41,3 @@ cdef extern from "<algorithm>" namespace "std" nogil:
# Copy # Copy
OutputIter copy[InputIter,OutputIter](InputIter,InputIter,OutputIter) OutputIter copy[InputIter,OutputIter](InputIter,InputIter,OutputIter)
...@@ -8,6 +8,7 @@ cdef extern from "<vector>" namespace "std" nogil: ...@@ -8,6 +8,7 @@ cdef extern from "<vector>" namespace "std" nogil:
iterator operator--() iterator operator--()
iterator operator+(size_t) iterator operator+(size_t)
iterator operator-(size_t) iterator operator-(size_t)
size_t operator-(iterator)
bint operator==(iterator) bint operator==(iterator)
bint operator!=(iterator) bint operator!=(iterator)
bint operator<(iterator) bint operator<(iterator)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment