| 3617 | struct UnorderedEqualsMatcher : MatcherBase<std::vector<T>> { |
| 3618 | UnorderedEqualsMatcher(std::vector<T> const& target) : m_target(target) {} |
| 3619 | bool match(std::vector<T> const& vec) const override { |
| 3620 | // Note: This is a reimplementation of std::is_permutation, |
| 3621 | // because I don't want to include <algorithm> inside the common path |
| 3622 | if (m_target.size() != vec.size()) { |
| 3623 | return false; |
| 3624 | } |
| 3625 | return std::is_permutation(m_target.begin(), m_target.end(), vec.begin()); |
| 3626 | } |
| 3627 | |
| 3628 | std::string describe() const override { |
| 3629 | return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target); |