Is there any way to rename the first and second accessor functions of a map iterator. I understand they have these names because of the underlying pair which represents the
I liked KeithB's solution with free functions. However, a more reusable solution might be nice.
What about function objects that access first or second, as you can name the instances anything you like:
#include
This is the best I could do. I also tried to make those functors accept the iterator directly, but one way or another this means that the signature will contain dependent names which apparently makes template type deduction impossible (I couldn't find a way to overload GetSecond for iterator/const_iterator
even with deferred return type of C++0x).