MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / ContainsElementMatcher

Class ContainsElementMatcher

tests/catch.hpp:3205–3223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3203
3204 template<typename T>
3205 struct ContainsElementMatcher : MatcherBase<std::vector<T>> {
3206
3207 ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {}
3208
3209 bool match(std::vector<T> const &v) const override {
3210 for (auto const& el : v) {
3211 if (el == m_comparator) {
3212 return true;
3213 }
3214 }
3215 return false;
3216 }
3217
3218 std::string describe() const override {
3219 return "Contains: " + ::Catch::Detail::stringify( m_comparator );
3220 }
3221
3222 T const& m_comparator;
3223 };
3224
3225 template<typename T>
3226 struct ContainsMatcher : MatcherBase<std::vector<T>> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected