Add equality operators for indexed_vector/falco_{list,macro,rule}

Add an equality operator for indexed_vector.

As indexed_vectors commonly hold falco lists/macros/rules, also add
equality operators for those structs. For condition/sinsp_filter
shared_ptrs, the operator checks that the shared_ptrs point to the
same underlying memory.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
Mark Stemm
2024-10-02 08:55:27 -07:00
committed by poiana
parent 093d9234a5
commit 5f13a9be08
2 changed files with 27 additions and 0 deletions

View File

@@ -34,6 +34,9 @@ public:
indexed_vector& operator=(indexed_vector&&) = default;
indexed_vector(const indexed_vector&) = default;
indexed_vector& operator=(const indexed_vector&) = default;
bool operator==(const indexed_vector& rhs) const {
return (this->m_entries == rhs.m_entries && this->m_index == rhs.m_index);
}
/*!
\brief Returns the number of elements