Commit 81b771ed authored by Quentin Khan's avatar Quentin Khan

Add equality and difference operators to the variadic_vector

parent b7a56965
......@@ -1245,6 +1245,27 @@ public:
}
/** \brief Checks whether the contents of two vectors are equal
*
* \param lhs Left hand vector
* \param rhs Right hand vector
*/
friend bool operator==(const variadic_vector_impl& lhs, const variadic_vector_impl& rhs) {
return (lhs.size() == rhs.size())
&& std::equal(lhs.begin(), lhs.end(), rhs.begin());
}
/** \brief Checks whether the contents of two vectors are different
*
* \param lhs Left hand vector
* \param rhs Right hand vector
*/
friend bool operator!=(const variadic_vector_impl& lhs, const variadic_vector_impl& rhs) {
return !(lhs == rhs);
}
static_assert(sizeof...(Types) >= 1, "The vector must be instanciated with one or more types.");
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment