mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 19:47:43 +03:00
hinted insert operations for flat_set
This commit is contained in:
@@ -207,6 +207,10 @@ public:
|
|||||||
return std::make_pair(iterator(it), false);
|
return std::make_pair(iterator(it), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iterator insert(UNUSED const_iterator hint, const value_type &value) {
|
||||||
|
return insert(value).first;
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<iterator, bool> insert(value_type &&value) {
|
std::pair<iterator, bool> insert(value_type &&value) {
|
||||||
auto it = std::lower_bound(data.begin(), data.end(), value, comp);
|
auto it = std::lower_bound(data.begin(), data.end(), value, comp);
|
||||||
if (it == data.end() || comp(value, *it)) {
|
if (it == data.end() || comp(value, *it)) {
|
||||||
@@ -216,6 +220,10 @@ public:
|
|||||||
return std::make_pair(iterator(it), false);
|
return std::make_pair(iterator(it), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iterator insert(UNUSED const_iterator hint, value_type &&value) {
|
||||||
|
return insert(value).first;
|
||||||
|
}
|
||||||
|
|
||||||
template <class InputIt>
|
template <class InputIt>
|
||||||
void insert(InputIt first, InputIt second) {
|
void insert(InputIt first, InputIt second) {
|
||||||
for (; first != second; ++first) {
|
for (; first != second; ++first) {
|
||||||
|
Reference in New Issue
Block a user