MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / match

Method match

extlibs/catch/include/catch/catch.hpp:3619–3626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected