From 25c5ae240c35c0d1d80a5f2b536c2bb2de60c4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 19 Feb 2020 19:55:45 +0100 Subject: [PATCH] Disable copies on generic matcher combinators --- src/catch2/catch_matchers_templates.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/catch2/catch_matchers_templates.hpp b/src/catch2/catch_matchers_templates.hpp index 43efc5b0..b8f6e852 100644 --- a/src/catch2/catch_matchers_templates.hpp +++ b/src/catch2/catch_matchers_templates.hpp @@ -108,6 +108,11 @@ namespace Matchers { template struct MatchAllOfGeneric final : MatcherGenericBase { + MatchAllOfGeneric(MatchAllOfGeneric const&) = delete; + MatchAllOfGeneric& operator=(MatchAllOfGeneric const&) = delete; + MatchAllOfGeneric(MatchAllOfGeneric&&) = default; + MatchAllOfGeneric& operator=(MatchAllOfGeneric&&) = default; + MatchAllOfGeneric(MatcherTs const&... matchers) : m_matchers{std::addressof(matchers)...} {} explicit MatchAllOfGeneric(std::array matchers) : m_matchers{matchers} {} @@ -126,6 +131,11 @@ namespace Matchers { template struct MatchAnyOfGeneric final : MatcherGenericBase { + MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete; + MatchAnyOfGeneric& operator=(MatchAnyOfGeneric const&) = delete; + MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default; + MatchAnyOfGeneric& operator=(MatchAnyOfGeneric&&) = default; + MatchAnyOfGeneric(MatcherTs const&... matchers) : m_matchers{std::addressof(matchers)...} {} explicit MatchAnyOfGeneric(std::array matchers) : m_matchers{matchers} {} @@ -144,6 +154,11 @@ namespace Matchers { template struct MatchNotOfGeneric final : MatcherGenericBase { + MatchNotOfGeneric(MatchNotOfGeneric const&) = delete; + MatchNotOfGeneric& operator=(MatchNotOfGeneric const&) = delete; + MatchNotOfGeneric(MatchNotOfGeneric&&) = default; + MatchNotOfGeneric& operator=(MatchNotOfGeneric&&) = default; + explicit MatchNotOfGeneric(MatcherT const& matcher) : m_matcher{matcher} {} template