Title
P1467 changed the return type of pow(complex<float>, int)
Status
voting
Section
[cmplx.over]
Submitter
Tim Song

Created on 2025-01-10.00:00:00 last changed 2 days ago

Messages

Date: 2025-02-07.16:10:08

Proposed resolution:

This wording is relative to N5001.

  1. Modify [cmplx.over] as indicated:

    -3- Function template `pow` has additional constexpr overloads sufficient to ensure, for a call with one argument of type complex<T1> and the other argument of type `T2` or complex<T2>, both arguments are effectively cast to complex<common_type_t<T1, T3T2>>, where `T3` is `double` if `T2` is an integer type and `T2` otherwise. If common_type_t<T1, T3T2> is not well-formed, then the program is ill-formed.

Date: 2025-02-15.00:00:00

[ 2025-02-07; Reflector poll ]

Set status to Tentatively Ready after eight votes in favour during reflector poll.

Date: 2025-01-10.00:00:00

Before C++20, [cmplx.over] says that this produces a complex<double>. This was confirmed by LWG 844 and consistent with C99.

P1467 changed the return type to complex<common_type_t<float, int>>, which is complex<float>. This is a breaking change that does not appear to have been intentional.

History
Date User Action Args
2025-02-07 22:49:15adminsetstatus: ready -> voting
2025-02-07 16:10:08adminsetmessages: + msg14578
2025-02-07 16:10:08adminsetstatus: new -> ready
2025-01-18 16:00:01adminsetmessages: + msg14539
2025-01-10 00:00:00admincreate