microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
10.04k stars 1.48k forks source link

<yvals_core.h>: Remove _HAS_STD_BYTE someday #204

Open StephanTLavavej opened 4 years ago

StephanTLavavej commented 4 years ago

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:

https://github.com/microsoft/STL/blob/447f879b136950baf3ca35dfb54c359494fa2a77/stl/inc/yvals_core.h#L475-L477

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

JordanMaples commented 4 years ago

gsl_byte now inspects __cpp_lib_byte, this should unblock you.

StephanTLavavej commented 4 years ago

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 commented 4 years ago

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

miscco commented 4 years ago

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

CaseyCarter commented 4 years ago

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

OS-11785508 hasn't been addressed yet.

Zingam commented 3 years ago

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

CaseyCarter commented 3 years ago

@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: https://github.com/microsoft/STL/blob/9959929c77b18e25b6dfbc8886e311b913321925/stl/inc/yvals_core.h#L1115-L1117

StephanTLavavej commented 3 years ago

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 commented 1 year ago

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

StephanTLavavej commented 1 year ago

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.