sparse_set: review ::push
This commit is contained in:
@@ -804,15 +804,18 @@ public:
|
||||
* @tparam It Type of input iterator.
|
||||
* @param first An iterator to the first element of the range of entities.
|
||||
* @param last An iterator past the last element of the range of entities.
|
||||
* @return Iterator pointing to the first element inserted, if any.
|
||||
* @return Iterator pointing to the first element inserted in case of
|
||||
* success, the `end()` iterator otherwise.
|
||||
*/
|
||||
template<typename It>
|
||||
iterator push(It first, It last) {
|
||||
for(auto it = first; it != last; ++it) {
|
||||
try_emplace(*it, true);
|
||||
auto curr = end();
|
||||
|
||||
for(; first != last; ++first) {
|
||||
curr = try_emplace(*first, true);
|
||||
}
|
||||
|
||||
return first == last ? end() : begin(0);
|
||||
return curr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user