-
- Downloads
Reimplement the PromotionTraits class using decltype and declval
The previous implementation consisted of a list of promotion rules for various types. The new implementation is much shorter and more general: it will also work for types not on the old list. The promoted type is now defined as the result type of the addition of the two input types. There is no special reason to use addition here, but it does reproduce the precise behavior of the old implementation.
Loading
Please register or sign in to comment