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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/catch_capture_matchers.cpp
diff options
context:
space:
mode:
authormelak472020-02-16 11:19:10 +0100
committerGitHub2020-02-16 11:19:10 +0100
commit17c4b2d0932ba944743b3c1e578352080af8c137 (patch)
treed4af4ea94e8e25a624634c4750871d7d221d66d0 /src/catch2/catch_capture_matchers.cpp
parentdb1a0465dc39e8aed36852984c14072192750b1d (diff)
downloadcatch3-17c4b2d0932ba944743b3c1e578352080af8c137.tar.gz
Feature: generic matchers (#1843)
This commit extends the Matchers feature with the ability to have type-independent (e.g. templated) matchers. This is done by adding a new base type that Matchers can extend, `MatcherGenericBase`, and overloads of operators `!`, `&&` and `||` that handle matchers extending `MatcherGenericBase` in a special manner. These new matchers can also take their arguments as values and non-const references. Closes #1307 Closes #1553 Closes #1554 Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
Diffstat (limited to 'src/catch2/catch_capture_matchers.cpp')
-rw-r--r--src/catch2/catch_capture_matchers.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/catch_capture_matchers.cpp b/src/catch2/catch_capture_matchers.cpp
index ad51baca..7ce35ef6 100644
--- a/src/catch2/catch_capture_matchers.cpp
+++ b/src/catch2/catch_capture_matchers.cpp
@@ -17,7 +17,7 @@ namespace Catch {
// the Equals matcher (so the header does not mention matchers)
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) {
std::string exceptionMessage = Catch::translateActiveException();
- MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
+ MatchExpr<std::string, StringMatcher const&> expr( std::move(exceptionMessage), matcher, matcherString );
handler.handleExpr( expr );
}