Section: 29.7.1 [cmath.syn] Status: Resolved Submitter: Casey Carter Opened: 2019-07-11 Last modified: 2023-02-07
Priority: 3
View other active issues in [cmath.syn].
View all other issues in [cmath.syn].
View all issues with Resolved status.
Discussion:
The "sufficient additional overloads" wording in 29.7.1 [cmath.syn] paragraph 2 does not apply to the special math functions, since they are not "overloaded functions". The lack of "sufficient additional overloads" doesn't agree with N3060 (the final draft of ISO/IEC 29124 which standardized the mathematical special functions) [sf.cmath] paragraphs 3 and 4:
-3- Each of the functions specified above that has one or more
double
parameters (thedouble
version) shall have two additional overloads:
a version with each
double
parameter replaced with afloat
parameter (thefloat
version), anda version with each
double
parameter replaced with along double
parameter (thelong double
version).The return type of each such
-4- Moreover, eachfloat
version shall befloat
, and the return type of each suchlong double
version shall belong double
.double
version shall have sufficient additional overloads to determine which of the above three versions to actually call, by the following ordered set of rules:
First, if any argument corresponding to a
double
parameter in thedouble
version has typelong double
, thelong double
version is called.Otherwise, if any argument corresponding to a
double
parameter in thedouble
version has typedouble
or has an integer type, thedouble
version is called.Otherwise, the
float
version is called.
P226R1 "Mathematical Special Functions for C++17" notably
states: "At the level of and following [c.math], create a new subclause with heading and initial
content the same as IS 29124:2010's clause [sf.cmath], 'Additions to header <cmath>
,'
renumbering as appropriate to the new context." which suggests the change between 29124 and C++17
was an oversight and not intentional.
std::sph_neumann({}, {})
is
well-formed.
[2020-04-07 Issue Prioritization]
Priority to 3 after reflector discussion.
[2023-02-07 Status changed: New → Resolved.]
Resolved by the application of P1467R9. It's now clear that the special functions should have "sufficient additional overloads".
Proposed resolution: