<commit_before>#include <filter.hpp>

#include <vector>
#include <iostream>

using iter::filter;

bool greater_than_four(int i) {
    return i > 4;
}

class LessThanValue {
    private:
        int compare_val;

    public:
        LessThanValue() = delete;
        LessThanValue(int v) : compare_val(v) { }
        
        bool operator() (int i) {
            return i < this->compare_val;
        }
};


int main() {
    std::vector<int> vec{1, 5, 6, 7, 2, 3, 8, 3, 2, 1};

    std::cout << "Greater than 4 (function pointer)\n";
    for (auto i : filter(greater_than_four, vec)) {
        std::cout << i << '\n';
    }

    std::cout << "Less than 4 (lambda)\n";
    for (auto i : filter([] (const int i) { return i < 4; }, vec)) {
        std::cout << i << '\n';
    }

    LessThanValue lv(4);
    std::cout << "Less than 4 (callable object)\n";
    for (auto i : filter(lv, vec)) {
        std::cout << i << '\n';
    }

    std::cout << "Nonzero ints filter(vec2)\n";
    std::vector<int> vec2 {0, 1, 2, 0, 3, 0, 0, 0, 4, 5, 0};
    for (auto i : filter(vec2)) {
        std::cout << i << '\n';
    }


    return 0;
}<commit_msg>Adds test with initializer_list<commit_after>#include <filter.hpp>

#include <vector>
#include <iostream>

using iter::filter;

bool greater_than_four(int i) {
    return i > 4;
}

class LessThanValue {
    private:
        int compare_val;

    public:
        LessThanValue() = delete;
        LessThanValue(int v) : compare_val(v) { }
        
        bool operator() (int i) {
            return i < this->compare_val;
        }
};


int main() {
    std::vector<int> vec{1, 5, 6, 7, 2, 3, 8, 3, 2, 1};

    std::cout << "Greater than 4 (function pointer)\n";
    for (auto i : filter(greater_than_four, vec)) {
        std::cout << i << '\n';
    }

    std::cout << "Less than 4 (lambda)\n";
    for (auto i : filter([] (const int i) { return i < 4; }, vec)) {
        std::cout << i << '\n';
    }

    LessThanValue lv(4);
    std::cout << "Less than 4 (callable object)\n";
    for (auto i : filter(lv, vec)) {
        std::cout << i << '\n';
    }

    std::cout << "Nonzero ints filter(vec2)\n";
    std::vector<int> vec2 {0, 1, 2, 0, 3, 0, 0, 0, 4, 5, 0};
    for (auto i : filter(vec2)) {
        std::cout << i << '\n';
    }


    std::cout << "ever numbers in initializer_list\n";
    for (auto i : filter([] (const int i) {return i % 2 == 0;},
                         {1, 2, 3, 4, 5, 6, 7}))
    {
        std::cout << i << '\n';
    }

    return 0;
}
{'fraction_non_alphanumeric': 0.18413710641689918, 'fraction_numerical': 0.028298126743722597, 'mean_word_length': 2.1612090680100757, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 17, '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': '7280151', 'n_tokens_mistral': 986, 'n_tokens_neox': 906, 'n_words': 269}