Boost logo

Boost :

From: Hervé Brönnimann (hbr_at_[hidden])
Date: 2006-05-26 10:57:34


> The counting starts with bit number 0.
> So is_odd now becomes lowest_bit() == 0.

But isn't lowest_bit() != 0 an overkill for checking that a number is
even? (I mean, first computing the order of the lowest_bit, then
comparing to 0...) I think there is room for lowest_bit /
highest_bit as well as for is_odd and is_even. Perhaps it will be
more readable than the idiom "integer(x) %2 == 0".

--
Hervé Brönnimann
CIS, Polytechnic University
hbr_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk