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

<numbers>: Rework the implementation when concepts are missing #3633

Merged

Conversation

frederick-vs-ja
Copy link
Contributor

In recent PR #3623 I noticed that the implementation of <numbers> when concepts are unavailable didn't seem correct enough. These variable templates are required to support possibly cv-qualified floating-point types due to std::floating_point, but the current concept-free implementation only supports cv-unqualified FP types.

This PR is adding test coverage for cv-qualified FP types, and rewriting the concept-free implementation. Technically, only the primary template is used, but I believe that the difference from the standard wording is unobservable.

Warning C4197 was encountered during local test. I think it's OK to only suppress that warning in testing, because it's already weird to use something that is both constexpr and volatile.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 7, 2023 03:14
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change, but otherwise this looks great :)

stl/inc/numbers Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Apr 7, 2023
frederick-vs-ja and others added 4 commits April 8, 2023 13:34
Rename `_Reject_primary_template(_t)` to `_Reject_invalid(_t)`.

Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
@StephanTLavavej
Copy link
Member

Thanks, I think this is a nice improvement!

For the future, note that the non-concepts mode exists only for the STL's test suite. (By special agreement with the IDE team, we enable concepts code for actual IntelliSense, which doesn't need to deeply instantiate templates the way that /BE does.)
While this PR eliminates enough squirrelliness 🐿️ to be worthwhile, I think that any additional PRs would be less valuable. Instead of searching for additional non-concepts code to clean up, it would be better to spend cycles on #1621. (EDG is getting closer to fixing the blocking bugs for concepts, but last I heard, they could still use additional help getting truly minimized repros of the remaining issues.)

@StephanTLavavej StephanTLavavej self-assigned this Apr 12, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit fc480dd into microsoft:main Apr 14, 2023
@StephanTLavavej
Copy link
Member

🔢 🔢 🔢

@frederick-vs-ja frederick-vs-ja deleted the rework-numbers-no-concept branch April 14, 2023 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
  翻译: