I wonder why they must have the same type?
In C++ any expression must have a single type, and the compiler should be able to deduce it at compile time.
This stems from the fact that C++ is a statically typed language wherein all types must be known at compile time.