20 May
2009
20 May
'09
2:43 p.m.
Hi there, I have a bunch of functions that accept two numeric arguments. In the case that the types of these arguments are different I want to figure out what the return type should be. The rule I would like to use is that the largest of the two types should be used for internal computations and the return type. f(someFloat, someDouble) -> double f(someFloat, someFloat) -> float f(someInt, someFloat) -> float Is there a way I can do this, perhaps with boost's type_traits? Cheers, Alex