mimic++ v9.2.1
Loading...
Searching...
No Matches
mimicpp::TypeMatcher< T > Class Template Reference

Matcher, which can be used to disambiguate between similar overloads. More...

#include <GeneralMatchers.hpp>

Public Types

template<typename U>
using is_accepting = std::is_same<T, U>
 

Static Public Member Functions

static constexpr bool matches (auto &&target) noexcept
 
static constexpr std::nullopt_t describe () noexcept
 

Detailed Description

template<typename T>
class mimicpp::TypeMatcher< T >

Matcher, which can be used to disambiguate between similar overloads.

namespace matches = mimicpp::matches;
mimicpp::Mock<void(int&&), void(int const&)> mock{};
SECTION("Selecting void(int&&)")
{
MIMICPP_SCOPED_EXPECTATION mock.expect_call(matches::type<int&&>);
mock(42);
}
SECTION("Selecting void(int const&)")
{
MIMICPP_SCOPED_EXPECTATION mock.expect_call(matches::type<int const&>);
int constexpr i{42};
mock(i);
}

Member Typedef Documentation

◆ is_accepting

template<typename T>
template<typename U>
using mimicpp::TypeMatcher< T >::is_accepting = std::is_same<T, U>

Member Function Documentation

◆ describe()

template<typename T>
static constexpr std::nullopt_t mimicpp::TypeMatcher< T >::describe ( )
inlinestaticnodiscardconstexprnoexcept

◆ matches()

template<typename T>
static constexpr bool mimicpp::TypeMatcher< T >::matches ( auto && target)
inlinestaticnodiscardconstexprnoexcept

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