No, it's not possible in C++ to have the return type depend on the values of the operands in the way you're hoping for. What would be the point anyway, since the next layer of code out from there will need to know statically what the result type is?

Now, if your values are all known at compile time, you can do some template magic to make things happen during compilation, but that doesn't seem to be what you're trying to accomplish.