Ticket #5158: lowest_bit.patch

File lowest_bit.patch, 667 bytes (added by astukalov@…, 12 years ago)

lowest_bit() patch against the trunk

  • boost/pending/lowest_bit.hpp

     
    3232
    3333    }
    3434
     35    template<>
     36    inline int lowest_bit(unsigned int x) {
     37        assert(x >= 1); // PRE
    3538
     39        return __builtin_ctz( x );
     40    }
     41
     42    template<>
     43    inline int lowest_bit(unsigned long x) {
     44        assert(x >= 1); // PRE
     45
     46        return __builtin_ctzl( x );
     47    }
     48
     49    template<>
     50    inline int lowest_bit(unsigned long long x) {
     51        assert(x >= 1); // PRE
     52
     53        return __builtin_ctzll( x );
     54    }
    3655}
    3756
    3857