mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Enhance error message for parameter-trait
Also add a comment for when this is usually triggered
This commit is contained in:
parent
df10c59d21
commit
371859e81b
1 changed files with 3 additions and 1 deletions
|
|
@ -60,7 +60,9 @@ namespace mock { namespace detail {
|
||||||
template<typename Signature, std::size_t n>
|
template<typename Signature, std::size_t n>
|
||||||
struct parameter
|
struct parameter
|
||||||
{
|
{
|
||||||
static_assert(n < function_arity<Signature>::value, "Function signature has not that many parameters");
|
// This assertion is usually triggered when the arity passed to e.g. MOCK_METHOD exceeds the number of
|
||||||
|
// parameters of the mocked function or the passed function signature
|
||||||
|
static_assert(n < function_arity<Signature>::value, "Parameter index exceeds the number of parameters");
|
||||||
using type = typename tuple_element<n, typename parameter_types<Signature>::type>::type;
|
using type = typename tuple_element<n, typename parameter_types<Signature>::type>::type;
|
||||||
};
|
};
|
||||||
template<typename T, std::size_t n>
|
template<typename T, std::size_t n>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue