cplusplus / nbballot

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

US324 26.05 Allow std::byte for bit operations P1856 #320

Closed wg21bot closed 5 years ago

wg21bot commented 5 years ago

§26.5.4 Integral powers of 2 [bit.pow.two]; §26.5.5 Rotating [bit.rotate]; §26.5.6 Counting [bit.count]

By strict interpretation of the wording, none of these new bit-oriented interfaces work with std::byte. Given the discussion in the minutes it seems like this was something intentionally left out, to be patched later. A cast to unsigned integral type for std::byte makes a type which already suffers from lack of math operations and similar even more verbose when working with operations it is absolutely supposed to apply to. This is not a useful restriction.

Proposed change: For sections §26.5.4 Integral powers of 2 [bit.pow.two]; §26.5.5 Rotating [bit.rotate]; §26.5.6 Counting [bit.count], change the "Remarks" text to be as follows -- "Remarks: This function shall not participate in overload resolution unless T is an unsigned integer type ([basic.fundamental]) or byte ([cstddef.syn]). If T is byte, then the expression is equivalent to std:: ???(static_cast<underlying_type_t>(value))." Substitute the name of each function from the section for ???. cplusplus/papers#610

wg21bot commented 5 years ago

Duplicate of FR323 #319.

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.