<commit_before>#ifndef SIMDIFY_COMMON_MASK_HPP
#define SIMDIFY_COMMON_MASK_HPP

#include "../util/inline.hpp"
#include "../util/trivial_type.hpp"
#include <cstdint>

namespace simd {
    namespace impl {
        // result of the mask operation
        template <uint32_t AllBitsMask>
        struct mask {
            SIMDIFY_TRIVIAL_TYPE(mask);

            SIMDIFY_INL constexpr mask(uint32_t i) : value(i) {}

            SIMDIFY_INL constexpr mask operator&(mask r) const { return mask(value & r.value); }
            SIMDIFY_INL constexpr mask operator|(mask r) const { return mask(value | r.value); }
            SIMDIFY_INL constexpr mask operator^(mask r) const { return mask(value ^ r.value); }
            SIMDIFY_INL mask& operator&=(mask r) { value &= r.value; return *this; }
            SIMDIFY_INL mask& operator|=(mask r) { value |= r.value; return *this; }
            SIMDIFY_INL mask& operator^=(mask r) { value ^= r.value; return *this; }
            SIMDIFY_INL constexpr mask operator~() const { return mask(value ^ AllBitsMask); }
            SIMDIFY_INL constexpr bool any() const { return value != 0; }
            SIMDIFY_INL constexpr bool all() const { return value == AllBitsMask; }
            SIMDIFY_INL constexpr bit_iterator begin() const { return bit_iterator(value); }
            SIMDIFY_INL constexpr bit_iterator end() const { return bit_iterator(value); }

            //data
            uint32_t value;
        };
    }

    template <typename T>
    using mask = typename T::mask_t;
}

#endif // SIMDIFY_COMMON_MASK_HPP
<commit_msg>Overload operator [] for mask<commit_after>#ifndef SIMDIFY_COMMON_MASK_HPP
#define SIMDIFY_COMMON_MASK_HPP

#include "../util/inline.hpp"
#include "../util/trivial_type.hpp"
#include <cstdint>

namespace simd {
    namespace impl {
        // result of the mask operation
        template <uint32_t AllBitsMask>
        struct mask {
            SIMDIFY_TRIVIAL_TYPE(mask);

            SIMDIFY_INL constexpr mask(uint32_t i) : value(i) {}

            SIMDIFY_INL constexpr bool operator[](int i) const { return value & (1U << i); }
            SIMDIFY_INL constexpr mask operator&(mask r) const { return mask(value & r.value); }
            SIMDIFY_INL constexpr mask operator|(mask r) const { return mask(value | r.value); }
            SIMDIFY_INL constexpr mask operator^(mask r) const { return mask(value ^ r.value); }
            SIMDIFY_INL mask& operator&=(mask r) { value &= r.value; return *this; }
            SIMDIFY_INL mask& operator|=(mask r) { value |= r.value; return *this; }
            SIMDIFY_INL mask& operator^=(mask r) { value ^= r.value; return *this; }
            SIMDIFY_INL constexpr mask operator~() const { return mask(value ^ AllBitsMask); }
            SIMDIFY_INL constexpr bool any() const { return value != 0; }
            SIMDIFY_INL constexpr bool all() const { return value == AllBitsMask; }
            SIMDIFY_INL constexpr bit_iterator begin() const { return bit_iterator(value); }
            SIMDIFY_INL constexpr bit_iterator end() const { return bit_iterator(value); }

            //data
            uint32_t value;
        };
    }

    template <typename T>
    using mask = typename T::mask_t;
}

#endif // SIMDIFY_COMMON_MASK_HPP

{'fraction_non_alphanumeric': 0.10439054344488793, 'fraction_numerical': 0.00460546515198035, 'mean_word_length': 2.6565656565656566, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6791778', 'n_tokens_mistral': 1097, 'n_tokens_neox': 983, 'n_words': 275}