Tag: add class const_iterator and methods begin(), end()

Enables using range-based "for".
This commit is contained in:
Max Kellermann
2014-07-12 17:22:39 +02:00
parent 543a58bb87
commit 41a7203c28
13 changed files with 89 additions and 47 deletions

View File

@@ -160,8 +160,7 @@ ToString(const Tag &tag)
std::string result = buffer;
for (unsigned i = 0, n = tag.num_items; i != n; ++i) {
const TagItem &item = *tag.items[i];
for (const auto &item : tag) {
result.push_back('|');
result.append(tag_item_names[item.type]);
result.push_back('=');