Fix adding Opts with | to lvalue Parser

This is the recommended way of adding new Opts in our documentation
for using custom main, but we did not compile the code to see if it
works. We now compile the example as part of the BUILD_EXAMPLES
option.

Fixes #2787
This commit is contained in:
Martin Hořeňovský committed 2024-01-02 23:27:13 +01:00
1 parent f981c9cbca
commit 863c662c0e
3 files changed
+45 -1

No files matched your search

+3 -1
View File
@@ -673,7 +673,9 @@ namespace Catch {
template <typename T>
friend Parser operator|( Parser const& p, T&& rhs ) {
return Parser( p ) |= CATCH_FORWARD(rhs);
Parser temp( p );
temp |= rhs;
return temp;
}
template <typename T>