<numbers>: Rework the implementation when concepts are missing#3633
Conversation
strega-nil-ms
left a comment
There was a problem hiding this comment.
Minor change, but otherwise this looks great :)
Rename `_Reject_primary_template(_t)` to `_Reject_invalid(_t)`. Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
|
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 |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
🔢 🔢 🔢 |
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 tostd::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
constexprandvolatile.