
On 2/1/07, Hervé Brönnimann <hervebronnimann@mac.com> wrote:
I was surprised not to find the least_significant_ bit_index and most_significant_bit_index functions. These can be heavily optimized using binary search and logical and/or manips for integral types, compared to a loop, so it would be especially worth having in your collection. [snip]
To my understanding, these functions are already accepted into Boost under different names. See integer_log2.hpp and lowest_bit.hpp by Gennaro Prota, 2003 - 2004, in boost\pending. Function integer_log2.hpp is implemented using binary search, and function lowest_bit.hpp simply calls integer_log2.hpp. I believe that the codes can be optimized even more using lookup tables, and I work on it together with Alla Serikova. Sincerely, Yura.