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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-19 20:23:02 +0100
committerMartin Hořeňovský2020-02-20 13:03:36 +0100
commitd33af93e175b7c69b56aca54a8eae8e6b3981760 (patch)
treef0e585914d83f9bf56d81eb519b735ce620e0602
parent25c5ae240c35c0d1d80a5f2b536c2bb2de60c4d3 (diff)
downloadcatch3-d33af93e175b7c69b56aca54a8eae8e6b3981760.tar.gz
Cleanup visibility in generic not matcher
-rw-r--r--src/catch2/catch_matchers_templates.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/catch2/catch_matchers_templates.hpp b/src/catch2/catch_matchers_templates.hpp
index b8f6e852..1a8bedbd 100644
--- a/src/catch2/catch_matchers_templates.hpp
+++ b/src/catch2/catch_matchers_templates.hpp
@@ -170,6 +170,11 @@ namespace Matchers {
return "not " + m_matcher.toString();
}
+ //! Negating negation can just unwrap and return underlying matcher
+ friend MatcherT const& operator ! (Detail::MatchNotOfGeneric<MatcherT> const& matcher) {
+ return matcher.m_matcher;
+ }
+ private:
MatcherT const& m_matcher;
};
} // namespace Detail
@@ -190,6 +195,7 @@ namespace Matchers {
return { lhs, rhs };
}
+ //! Wrap provided generic matcher in generic negator
template<typename MatcherT>
typename std::enable_if<Detail::is_generic_matcher<MatcherT>::value, Detail::MatchNotOfGeneric<MatcherT>>::type
operator ! (MatcherT const& matcher) {
@@ -260,12 +266,6 @@ namespace Matchers {
return Detail::MatchAnyOfGeneric<MatcherLHS, MatchersRHS...>{Detail::array_cat(static_cast<void const*>(std::addressof(lhs)), std::move(rhs.m_matchers))};
}
- template<typename MatcherT>
- MatcherT const& operator ! (Detail::MatchNotOfGeneric<MatcherT> const& matcher) {
- return matcher.m_matcher;
- }
-
-
} // namespace Matchers
} // namespace Catch