util/IntrusiveSortedList: remove unused class
This commit is contained in:
committed by
Max Kellermann
parent
1ee25b4234
commit
99da022775
@@ -1,41 +0,0 @@
|
||||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
// author: Max Kellermann <max.kellermann@gmail.com>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IntrusiveList.hxx"
|
||||
|
||||
#include <algorithm> // for std::find_if()
|
||||
|
||||
/**
|
||||
* A variant of #IntrusiveList which is sorted automatically. There
|
||||
* are obvious scalability problems with this approach, so use with
|
||||
* care.
|
||||
*/
|
||||
template<typename T, typename Compare=typename T::Compare,
|
||||
typename HookTraits=IntrusiveListBaseHookTraits<T>,
|
||||
IntrusiveListOptions options=IntrusiveListOptions{}>
|
||||
class IntrusiveSortedList
|
||||
: public IntrusiveList<T, HookTraits, options>
|
||||
{
|
||||
using Base = IntrusiveList<T, HookTraits, options>;
|
||||
|
||||
[[no_unique_address]]
|
||||
Compare compare;
|
||||
|
||||
public:
|
||||
constexpr IntrusiveSortedList() noexcept = default;
|
||||
IntrusiveSortedList(IntrusiveSortedList &&src) noexcept = default;
|
||||
|
||||
using typename Base::reference;
|
||||
using Base::begin;
|
||||
using Base::end;
|
||||
|
||||
void insert(reference item) noexcept {
|
||||
auto position = std::find_if(begin(), end(), [this, &item](const auto &other){
|
||||
return !compare(other, item);
|
||||
});
|
||||
|
||||
Base::insert(position, item);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user