void check_equal_ranges(const std::string& string1, const R1& range1, const std::string& string2, const R2& range2) { auto r1_it = range1.begin(); auto r2_it = range2.begin(); auto r1_end = range1.end(); auto r2_end = range2.end(); for (; r1_it != r1_end && r2_it != r2_end; ++r1_it, ++r2_it) { BOOST_CHECK_MESSAGE( *r1_it == *r2_it, string1 << " (" << *r1_it << ") == " << string2 << " ("<< *r2_it << ")"); } BOOST_CHECK_MESSAGE(r1_it == r1_end, "Reached end of " << string1); BOOST_CHECK_MESSAGE(r2_it == r2_end, "Reached end of " << string2); }
template <typename R1, typename R2> inline bool is_ci_less(R1 const &var, R2 const &target) { BOOST_STATIC_ASSERT((boost::is_same<typename R1::value_type, typename R2::value_type>::value)); return std::lexicographical_compare(var.begin(), var.end(), target.begin(), target.end(), ci_less<typename R1::value_type>()); }