From 0c20ca1ce92b684b85f736ddb0893b34dfc5308f Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 25 Jan 2022 18:46:18 +0100 Subject: [PATCH] Make MOCK_SIGNATURE macro shorter Put most of it into a template-alias as this may turn up in error messages --- include/turtle/detail/signature.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/turtle/detail/signature.hpp b/include/turtle/detail/signature.hpp index f76c7b0..ee8e577 100644 --- a/include/turtle/detail/signature.hpp +++ b/include/turtle/detail/signature.hpp @@ -54,21 +54,22 @@ namespace mock { namespace detail { struct signature : signature::type> {}; + template + using signature_t = typename signature>>::type; + template struct base { typedef T base_type; }; - // if an error is generated by the line below it means - // the method is ambiguous : specify its signature to - // disambiguate + // if an error is generated by the line below it means the method is ambiguous: + // specify its signature to disambiguate template T& ambiguous_method_requires_to_specify_signature(const T&); }} // namespace mock::detail -#define MOCK_SIGNATURE(M) \ - mock::detail::signature>>::type +#define MOCK_SIGNATURE(M) \ + mock::detail::signature_t #endif // MOCK_SIGNATURE_HPP_INCLUDED