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

<yvals_core.h>: Remove _HAS_STD_BYTE someday #204

Open
StephanTLavavej opened this issue Oct 24, 2019 · 10 comments
Open

<yvals_core.h>: Remove _HAS_STD_BYTE someday #204

StephanTLavavej opened this issue Oct 24, 2019 · 10 comments
Labels
blocked Something is preventing work on this enhancement Something can be improved

Comments

@StephanTLavavej
Copy link
Member

StephanTLavavej commented Oct 24, 2019

After microsoft/GSL#821 "gsl_byte should inspect __cpp_lib_byte in addition to _HAS_STD_BYTE" is fixed, _HAS_STD_BYTE should no longer be needed for detection.

After the Windows SDK's unqualified mentions of byte (referring to their own ::byte) are fixed, _HAS_STD_BYTE should no longer be needed for control.

Then we can finally remove:

STL/stl/inc/yvals_core.h

Lines 475 to 477 in 447f879

#ifndef _HAS_STD_BYTE
#define _HAS_STD_BYTE _HAS_CXX17 // inspected by GSL, do not remove
#endif // _HAS_STD_BYTE

Also, I created microsoft/GSL#1145 so that GSL will no longer inspect _HAS_STD_BYTE at all.

@StephanTLavavej StephanTLavavej added enhancement Something can be improved blocked Something is preventing work on this labels Oct 24, 2019
@JordanMaples
Copy link

gsl_byte now inspects __cpp_lib_byte, this should unblock you.

@StephanTLavavej
Copy link
Member Author

Great, thank you! We’re still blocked on the WinSDK needing this as an escape hatch, but your quick fix to GSL means that there will be plenty of time for users to update their dependencies.

@StephanTLavavej
Copy link
Member Author

Microsoft-internal WinSDK issue: OS-11785508 "Make Windows headers compatible with C++17 std::byte".

@miscco
Copy link
Contributor

miscco commented Mar 4, 2020

Out of curriosity can this be closed now that the __cpp_lib_byte change is implemented

@CaseyCarter
Copy link
Member

Out of curiosity can this be closed now that the __cpp_lib_byte change is implemented

OS-11785508 hasn't been addressed yet.

@Zingam
Copy link

Zingam commented Nov 12, 2020

@StephanTLavavej Was support for std::byte removed in VS2019 16.8? It looks like __cpp_lib_byte isn't defined.

@CaseyCarter
Copy link
Member

@StephanTLavavej Was support for std::byte removed in VS2019 16.8? It looks like __cpp_lib_byte isn't defined.

We define it unless someone explicitly disables std::byte by defining _HAS_STD_BYTE to 0 before yvals_core.h is first included:

STL/stl/inc/yvals_core.h

Lines 1115 to 1117 in 9959929

#if _HAS_STD_BYTE
#define __cpp_lib_byte 201603L
#endif // _HAS_STD_BYTE

@StephanTLavavej
Copy link
Member Author

And you have to be compiling in /std:c++17 or /std:c++latest mode in order to get std::byte (and its feature-test macro).

@karam-jaber-intel
Copy link

Is this issue fixed, if not, Is there an ETA for fix?

@StephanTLavavej
Copy link
Member Author

No ETA; the Microsoft-internal WinSDK issue OS-11785508 "Make Windows headers compatible with C++17 std::byte" is still open.

I'm not sure how many unqualified mentions of byte remain in the Windows SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Something is preventing work on this enhancement Something can be improved
Projects
None yet
Development

No branches or pull requests

6 participants