From 51fcd4f4b9fffd316f4522d11f5e26c0d3392b54 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 25 Jan 2022 16:07:19 +0100 Subject: [PATCH] Remove usage of BOOST_IDENTITY_TYPE from official docs Replaced by MOCK_PROTECT_FUNCTION_SIG --- doc/example/reference.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/example/reference.cpp b/doc/example/reference.cpp index f322b7c..17ef2c7 100644 --- a/doc/example/reference.cpp +++ b/doc/example/reference.cpp @@ -225,11 +225,20 @@ namespace member_function_example_8 { //[ member_function_example_8 MOCK_CLASS(mock_class) { - MOCK_METHOD( - method, 0, BOOST_IDENTITY_TYPE((std::map()))) // the signature must be wrapped in BOOST_IDENTITY_TYPE if - // the return type contains a comma + // the signature must be wrapped in MOCK_PROTECT_FUNCTION_SIG if the return type contains a comma + MOCK_METHOD(method, 0, MOCK_PROTECT_FUNCTION_SIG(std::map())) }; //] +MOCK_CLASS(legacy_mock_class) +{ + MOCK_METHOD(method, 0, BOOST_IDENTITY_TYPE((std::map()))) +}; + +static_assert(std::is_same().method()), std::map>::value, + "Wrong return value"); +static_assert(std::is_same().method()), std::map>::value, + "Wrong return value"); + } // namespace member_function_example_8 #ifdef BOOST_MSVC