Regarding the proposed Binray Literals Deprecation

Patrick Schluter Patrick.Schluter at bbox.fr
Wed Sep 14 08:43:29 UTC 2022


On Tuesday, 13 September 2022 at 20:41:53 UTC, Ali Çehreli wrote:
> On 9/11/22 16:00, Steven Schveighoffer wrote:
>
> > I'm actually quite proud of the bit shifting code, I tried to
> find the
> > most efficient/clever mechanism to test for a straight given
> a bitfield.
> > Once I thought of it, it was simple to implement and
> understand:
> >
> > 
> https://github.com/schveiguy/poker/blob/6f70cf7ca74e19e78b470f81640a3ce34a95d0d3/source/poker/hand.d#L245-L256
>
> That's very clever! :)
>

`core.bitop.popcnt(check) == 4` would be simpler and most modern 
CPU's have an instruction for that.




More information about the Digitalmars-d mailing list