constexpr icon indicating copy to clipboard operation
constexpr copied to clipboard

Explicit specialization needed for cpp14_promoted<long double, long double>

Open rcorden-perforce opened this issue 2 years ago • 0 comments

Hi,

The partial specializations provided for cpp14_promoted in cx_math.h (https://github.com/elbeno/constexpr/blob/master/src/include/cx_math.h#L872) are ambiguous.

This can also be seen by testing with some main stream compilers: https://godbolt.org/z/rGfcGzKfh

The easiest fix is to provide an explicit specialization for when the types are both long double:

  template <  >
  struct cpp14_promoted < long double , long double >
  {
    using type = long double ;
  } ;

rcorden-perforce avatar Feb 08 '23 13:02 rcorden-perforce