
16 Jan
2025
16 Jan
'25
5:08 p.m.
Matt Borland wrote:
I guess I don't know a "superior" way to write all types in T should be decimal floating point types.
(is_decimal_floating_point_v<T> && ...) when fold expressions are available, and std::conjunction_v<is_decimal_floating_point<T>> when not. (Or mp11::mp_all instead of std::conjunction.) But that's not what the common_type constraint said. common_type<int, decimal32> is decimal32, so it would accept (int, decimal32). (But would not accept int by itself, or (int, int).)