Is there a metafunction f that maps an iterator to its corresponding const_iterator?
I.e. f
I think a general solution to your problem (and one that would also be portable is not possible). At least i cannot imagine one :-).
The difficult problem here is that the container defines the const_iterator type. To get to the const_iterator type for the container you have to determine the container type.
However if you start with the iterator type of the container as metafunction parameter it is not possible to retrieve the type of the container.
For known T(s) what you want can be achieved however...