make wml_tag::iterator copy assignable (#8174)

This makes iterators based on this class to meet LegacyInputIterator requirements, allowing them to be used with STL algorithms such as MSVC's `std::find_if`.
This commit is contained in:
Rafael Silva 2023-12-31 14:16:03 -03:00 committed by GitHub
parent 508c627543
commit 61b2e8eb4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@
#pragma once
#include <functional>
#include <map>
#include <string>
#include <vector>
@ -59,7 +60,7 @@ private:
{
std::queue<const wml_tag*> condition_queue;
typename Map::const_iterator current;
const config& match;
std::reference_wrapper<const config> match;
public:
// Construct a begin iterator
iterator(const wml_tag& base_tag, const config& match) : match(match)
@ -81,7 +82,7 @@ private:
}
void push_new_tag_conditions(const wml_tag& tag)
{
wml_tag::push_new_tag_conditions(condition_queue, match, tag);
wml_tag::push_new_tag_conditions(condition_queue, match.get(), tag);
}
bool equal(const iterator<T, Map>& other) const
{