PlaylistVector: use std::list

This commit is contained in:
Max Kellermann
2013-01-02 22:16:52 +01:00
parent 83488848e1
commit 9023ba4a81
11 changed files with 79 additions and 108 deletions

View File

@@ -22,6 +22,7 @@
#include "check.h"
#include "util/list.h"
#include "gcc.h"
#include <string>
@@ -40,6 +41,18 @@ struct PlaylistInfo {
time_t mtime;
class CompareName {
const char *const name;
public:
constexpr CompareName(const char *_name):name(_name) {}
gcc_pure
bool operator()(const PlaylistInfo &pi) const {
return pi.name.compare(name) == 0;
}
};
template<typename N>
PlaylistInfo(N &&_name, time_t _mtime)
:name(std::forward<N>(_name)), mtime(_mtime) {}