diff options
Diffstat (limited to 'test/utils/container_matchers.hpp')
-rw-r--r-- | test/utils/container_matchers.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/utils/container_matchers.hpp b/test/utils/container_matchers.hpp index c52a7d16..42c0dfb4 100644 --- a/test/utils/container_matchers.hpp +++ b/test/utils/container_matchers.hpp @@ -155,12 +155,11 @@ class ContainerUnorderedMatcher : public Catch::MatcherBase<LeftContainer> { std::iter_swap(it_to_elem, last_to_check); return true; }; - for (auto const& element : lhs) { - if (not check_exists_and_remove(element)) { - return false; - } - } - return true; + return std::all_of(lhs.begin(), + lhs.end(), + [&check_exists_and_remove](auto const& element) { + return check_exists_and_remove(element); + }); } }; |