<commit_before>// This file contains functionality that helps with compiler compatibility.
// It should only be included in .cpp files, never in .hpp files.
#ifndef DSB_COMPAT_HELPERS_HPP
#define DSB_COMPAT_HELPERS_HPP

#include <memory>

// VS2010 does not have std::make_unique(), so we define it ourselves.
// Why do we want this so badly?  Check out section 3 here:
// http://herbsutter.com/2013/05/29/gotw-89-solution-smart-pointers/
#if defined(_MSC_VER) && _MSC_VER < 1800
    namespace std
    {
        template<typename T>
        unique_ptr<T> make_unique() { return unique_ptr<T>(new T()); }

        template<typename T, typename A1>
        unique_ptr<T> make_unique(A1&& arg1) { return unique_ptr<T>(new T(arg1)); }

        template<typename T, typename A1, typename A2>
        unique_ptr<T> make_unique(A1&& arg1, A2&& arg2) { return unique_ptr<T>(new T(arg1, arg2)); }

        template<typename T, typename A1, typename A2, typename A3>
        unique_ptr<T> make_unique(A1&& arg1, A2&& arg2, A3&& arg3) { return unique_ptr<T>(new T(arg1)); }

        // ...continue adding more as necessary
    }
#endif

#endif // header guard<commit_msg>Custom std::make_unique() for GCC<4.9 too<commit_after>// This file contains functionality that helps with compiler compatibility.
// It should only be included in .cpp files, never in .hpp files.
#ifndef DSB_COMPAT_HELPERS_HPP
#define DSB_COMPAT_HELPERS_HPP

#include <memory>


// Having a single macro for the GCC version is sometimes useful.
#ifdef __GNUC__
#   ifdef __GNUC_PATCHLEVEL__
#       define DSB_GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#   else
#       define DSB_GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
#   endif
#endif


// VS2010 and GCC<4.9 do not have std::make_unique(), so we define it ourselves.
// Why do we want this so badly?  Check out section 3 here:
// http://herbsutter.com/2013/05/29/gotw-89-solution-smart-pointers/
#if (defined(_MSC_VER) && _MSC_VER < 1800) || (defined(DSB_GNUC_VERSION) && DSB_GNUC_VERSION < 40900)
    namespace std
    {
        template<typename T>
        unique_ptr<T> make_unique() { return unique_ptr<T>(new T()); }

        template<typename T, typename A1>
        unique_ptr<T> make_unique(A1&& arg1) { return unique_ptr<T>(new T(arg1)); }

        template<typename T, typename A1, typename A2>
        unique_ptr<T> make_unique(A1&& arg1, A2&& arg2) { return unique_ptr<T>(new T(arg1, arg2)); }

        template<typename T, typename A1, typename A2, typename A3>
        unique_ptr<T> make_unique(A1&& arg1, A2&& arg2, A3&& arg3) { return unique_ptr<T>(new T(arg1)); }

        // ...continue adding more as necessary
    }
#endif

#endif // header guard
{'fraction_non_alphanumeric': 0.11941391941391942, 'fraction_numerical': 0.039194139194139194, 'mean_word_length': 3.5440931780366056, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 29, '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': '910326', 'n_tokens_mistral': 1013, 'n_tokens_neox': 910, 'n_words': 271}