Skip to content

<yvals_core.h>: Fix <bit> feature-test macros - #695

Merged
Casey Carter (CaseyCarter) merged 2 commits into
microsoft:masterfrom
CaseyCarter:pow2
Apr 10, 2020
Merged

Casey Carter (CaseyCarter) merged 2 commits into
microsoft:masterfrom
CaseyCarter:pow2

Conversation

@CaseyCarter

@CaseyCarter Casey Carter (CaseyCarter) commented Apr 8, 2020

Copy link
Copy Markdown
Contributor
  • Don't define __cpp_lib_bitops when __EDG__, so IntelliSense is consistent with MSVC
  • Don't define __cpp_lib_int_pow2 when __cpp_lib_bitops isn't defined since the facilities that correspond with __cpp_lib_int_pow2 are only provided when __cpp_lib_bitops is defined.

(See discussion starting at #313 (comment).)

* Don't define `__cpp_lib_bitops` when `__EDG__`, so IntelliSense is consistent with MSVC
* Don't define `__cpp_lib_int_pow2` when `__cpp_lib_bitops` isn't defined since the facilities that correspond with `__cpp_lib_int_pow2` are only provided when `__cpp_lib_bitops` is defined.

(See discussion starting at microsoft#313 (comment).)
@CaseyCarter Casey Carter (CaseyCarter) added the bug Something isn't working label Apr 8, 2020
@CaseyCarter
Casey Carter (CaseyCarter) requested a review from a team as a code owner April 8, 2020 15:35
Comment thread stl/inc/yvals_core.h
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) changed the title <yvals_core.h>: Cleanup <bit> feature-test macros <yvals_core.h>: Fix <bit> feature-test macros Apr 9, 2020
Comment thread stl/inc/yvals_core.h
Comment on lines +1114 to +1116
#ifdef __cpp_lib_bitops // TRANSITION, VSO-1020212
#define __cpp_lib_int_pow2 202002L
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I observe that <bit> guards its non-bit_cast content with #ifdef __cpp_lib_bitops // TRANSITION, VSO-1020212 instead of having separate sections for that and __cpp_lib_int_pow2. This is fine, but I thought I'd mention it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I wrote the guard before __cpp_lib_int_pow2 was a thing.

Comment thread stl/inc/yvals_core.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants