New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cmath.syn] LWG 2847: C functions show five overloads; those from [sf.math] only three #1247
Comments
My opinion: Since we do not (and should not) show the exact overload set needed to satisfy all of the "sufficient additional overloads" provision, we might as well get rid of the |
Hm, we discussed this in Oulu a bit. We definitely wanted the floating overloads, together with the comment, so that it's easy to see what's added relative to C (e.g. because those functions might need to have different linkage). I think the floating overloads are specified to exist exactly in this form. By contrast, we didn't want to add the "sufficient" overloads because their exact shape is not specified. (I think you would generally just provide an So I am mildly in favour of adding the @jwakely felt pretty strongly about this issue if I recall correctly. |
@W-E-Brown: What's your opinion? |
@tkoeppe: "I think you would generally just provide an intmax_t version to handle all integral arguments." This statement appears to be incorrect. "integral conversion" and "floating-integral conversion" have the same rank in [over.ics.scs]. void f(float); void g() |
@tkoeppe: "I think the floating overloads are specified to exist exactly in this form." |
Ah yes, indeed. Interesting. Well, I'd like @jwakely to weigh in, who had asked for the current style. |
Put differently, is there an intended normative difference in overloading behavior between, say, |
@jensmaurer: Ah, wait, it was like this: The overloads were specified in the wording before we applied P0175. So that's pre-Oulu. The synopses replace that wording. |
@jensmaurer: That's 26.9p11 and p12 in, say N4594. Note that p13 adds the additional overloads. |
I wonder whether there's some wording missing, both before and after P0175, that the I always assumed that that would be the intention, but I think the wording never made this precise. I think that would be the real value of listing those overloads in the synopsis. "You can use the name |
@tkoeppe: Aha. That makes sense, but such desires are missing from the normative wording. |
@jensmaurer: Yes, I think we should probably make an LWG issue and request that a paragraph be added that says that the float/long double overloads behave like the |
|
See LWG issue 2847. Keeping this editorial issue open to address the original question of "5 vs. 3 overloads shown in the synopsis" after LWG has resolved the issue. |
Verbose overloads are removed with P1467. |
The synopsis for
<cmath>
shows five overloads for "traditional" C math functions, e.g.In contrast, for the mathematical special functions described in [sf.math], the synopsis (and the descriptions in [sf.math]) only show three overloads:
This is inconsistent.
In [cmath.syn] p2, we have the "sufficient additional overloads" provision. (As a side note, the provision doesn't talk about adjusting the return type, which seems an oversight.) This provision requires overloads for
sin(float)
andsin(double)
. Next, at least one additional overload (possibly a template) is required to handle integer types (and convert them todouble
), since [conv.fpint] and [over.ics.rank] do not differentiate a conversion fromint
tofloat
vs. a conversion fromint
todouble
, thereby making overload resolution for integer arguments ambiguous.(Source: Dawn's list of issues discovered during review/integration of the math special functions.)
The text was updated successfully, but these errors were encountered: