diff --git a/src/catch2/matchers/catch_matchers_range_equals.hpp b/src/catch2/matchers/catch_matchers_range_equals.hpp index 41c1c803..49ba19b5 100644 --- a/src/catch2/matchers/catch_matchers_range_equals.hpp +++ b/src/catch2/matchers/catch_matchers_range_equals.hpp @@ -92,58 +92,35 @@ namespace Catch { } }; - /** - * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range. - * - * Uses `std::equal_to` to do the comparison - */ - template - constexpr - std::enable_if_t::value, - RangeEqualsMatcher>> - RangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; - } - /** * Creates a matcher that checks if all elements in a range are equal * to all elements in another range. * * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template + template {} )> constexpr RangeEqualsMatcher - RangeEquals( RangeLike&& range, Equality&& predicate ) { + RangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } - /** - * Creates a matcher that checks if all elements in a range are equal - * to all elements in another range, in some permutation - * - * Uses `std::equal_to` to do the comparison - */ - template - constexpr - std::enable_if_t< - !Detail::is_matcher::value, - UnorderedRangeEqualsMatcher>> - UnorderedRangeEquals( RangeLike&& range ) { - return { CATCH_FORWARD( range ), std::equal_to<>{} }; - } - /** * Creates a matcher that checks if all elements in a range are equal * to all elements in another range, in some permutation. * * Uses the provided predicate `predicate` to do the comparisons + * (defaulting to `std::equal_to`) */ - template + template {} )> constexpr UnorderedRangeEqualsMatcher - UnorderedRangeEquals( RangeLike&& range, Equality&& predicate ) { + UnorderedRangeEquals( RangeLike&& range, + Equality&& predicate = std::equal_to<>{} ) { return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) }; } } // namespace Matchers