Determining the “optimal” common numeric type in a template parameter pack
What is the best way to determine a common numeric type in a template parameter pack with: the smallest size, no loss of precision, and no risk of overflow/underflow when converting any type in the parameter pack to this "ideal" common type? The variadic template ( best_common_numeric_type ) could be used like so: template<typename... NumericTypes> auto some_numeric_func(const NumericTypes&...) -> typename best_common_numeric_type<NumericTypes...>::type; And have instantiations like the following: [1] best_common_numeric_type<long, unsigned long, float, double, int>::type = double [2] best