mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-03-20 13:46:28 -04:00
RecentEntries: Make templated type of std::list.
This commit is contained in:
parent
bd785d8bf4
commit
50e2dfa0b9
@ -34,14 +34,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
template<class Entry>
|
||||
class RecentEntries : public std::list<Entry> {
|
||||
public:
|
||||
using EntryType = Entry;
|
||||
using Key = typename EntryType::Key;
|
||||
using ContainerType = std::list<EntryType>;
|
||||
using const_reference = typename ContainerType::const_reference;
|
||||
using const_iterator = typename ContainerType::const_iterator;
|
||||
};
|
||||
using RecentEntries = std::list<Entry>;
|
||||
|
||||
template<typename ContainerType, typename Key>
|
||||
typename ContainerType::const_iterator find(const ContainerType& entries, const Key key) {
|
||||
@ -105,7 +98,7 @@ using RecentEntriesColumn = std::pair<std::string, size_t>;
|
||||
template<class Entries>
|
||||
class RecentEntriesView : public View {
|
||||
public:
|
||||
using Entry = typename Entries::EntryType;
|
||||
using Entry = typename Entries::value_type;
|
||||
|
||||
std::function<void(const Entry& entry)> on_select;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user