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

#include <catch.hpp>

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

Public Member Functions

 EqualsMatcher (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::EqualsMatcher< T >

Definition at line 2819 of file catch.hpp.

Constructor & Destructor Documentation

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

Definition at line 2821 of file catch.hpp.

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

Member Function Documentation

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

Definition at line 2835 of file catch.hpp.

References Catch::Detail::stringify().

2835  {
2836  return "Equals: " + ::Catch::Detail::stringify( m_comparator );
2837  }
std::string stringify(const T &e)
Definition: catch.hpp:955
std::vector< T > const & m_comparator
Definition: catch.hpp:2838
template<typename T >
bool Catch::Matchers::Vector::EqualsMatcher< T >::match ( std::vector< T > const &  v) const
inlineoverride

Definition at line 2823 of file catch.hpp.

2823  {
2824  // !TBD: This currently works if all elements can be compared using !=
2825  // - a more general approach would be via a compare template that defaults
2826  // to using !=. but could be specialised for, e.g. std::vector<T> etc
2827  // - then just call that directly
2828  if (m_comparator.size() != v.size())
2829  return false;
2830  for (std::size_t i = 0; i < v.size(); ++i)
2831  if (m_comparator[i] != v[i])
2832  return false;
2833  return true;
2834  }
std::vector< T > const & m_comparator
Definition: catch.hpp:2838

Member Data Documentation

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

Definition at line 2838 of file catch.hpp.


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