Skip to content

Commit 10447c8

Browse files
committed
Loosen type restriction on to_contain
1 parent 7895bef commit 10447c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/matchers/contain.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ template <typename A, typename E, typename U>
4848
bool ContainBase<A, E, U>::actual_collection_includes(U expected_item) {
4949
auto actual = this->actual();
5050
auto last = *(actual.begin());
51-
static_assert(Util::verbose_assert<std::is_same_v<decltype(last), U>>::value,
52-
"Expected item is not the same type as what is inside container.");
51+
static_assert(Util::verbose_assert<std::is_convertible_v<U, decltype(last)>>::value,
52+
"Expected item is not comparable against what is inside container.");
5353
return std::ranges::find(actual, expected_item) != actual.end();
5454
}
5555

0 commit comments

Comments
 (0)