With reference to this question StackoVerflow 529831, this was one of the suggested approaches
template<typename Map> typename Map::const_iterator
greatest_less(Map const& m, typename Map::key_type const& k) {
//How to print K and Map m
typename Map::const_iterator it = m.lower_bound(k);
if(it != m.begin()) {
return --it;
}
return m.end();
}
I would be interested in printing key K and Map m, How would go about this.