Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
Catch::Matchers::Vector::ContainsMatcher< T > Struct Template Reference

#include <catch.hpp>

Inheritance diagram for Catch::Matchers::Vector::ContainsMatcher< T >:
Collaboration diagram for Catch::Matchers::Vector::ContainsMatcher< T >:

Public Member Functions

 ContainsMatcher (std::vector< T > const &comparator)
 
bool match (std::vector< T > const &v) const override
 
std::string describe () const override
 

Public Attributes

std::vector< T > const & m_comparator
 

Detailed Description

template<typename T>
struct Catch::Matchers::Vector::ContainsMatcher< T >

Definition at line 2789 of file catch.hpp.

Constructor & Destructor Documentation

template<typename T >
Catch::Matchers::Vector::ContainsMatcher< T >::ContainsMatcher ( std::vector< T > const &  comparator)
inline

Definition at line 2791 of file catch.hpp.

2791 : m_comparator( comparator ) {}
std::vector< T > const & m_comparator
Definition: catch.hpp:2815

Member Function Documentation

template<typename T >
std::string Catch::Matchers::Vector::ContainsMatcher< T >::describe ( ) const
inlineoverride

Definition at line 2811 of file catch.hpp.

References Catch::Detail::stringify().

2811  {
2812  return "Contains: " + ::Catch::Detail::stringify( m_comparator );
2813  }
std::string stringify(const T &e)
Definition: catch.hpp:955
std::vector< T > const & m_comparator
Definition: catch.hpp:2815
template<typename T >
bool Catch::Matchers::Vector::ContainsMatcher< T >::match ( std::vector< T > const &  v) const
inlineoverride

Definition at line 2793 of file catch.hpp.

2793  {
2794  // !TBD: see note in EqualsMatcher
2795  if (m_comparator.size() > v.size())
2796  return false;
2797  for (auto const& comparator : m_comparator) {
2798  auto present = false;
2799  for (const auto& el : v) {
2800  if (el == comparator) {
2801  present = true;
2802  break;
2803  }
2804  }
2805  if (!present) {
2806  return false;
2807  }
2808  }
2809  return true;
2810  }
std::vector< T > const & m_comparator
Definition: catch.hpp:2815

Member Data Documentation

template<typename T >
std::vector<T> const& Catch::Matchers::Vector::ContainsMatcher< T >::m_comparator

Definition at line 2815 of file catch.hpp.


The documentation for this struct was generated from the following file: