how to cause const promotion for template code
From: Siemel Naran (SiemelNaran_at_REMOVE.att.net)
Date: 11/30/04
- Next message: Siemel Naran: "typos in set functions"
- Previous message: Method Man: "Re: unreferenced local variable"
- Next in thread: Rob Williscroft: "Re: how to cause const promotion for template code"
- Reply: Rob Williscroft: "Re: how to cause const promotion for template code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Siemel Naran: "typos in set functions"
- Previous message: Method Man: "Re: unreferenced local variable"
- Next in thread: Rob Williscroft: "Re: how to cause const promotion for template code"
- Reply: Rob Williscroft: "Re: how to cause const promotion for template code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]