File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' utf-8' standalone =' no' ?>
2+ <!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+ <issue num =" 4191" status =" New" >
5+ <title >P1467 changed the return type of <tt >pow(complex< float> , int)</tt ></title >
6+ <section ><sref ref =" [cmplx.over]" /></section >
7+ <submitter >Tim Song</submitter >
8+ <date >10 Jan 2025</date >
9+ <priority >99</priority >
10+
11+ <discussion >
12+ <p >
13+ Before C++20,<sref ref =" [cmplx.over]" /> says that this produces a <tt >complex< double> </tt >.
14+ This was confirmed by LWG <iref ref =" 844" /> and consistent with C99.
15+ <p />
16+ <paper num =" P1467" /> changed the return type to <tt >complex< common_type_t< float, int>> </tt >,
17+ which is <tt >complex< float> </tt >. This is a breaking change that does not appear to have been
18+ intentional.
19+ </p >
20+ </discussion >
21+
22+ <resolution >
23+ <p >
24+ This wording is relative to <paper num =" N5001" />.
25+ </p >
26+
27+ <ol >
28+
29+ <li ><p >Modify <sref ref =" [cmplx.over]" /> as indicated:</p >
30+
31+ <blockquote ><p >
32+ -3- Function template `pow` has additional constexpr overloads sufficient to ensure, for a call with one argument of
33+ type <tt >complex< T1> </tt > and the other argument of type `T2` or <tt >complex< T2> </tt >, both arguments
34+ are effectively cast to <tt >complex< common_type_t< T1, <ins >T3</ins ><del >T2</del >>> </tt ><ins >, where
35+ `T3` is `double` if `T2` is an integer type and `T2` otherwise</ins >. If <tt >common_type_t< T1, <ins >T3</ins ><del >T2</del >> </tt >
36+ is not well-formed, then the program is ill-formed.
37+ </p ></blockquote >
38+ </li >
39+ </ol >
40+
41+ </resolution >
42+
43+ </issue >
You can’t perform that action at this time.
0 commit comments