From 9023ba4a81d597c8694432655833cf23d83c6cde Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 2 Jan 2013 22:16:52 +0100 Subject: PlaylistVector: use std::list --- src/PlaylistInfo.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/PlaylistInfo.hxx') diff --git a/src/PlaylistInfo.hxx b/src/PlaylistInfo.hxx index fffafd819..e4cf0f4ef 100644 --- a/src/PlaylistInfo.hxx +++ b/src/PlaylistInfo.hxx @@ -22,6 +22,7 @@ #include "check.h" #include "util/list.h" +#include "gcc.h" #include @@ -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 PlaylistInfo(N &&_name, time_t _mtime) :name(std::forward(_name)), mtime(_mtime) {} -- cgit v1.2.3