Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-19 19:55:45 +0100
committerMartin Hořeňovský2020-02-20 13:03:34 +0100
commit25c5ae240c35c0d1d80a5f2b536c2bb2de60c4d3 (patch)
tree5bd2742fc9baaa654d0cdaf2495620493398ec1b /src/catch2
parent260263b9bfe8bdeaf45d40a0a3dead26149f5d0f (diff)
downloadcatch3-25c5ae240c35c0d1d80a5f2b536c2bb2de60c4d3.tar.gz
Disable copies on generic matcher combinators
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/catch_matchers_templates.hpp15
1 files changed, 15 insertions, 0 deletions
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<typename... MatcherTs>
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<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
@@ -126,6 +131,11 @@ namespace Matchers {
template<typename... MatcherTs>
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<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
@@ -144,6 +154,11 @@ namespace Matchers {
template<typename MatcherT>
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<typename Arg>