27 template<
class fwd_it_t,
class predicate_t>
28 bool all_of_equal(fwd_it_t itBegin, fwd_it_t itEnd,
const predicate_t& predicate)
33 auto&& value = std::invoke(predicate, *itBegin);
37 [&value, &predicate](
const auto& x)
39 return std::invoke(predicate, x) == value;
53 template<
class container_t,
class predicate_t>
54 bool all_of_equal(
const container_t& container,
const predicate_t& predicate)
56 return all_of_equal(std::begin(container), std::end(container), predicate);
bool all_of_equal(fwd_it_t itBegin, fwd_it_t itEnd, const predicate_t &predicate)
Returns true if the predicate yields the same value for all elements in the range [itBegin,...