Skip to content
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

P0870 A proposal for a type trait to detect narrowing conversions #724

Open
wg21bot opened this issue Jan 18, 2020 · 27 comments
Open

P0870 A proposal for a type trait to detect narrowing conversions #724

wg21bot opened this issue Jan 18, 2020 · 27 comments
Labels
B3 - Addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++26 Targeted at C++26 IS Ship vehicle: IS LEWG Library Evolution ready-for-library-evolution-electronic-poll scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review small paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Jan 18, 2020

P0870R1 A proposal for a type trait to detect narrowing conversions (Giuseppe D'Angelo)

@wg21bot wg21bot added the LEWGI Library Evolution Incubator label Jan 18, 2020
@wg21bot wg21bot added this to the 2020-02 milestone Jan 18, 2020
@jfbastien jfbastien added the EWGI Evolution Incubator label Feb 11, 2020
@theres-waldo theres-waldo added this to Thursday PM in EWG-I Prague Feb 11, 2020
@theres-waldo theres-waldo moved this from Thursday PM to Wednesday PM in EWG-I Prague Feb 12, 2020
@erichkeane
Copy link
Collaborator

erichkeane commented Feb 12, 2020

EWG-I in Prague

Forward D0870R2 to EWG, as we believe that EWGI cannot provide any further useful feedback to the author.

SF F N A SA
5 4 0 0 0

@erichkeane erichkeane added EWG Evolution and removed EWGI Evolution Incubator labels Feb 12, 2020
@jfbastien jfbastien removed the LEWGI Library Evolution Incubator label Feb 13, 2020
@jfbastien jfbastien added this to Friday in EWG Prague Feb 13, 2020
@jfbastien
Copy link
Collaborator

jfbastien commented Feb 14, 2020

EWG Prague Friday afternoon:

D0870R2 A proposal for a type trait to detect narrowing conversions

Send to SG6 Numerics for input.

SF F N A SA
4 4 6 3 0

We have no concerns with this, only send this paper back to us if SG6 or LEWG / LWG / CWG ask.

SF F N A SA
3 13 2 0 0

@jfbastien jfbastien added SG6 Numerics LEWG Library Evolution and removed EWG Evolution labels Feb 14, 2020
@brycelelbach
Copy link
Collaborator

brycelelbach commented Feb 18, 2020

Prague 2020-02 LEWGI Minutes

P0870R1 std::is_narrowing_conversion: Direction Review

Chair: Billy Baker

Champion: Marc Mutz

Minute Taker: David Olsen

Start Review: 2020-02-11 08:39

You mentioned that there are proposed changes to what are narrowing conversions in flight? Do we expect the definition to change again in the future?

Does EWG(I) need to see this?

Start Polling: 9:14

POLL: We should promise more committee time to pursuing P0870, knowing that our time is scarce and this will leave less time for other work.

Strongly For Weakly For Neutral Weakly Against Strongly Against
2 10 2 1 0

Attendance: 20

# of Authors: 1

Author Position: SF

End: 9:16

CONSENSUS: Bring a revision of P0870R1 (std::is_narrowing_conversion) to EWGI for review, and then revise, with the guidance below, and return to LEWGI for further design review.

  • Paper authors are encouraged to provide a better example of an implementation.
  • Paper authors are encouraged to provide a revision history.
  • Paper authors are encouraged to provide additional references in P0870 to papers related to narrowing conversions that were mentioned during the discussion such as P1818.

@brycelelbach brycelelbach added LEWGI Library Evolution Incubator needs-revision Paper needs changes before it can proceed and removed LEWG Library Evolution labels Feb 18, 2020
@jensmaurer jensmaurer removed this from the 2020-02 milestone Feb 18, 2020
@wg21bot
Copy link
Collaborator Author

wg21bot commented Apr 24, 2020

P0870R2 A proposal for a type trait to detect narrowing conversions (Giuseppe D'Angelo)

@wg21bot wg21bot added this to the 2020-telecon milestone Apr 24, 2020
@jfbastien jfbastien removed the needs-revision Paper needs changes before it can proceed label Apr 24, 2020
@wg21bot
Copy link
Collaborator Author

wg21bot commented May 21, 2020

P0870R3 A proposal for a type trait to detect narrowing conversions (Giuseppe D'Angelo)

@cor3ntin cor3ntin added this to Mailing List Discussion Queue in Library Evolution Telecons Aug 4, 2020
@brycelelbach brycelelbach added LEWG Library Evolution B3 - Addition Bucket 3 as described by P0592: material that is not mentioned in P0592 TS Ship vehicle: TS numerics-ts-1 and removed LEWGI Library Evolution Incubator labels Aug 25, 2020
@jwakely jwakely removed the SG6 Numerics label Feb 28, 2022
@dangelog
Copy link

dangelog commented May 20, 2022

Hi all,

With SG6 having approved the paper, may I kindly ask to have it moved back into LEWG's queue?

During SG6's meeting there has been a request for better wording. I am afraid I don't have the necessary skills to improve on the existing one; if this matters for LEWG, just let me know, I'll try to find some help and produce a revised paper.

Thank you,

@brycelelbach brycelelbach removed the library-evolution-deferred Ready for review, but should not be scheduled label Jun 6, 2022
@brycelelbach
Copy link
Collaborator

brycelelbach commented Jun 6, 2022

LEWG will take a look at this.

@brycelelbach brycelelbach added IS Ship vehicle: IS and removed IS Ship vehicle: IS labels Jun 6, 2022
@brycelelbach
Copy link
Collaborator

brycelelbach commented Jun 19, 2022

Is this still targeted for a TS?

@brycelelbach brycelelbach added the library-evolution-deferred Ready for review, but should not be scheduled label Jun 19, 2022
@brycelelbach
Copy link
Collaborator

brycelelbach commented Jun 19, 2022

Deferring until we have a broader discussion about the status of the numerics TS.

@dangelog
Copy link

dangelog commented Jun 19, 2022

Hello,

To be honest I never had the intention of targeting the numeric TS, but the IS. I'm not sure how/when this got "redirected". I'll obviously trust your judgement if you think that the TS is a more appropriate shipping vehicle. :)

@mattkretz
Copy link
Collaborator

mattkretz commented Jun 20, 2022

I don't think the shipping vehicle discussion came up in SG6. I believe the assumption was to go straight for the IS. At least SG6 has raised no questions that would require a TS process to answer. Let's have the TS discussion. But I believe LEWG can look at this paper independently and determine whether it could profit from a TS cycle or not.

@brycelelbach brycelelbach added IS Ship vehicle: IS C++26 Targeted at C++26 and removed TS Ship vehicle: TS labels Jun 21, 2022
@brycelelbach
Copy link
Collaborator

brycelelbach commented Jun 21, 2022

We'll look at it and assume we're looking at it for the IS.

@brycelelbach brycelelbach added ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review medium paper size estimate small paper size estimate and removed library-evolution-deferred Ready for review, but should not be scheduled numerics-ts-1 small paper size estimate medium paper size estimate labels Jun 21, 2022
@brycelelbach brycelelbach added scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review and removed scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review labels Aug 2, 2022
@brycelelbach
Copy link
Collaborator

brycelelbach commented Sep 23, 2022

2022-09-13 Joint Library Evolution and Numerics Telecon

P0870R4: Type trait to detect narrowing conversions

2022-09-13 Joint Library Evolution and Numerics Telecon Minutes

Chair: Bryce Adelstein Lelbach

Minute Taker: Mark Hoemmen

Champion: Giuseppe D'Angelo

Start: 2022-09-13 11:05 Eastern

Does this paper have:

  • Examples?
    • Yes.
  • Field experience?
    • Implementation experience?
      • Yes, within Qt and as a patch to libstdc++.
    • Usage experience?
      • Yes, within Qt and as a patch to libstdc++.
    • Deployment experience?
      • Yes, within Qt and as a patch to libstdc++.
  • Discussion of prior art?
    • Yes.
  • Changes Library Evolution previously requested?
    • Yes.
  • Wording?
    • Yes, but the Numerics group has suggested it could be improved.
  • Feature test macro?
    • Yes.
  • Freestanding?
    • The intention is yes.

Should future things like optional use is_convertible_without_narrowing?

Changing optional to use is_convertible_without_narrowing would be a breaking change - for example you can construct an optional<int> from a double today.

A variant<int> can't be constructed from a double, because it doesn't allow construction from things that narrow. Same for expected.

Related: P2509R0 (Type trait to detect value-preserving conversions).

POLL: Send P0870R4 (Type trait to detect narrowing conversions) to Library for C++26 classified as B3 - addition, to be confirmed with a Library Evolution electronic poll.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
7 6 1 0 0

Attendance: 18

# of Authors: 1

Author Position: SF

Outcome: Strong consensus in favor.

End: 11:38

Summary

This is a proposal for a new trait to detect narrowing conversions. As narrowing conversions themselves are not extensible to user-defined arithmetic types, the author's intent is for this proposal to just cover builtin types.

There was some discussion about how we might use this trait within the Standard Library, both for existing features and future features. Some proposed that we could change existing types, like optional and variant, to use this trait, but others pointed out this would be a breaking change in semantics.

We also briefly talked about a related proposal, P2509 (Type trait to detect value-preserving conversions).

Library Evolution feels this feature is useful and we believe the proposal is well-baked.

Next Steps

Take a Library Evolution electronic poll to send P0870R4 (Type trait to detect narrowing conversions) to Library for C++26 classified as B3 - addition.

@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review labels Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B3 - Addition Bucket 3 as described by P0592: material that is not mentioned in P0592 C++26 Targeted at C++26 IS Ship vehicle: IS LEWG Library Evolution ready-for-library-evolution-electronic-poll scheduled-for-library-evolution This paper has been scheduled for either a Library Evolution mailing list or meeting review small paper size estimate
Projects
No open projects
Development

No branches or pull requests