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

[time.duration.cons] sentence in p3 is not clear LWG 3090 #4476

Closed
cpplearner opened this issue Jan 29, 2021 · 3 comments
Closed

[time.duration.cons] sentence in p3 is not clear LWG 3090 #4476

cpplearner opened this issue Jan 29, 2021 · 3 comments
Labels
lwg Issue must be reviewed by LWG.

Comments

@cpplearner
Copy link
Contributor

cpplearner commented Jan 29, 2021

[time.duration.cons]/3:

Constraints: No overflow is induced in the conversion and treat_­as_­floating_­point_­v<rep> is true or both ratio_­divide<Period2, period>​::​den is 1 and treat_­as_­floating_­point_­v<Rep2> is false.

  1. There are a bit too many conjunctions in this sentence, making the sentence hard to parse.
  2. It's unclear what "No overflow is induced in the conversion" means. Based on LWG 2094, I guess it means that no overflow shall occur when computing ratio_divide, but this is not obvious.
    (My initial reading is that duration<int, micro> us = duration<int, milli>::max(); should be an error due to overflow, but the example shows that ms is convertible to duration<int, micro>, and we can't SFINAE on argument value).
@JohelEGP
Copy link
Contributor

https://wg21.link/LWG3090 also touches on 2.

@jensmaurer
Copy link
Member

Adding a comma before "or both" probably addresses your first concern.

@jwakely
Copy link
Member

jwakely commented Jan 29, 2021

https://wg21.link/LWG3090 also touches on 2.

My proposed resolution also resolves 1. I think this is an exact dup of LWG 3090.

@jensmaurer jensmaurer changed the title [time.duration.cons] sentence in p3 is not clear [time.duration.cons] sentence in p3 is not clear LWG 3090 Jan 29, 2021
@jensmaurer jensmaurer added the lwg Issue must be reviewed by LWG. label Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG.
Projects
None yet
Development

No branches or pull requests

4 participants