@@ -20,14 +20,14 @@ class ContainBase : public MatcherBase<A, E> {
2020 virtual std::string failure_message_when_negated () override ;
2121 virtual bool diffable () { return true ; }
2222
23- protected:
24- bool actual_collection_includes (U expected_item);
25- ContainBase (Expectation<A> &expectation,
26- std::initializer_list<U> expected)
23+ ContainBase (Expectation<A> &expectation, std::initializer_list<U> expected)
2724 : MatcherBase<A, std::vector<U>>(expectation, std::vector<U>(expected)),
2825 actual (this ->get_actual ()){};
2926 ContainBase (Expectation<A> &expectation, U expected)
3027 : MatcherBase<A, U>(expectation, expected), actual(this ->get_actual ()){};
28+
29+ protected:
30+ bool actual_collection_includes (U expected_item);
3131};
3232
3333template <typename A, typename E, typename U>
@@ -53,7 +53,7 @@ bool ContainBase<A, E, U>::actual_collection_includes(U expected_item) {
5353 auto actual = this ->get_actual ();
5454 auto last = *(actual.begin ());
5555 static_assert (
56- Util::verbose_assert<std::is_same <decltype (last), U>>::value,
56+ Util::verbose_assert<std::is_same_v <decltype (last), U>>::value,
5757 " Expected item is not the same type as what is inside container." );
5858 return std::find (actual.begin (), actual.end (), expected_item) != actual.end ();
5959}
@@ -69,9 +69,7 @@ class Contain : public ContainBase<A, E, U> {
6969 public:
7070 bool match () override ;
7171 bool negated_match () override ;
72- Contain (Expectation<A> &expectation,
73- std::initializer_list<U> expected)
74- : ContainBase<A, E, U>(expectation, expected){};
72+ using ContainBase<A, E, U>::ContainBase;
7573
7674 protected:
7775 bool perform_match (Predicate predicate, Predicate hash_subset_predicate);
@@ -138,6 +136,6 @@ bool Contain<A, U, U>::match() {
138136 return this ->actual_collection_includes (this ->get_expected ());
139137}
140138
141- } // :: Matchers
139+ } // namespace Matchers
142140} // namespace CppSpec
143141#endif // CPPSPEC_MATCHERS_INCLUDE_HPP
0 commit comments