<commit_before>/*
 * Qumulus UML editor
 * Author: <NAME>
 *
 */

#ifndef LIB_CORE_CONTAINER_H_
#define LIB_CORE_CONTAINER_H_

#include <unordered_set>
#include <unordered_map>
#include <vector>

template<class T>
using uset = std::unordered_set<T>;

template<class T, class U>
using umap = std::unordered_map<T,U>;

#endif /* LIB_CORE_CONTAINER_H_ */
<commit_msg>Easier add/remove functions. (Seriously, the stdlib sucks).<commit_after>/*
 * Qumulus UML editor
 * Author: <NAME>
 *
 */

#ifndef LIB_CORE_CONTAINER_H_
#define LIB_CORE_CONTAINER_H_

#include "internal_base.h"

#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <algorithm>

template<class T>
using uset = std::unordered_set<T>;

template<class T, class U>
using umap = std::unordered_map<T,U>;

QUML_BEGIN_NAMESPACE_LC

template<class T>
void add(std::vector<T>& v, T&& t) {
    v.push_back(std::forward<T>(t));
}

template<class T>
void add(std::unordered_set<T>& s, T&& t) {
    s.insert(std::forward<T>(t));
}

template<class T>
void remove(std::vector<T>& v, const T& t) {
    auto it = std::find(v.begin(), v.end(), t);
    v.erase(it); 
}

template<class T>
void remove(std::unordered_set<T>& v, const T& t) {
    v.erase(t);
}

QUML_END_NAMESPACE_UK

#endif /* LIB_CORE_CONTAINER_H_ */

{'fraction_non_alphanumeric': 0.1578538102643857, 'fraction_numerical': 0.0, 'mean_word_length': 5.402985074626866, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, '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': '3496273', 'n_tokens_mistral': 535, 'n_tokens_neox': 525, 'n_words': 111}