cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

FR323 26.05 Allow std::byte for bit operations P1856 #319

Closed wg21bot closed 5 years ago

wg21bot commented 5 years ago

The current wording of low level bit manipulation functions specified by "P0553R4: Bit operations" and by "P0556R3: Integral power-of-2 operations" make these functions unusable with std::byte. Since the whole purpose of the introduction of std::byte was to break the ambiguity between pure integers vs memory storage, the incompatibility between low level bit functions and std::byte reintroduces this pre-C++17 ambiguity for users. The current design may make future evolution of the header more complicated.

Proposed change: Introduce a machine word “concept” as well as related type traits (binary_digits, is_word) that unsigned integers, extended unsigned integers, and std::byte satisfy. This mechanism should also constitute a customization point for advanced users who want to provide their own words types. Have the low-level bit operations take machine words as inputs and not only unsigned integers. See paper P1856R1. cplusplus/papers#610

tituswinters commented 5 years ago

LEWG in Belfast: No consensus for change.

jensmaurer commented 5 years ago

Rejected. There was no consensus to adopt this change.