Lexicographic comparison
| 732 | |
| 733 | /// Lexicographic comparison |
| 734 | bool operator<(const bitset_inlined &other) const FL_NOEXCEPT { |
| 735 | fl::u32 min_size = size() < other.size() ? size() : other.size(); |
| 736 | for (fl::u32 i = min_size; i > 0; --i) { |
| 737 | bool this_bit = test(i - 1); |
| 738 | bool other_bit = other.test(i - 1); |
| 739 | if (this_bit != other_bit) { |
| 740 | return !this_bit; // false < true |
| 741 | } |
| 742 | } |
| 743 | // All common bits are equal, shorter is less |
| 744 | return size() < other.size(); |
| 745 | } |
| 746 | |
| 747 | bool operator<=(const bitset_inlined &other) const FL_NOEXCEPT { |
| 748 | return *this < other || *this == other; |