CTMacUser
(Daryle Walker)
1
Let's take:
~myArray[myIndex].leadingZeroBitCount,
where the element type also supports prefix ~. Is the evaluation
(~myArray[myIndex]).leadingZeroBitCount or
~(myArray[myIndex].leadingZeroBitCount)?
Joe_Groff
(Joe Groff)
2
Postfix productions bind tighter than prefix, as in C, so you should get ~(myArray[myIndex].leadingZeroBitCount).
2 Likes
CTMacUser
(Daryle Walker)
3
So if I need the highest-order zero bit, I'd need the parentheses before the member:
(~myArray[myIndex]).leadingZeroBitCount
i.e. I want the element's leading-ONE-bit-count, not the bit shift of the count result.