how to cause const promotion for template code

From: Siemel Naran (SiemelNaran_at_REMOVE.att.net)
Date: 11/30/04


Date: Tue, 30 Nov 2004 10:33:30 GMT

Hi. I have a function

template <class InputIter, class OutputIter>
void f(InputIter begin, InputIter end, OutputIter result);

With c of type char* and cc of type const char*, the code f(c,c,cc) calls
f<char*, const char *>, which is fine.

But f(c,c,c) calls a new instantiation f<char*,char*> whereas I'd like it to
call f<const char*,char*>.

How to make this happen?