given function type template : template<typename typea, typename typeb, typename typec> void foo (typea a, typeb b, typec c) { ...; } then hope call function approach shown follows: int main (void) { int ta = 32; int tb = 64; int tc = 32; float *array_a; double *array_b; float *array_c; foo<(ta == 32 ? float : double), (tb == 32 ? float : double), (tc == 32 ? float : double)>(array_a, array_b, array_c); return 0; } of course, code results in compile error... however, wonder whether there convenient way check ta's, tb's, , tc's value , call function foo accordingly... first of all, choosing type use instantiate template based on value of variable , conditional operator syntactically wrong. language doesn't allow type chosen method. second, can let compiler deduce type. can use: foo(array_a, array_b, array_c); the compiler deduce typea float* , typeb double* , , typec float* . using ...