From 371859e81be1e10fa88bab745fff31a7e738da74 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 25 Jan 2022 18:28:51 +0100 Subject: [PATCH] Enhance error message for parameter-trait Also add a comment for when this is usually triggered --- include/turtle/detail/parameter.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/turtle/detail/parameter.hpp b/include/turtle/detail/parameter.hpp index 1db8228..b21a19a 100644 --- a/include/turtle/detail/parameter.hpp +++ b/include/turtle/detail/parameter.hpp @@ -60,7 +60,9 @@ namespace mock { namespace detail { template struct parameter { - static_assert(n < function_arity::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::value, "Parameter index exceeds the number of parameters"); using type = typename tuple_element::type>::type; }; template