On Sun, 12 Apr 2015 15:21:24 +0000, Johan Engelen wrote: >>> 2) Is the current sign-extend up to size_t's width really intended >>> behavior? >> >> It's due to integer promotions, so it should only influence bsr (when >> it is called with a signed type.) > > Sorry for not being clear. > I understand why the current bsr behaves like it does, but what I meant > is whether that is the desired behavior of bsr: > bsr( byte(-1) ) == 31 (32-bit size_t) > bsr( byte(-1) ) == 63 (64-bit size_t) > instead of > bsr( byte(-1) ) == 7
i'd say that with explicitly given type it should be 7. but i don't know if it will break any code in druntime/phobos...
signature.asc
Description: PGP signature
