From 1b7bcfcc868af4e2501cf74f8bd940c3bd1127fc Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 8 Feb 2022 18:27:46 +0100 Subject: [PATCH] Don't return *this in expectation::with Chaining is done via the wrapper class not the expectation class --- include/turtle/detail/expectation.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/turtle/detail/expectation.hpp b/include/turtle/detail/expectation.hpp index 18b9bb23..d4e477aa 100644 --- a/include/turtle/detail/expectation.hpp +++ b/include/turtle/detail/expectation.hpp @@ -123,16 +123,14 @@ namespace mock { namespace detail { void invoke(std::unique_ptr i) { invocation_ = std::move(i); } template - std::enable_if_t<(arity > 0u) && sizeof...(Constraints) == arity, expectation&> with(Constraints... c) + std::enable_if_t<(arity > 0u) && sizeof...(Constraints) == arity> with(Constraints... c) { matcher_ = std::make_unique>(c...); - return *this; } template - std::enable_if_t<(Arity > 1u), expectation&> with(const Constraint& c) + std::enable_if_t<(Arity > 1u)> with(const Constraint& c) { matcher_ = std::make_unique>(c); - return *this; } void add(sequence& s)