<commit_before>// <NAME>
// September 12, 2017
// Copyright (C) 2018-2019 <NAME>
// Distributed under the BSD Software License (see file License)

#include "HeteroVector.h"

// ----------------------------------------------------------------------------

namespace hmdf
{

#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
template<typename T>
std::unordered_map<const HeteroVector *, std::vector<T>> HeteroVector::vectors_;
#endif // defined(__linux__) || defined(__unix__) || defined(__APPLE__)

#ifdef _WIN32
template<typename T>
std::unordered_map<const HeteroVector *, std::vector<T>>
    HeteroVector::vectors_ { };
#endif // _WIN32

// ----------------------------------------------------------------------------

template<typename T>
std::vector<T> &HeteroVector::get_vector()  {

    auto    iter = vectors_<T>.find (this);

    // don't have it yet, so create functions for copying and destroying
    if (iter == vectors_<T>.end())  {
        clear_functions_.emplace_back (
            [](HeteroVector &hv) { vectors_<T>.erase(&hv); });

        // if someone copies me, they need to call each<commit_msg>Update HeteroVector.tcc<commit_after>// <NAME>
// September 12, 2017
// Copyright (C) 2018-2019 <NAME>
// Distributed under the BSD Software License (see file License)

#include "HeteroVector.h"

#include <algorithm>

// ----------------------------------------------------------------------------

namespace hmdf
{

#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
template<typename T>
std::unordered_map<const HeteroVector *, std::vector<T>> HeteroVector::vectors_;
#endif // defined(__linux__) || defined(__unix__) || defined(__APPLE__)

#ifdef _WIN32
template<typename T>
std::unordered_map<const HeteroVector *, std::vector<T>>
    HeteroVector::vectors_ { };
#endif // _WIN32

// ----------------------------------------------------------------------------

template<typename T>
std::vector<T> &HeteroVector::get_vector()  {

    auto    iter = vectors_<T>.find (this);

    // don't have it yet, so create functions for copying and destroying
    if (iter == vectors_<T>.end())  {
        clear_functions_.emplace_back (
            [](HeteroVector &hv) { vectors_<T>.erase(&hv); });

        // if someone copies me, they need to call each
{'fraction_non_alphanumeric': 0.259581881533101, 'fraction_numerical': 0.0156794425087108, 'mean_word_length': 2.309798270893372, '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': '7625434', 'n_tokens_mistral': 691, 'n_tokens_neox': 639, 'n_words': 164}