mimic++ v5
Loading...
Searching...
No Matches
mimicpp::PredicateMatcher< Predicate, AdditionalArgs > Class Template Reference

Generic matcher and the basic building block of most of the built-in matchers. More...

#include <Matcher.hpp>

Public Member Functions

constexpr PredicateMatcher (Predicate predicate, StringT fmt, StringT invertedFmt, std::tuple< AdditionalArgs... > additionalArgs={}) noexcept(std::is_nothrow_move_constructible_v< Predicate > &&(... &&std::is_nothrow_move_constructible_v< AdditionalArgs >))
 
template<typename T >
requires std::predicate< const Predicate&, T&, matches_reference_t<AdditionalArgs>...>
constexpr bool matches (T &target) const noexcept(std::is_nothrow_invocable_v< const Predicate &, T &, matches_reference_t< AdditionalArgs >... >)
 
constexpr StringT describe () const
 
constexpr auto operator! () const &
 
constexpr auto operator! () &&
 

Detailed Description

template<typename Predicate, typename... AdditionalArgs>
requires std::is_move_constructible_v<Predicate> && (... && std::is_move_constructible_v<AdditionalArgs>)
class mimicpp::PredicateMatcher< Predicate, AdditionalArgs >

Generic matcher and the basic building block of most of the built-in matchers.

Template Parameters
PredicateThe predicate type.
AdditionalArgsAddition argument types.

Constructor & Destructor Documentation

◆ PredicateMatcher()

template<typename Predicate , typename... AdditionalArgs>
mimicpp::PredicateMatcher< Predicate, AdditionalArgs >::PredicateMatcher ( Predicate predicate,
StringT fmt,
StringT invertedFmt,
std::tuple< AdditionalArgs... > additionalArgs = {} )
inlineexplicitnodiscardconstexprnoexcept

Member Function Documentation

◆ describe()

template<typename Predicate , typename... AdditionalArgs>
StringT mimicpp::PredicateMatcher< Predicate, AdditionalArgs >::describe ( ) const
inlinenodiscardconstexpr

◆ matches()

template<typename Predicate , typename... AdditionalArgs>
template<typename T >
requires std::predicate< const Predicate&, T&, matches_reference_t<AdditionalArgs>...>
bool mimicpp::PredicateMatcher< Predicate, AdditionalArgs >::matches ( T & target) const
inlinenodiscardconstexprnoexcept

◆ operator!() [1/2]

template<typename Predicate , typename... AdditionalArgs>
auto mimicpp::PredicateMatcher< Predicate, AdditionalArgs >::operator! ( ) &&
inlinenodiscardconstexpr

◆ operator!() [2/2]

template<typename Predicate , typename... AdditionalArgs>
auto mimicpp::PredicateMatcher< Predicate, AdditionalArgs >::operator! ( ) const &
inlinenodiscardconstexpr

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