Since I am introducing template templates for small mathematical vectors, I am faced with one problem. For arithmetic operations, the return type T1 lhs + T2 rhs is std::common_type<T1, T2>::type. But what is the return type for the following (for example, T1 signed and T2 unsigned or vice versa, or T1 char and T2 unsigned long long int, etc.):
T1 lhs & T2 rhs ? T1 lhs | T2 rhs ? T1 lhs ^ T2 rhs ? T1 lhs << T2 rhs ? T1 lhs >> T2 rhs ?
Many thanks.
source share