I want to write my own algorithm (just a function really) that takes a range of iterators. If the iterators are from a map, I want to use the data (iterator->second) value. If the iterator is “normal” like a vector or list, I just want to use the dereferenced iterator value.
Share
I think, value-getter idea is right here, but you can implement it without
c++11and without structs at all, only using functions: