Article ID: 131014
Article Last Modified on 7/5/2005
/* Compile options needed: none
*/
/********** Source File One **********/
void func1(void);
template < class T> T SwapTemplate(T Source) {
return Source;
}
void Dummy(void) { // Option One
char a = 'a', b;
b = SwapTemplate(a);
}
void main() {
int (*pfunc)(int) = SwapTemplate; // Option Two
func1();
}
/********** Source File Two **********/
template < class T> T SwapTemplate(T Source); // Prototype
void func1(void) {
int a = 5, b;
char c = 'c', d;
b = SwapTemplate( a );
d = SwapTemplate( c );
}
Additional query words: kbinf 9.00 9.0 9.1 9.10 2.00 2.10 4.00
Keywords: kbcpponly kbcode kbcompiler KB131014