20 May
2009
20 May
'09
3:51 p.m.
AMDG Alex Flint wrote:
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?
A quick glance through type_traits didn't show anything.
How does this work:
#include