mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-01 03:13:17 +02:00
v108.9
* multi-monitor support * improved pause/frame advance support * added option to disable video dimming when idle
This commit is contained in:
@@ -101,23 +101,14 @@ template<typename T> auto vector<T>::remove(uint64_t offset, uint64_t length) ->
|
||||
_size -= length;
|
||||
}
|
||||
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator==(const T& value) -> type& { return remove<std::equal_to<T>>(value); }
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator!=(const T& value) -> type& { return remove<std::not_equal_to<T>>(value); }
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator< (const T& value) -> type& { return remove<std::less<T>>(value); }
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator<=(const T& value) -> type& { return remove<std::less_equal<T>>(value); }
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator> (const T& value) -> type& { return remove<std::greater<T>>(value); }
|
||||
template<typename T> auto vector<T>::RemoveWhere::operator>=(const T& value) -> type& { return remove<std::greater_equal<T>>(value); }
|
||||
template<typename T> auto vector<T>::removeByIndex(uint64_t index) -> bool {
|
||||
if(index < size()) return remove(index), true;
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T> template<typename Compare> auto vector<T>::RemoveWhere::remove(const T& value) -> type& {
|
||||
auto source = self.begin();
|
||||
auto target = self.begin();
|
||||
while(source != self.end()) {
|
||||
if(source != target) *target = move(*source);
|
||||
if(!Compare()(*target, value)) ++target;
|
||||
++source;
|
||||
}
|
||||
self.resize(target.offset());
|
||||
return self;
|
||||
template<typename T> auto vector<T>::removeByValue(const T& value) -> bool {
|
||||
if(auto index = find(value)) return remove(*index), true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -36,36 +36,6 @@ template<typename T> auto vector<T>::findSorted(const T& value) const -> maybe<u
|
||||
return nothing;
|
||||
}
|
||||
|
||||
template<typename T> auto vector<T>::FindWhere::operator==(const T& value) -> vector<iterator<T>> { return move(find<std::equal_to<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhere::operator!=(const T& value) -> vector<iterator<T>> { return move(find<std::not_equal_to<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhere::operator< (const T& value) -> vector<iterator<T>> { return move(find<std::less<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhere::operator<=(const T& value) -> vector<iterator<T>> { return move(find<std::less_equal<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhere::operator> (const T& value) -> vector<iterator<T>> { return move(find<std::greater<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhere::operator>=(const T& value) -> vector<iterator<T>> { return move(find<std::greater_equal<T>>(value)); }
|
||||
|
||||
template<typename T> template<typename Compare> auto vector<T>::FindWhere::find(const T& value) -> vector<iterator<T>> {
|
||||
vector<iterator<T>> found;
|
||||
for(auto iterator = self.begin(); iterator != self.end(); ++iterator) {
|
||||
if(Compare()(*iterator, value)) found.append(iterator);
|
||||
}
|
||||
return move(found);
|
||||
}
|
||||
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator==(const T& value) const -> vector<iterator_const<T>> { return move(find<std::equal_to<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator!=(const T& value) const -> vector<iterator_const<T>> { return move(find<std::not_equal_to<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator< (const T& value) const -> vector<iterator_const<T>> { return move(find<std::less<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator<=(const T& value) const -> vector<iterator_const<T>> { return move(find<std::less_equal<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator> (const T& value) const -> vector<iterator_const<T>> { return move(find<std::greater<T>>(value)); }
|
||||
template<typename T> auto vector<T>::FindWhereConst::operator>=(const T& value) const -> vector<iterator_const<T>> { return move(find<std::greater_equal<T>>(value)); }
|
||||
|
||||
template<typename T> template<typename Compare> auto vector<T>::FindWhereConst::find(const T& value) const -> vector<iterator_const<T>> {
|
||||
vector<iterator_const<T>> found;
|
||||
for(auto iterator = self.begin(); iterator != self.end(); ++iterator) {
|
||||
if(Compare()(*iterator, value)) found.append(iterator);
|
||||
}
|
||||
return move(found);
|
||||
}
|
||||
|
||||
template<typename T> auto vector<T>::foreach(const function<void (const T&)>& callback) -> void {
|
||||
for(uint64_t n : range(size())) callback(_pool[n]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user