summaryrefslogtreecommitdiff
path: root/src/regex.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-10-25 21:06:52 +1100
committerMaxime Coste <mawww@kakoune.org>2023-10-25 21:06:52 +1100
commit2fa55be40a787be71f4360fd4e36b7a790c74fa6 (patch)
tree4ba6c0bc844f2d4ce6a004ae71ef52aa21f95448 /src/regex.hh
parent96884193ddad76530a09a1b095180b0ca8257b7c (diff)
Default comparison operators that can be
Diffstat (limited to 'src/regex.hh')
-rw-r--r--src/regex.hh7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/regex.hh b/src/regex.hh
index 97ba8ebd..a4d3d769 100644
--- a/src/regex.hh
+++ b/src/regex.hh
@@ -60,7 +60,7 @@ struct MatchResults
iterator& operator++() { m_it += 2; return *this; }
SubMatch operator*() const { return {*m_it, *(m_it+1)}; }
- friend bool operator==(const iterator& lhs, const iterator& rhs) { return lhs.m_it == rhs.m_it; }
+ friend bool operator==(const iterator& lhs, const iterator& rhs) = default;
private:
It m_it;
@@ -83,10 +83,7 @@ struct MatchResults
SubMatch{m_values[i*2], m_values[i*2+1]} : SubMatch{};
}
- friend bool operator==(const MatchResults& lhs, const MatchResults& rhs)
- {
- return lhs.m_values == rhs.m_values;
- }
+ friend bool operator==(const MatchResults& lhs, const MatchResults& rhs) = default;
void swap(MatchResults& other)
{