<commit_before>#ifndef KGR_KANGARU_INCLUDE_KANGARU_DETAIL_DEFAULT_SOURCE_HPP
#define KGR_KANGARU_INCLUDE_KANGARU_DETAIL_DEFAULT_SOURCE_HPP

#include "kangaru/detail/config.hpp"

#include "../type_id.hpp"
#include "traits.hpp"
#include "injected.hpp"
#include "service_storage.hpp"

#include <algorithm>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <memory>
#include <iterator>

#include "define.hpp"

namespace kgr {
namespace detail {

struct default_source {
private:
	using alias_t = void*;
	
	template<typename T> using instance_ptr = std::unique_ptr<T, void(*)(alias_t) KGR_KANGARU_CXX17_NOEXCEPT>;
	
	using instance_cont = std::vector<instance_ptr<void>>;
	using service_cont = std::unordered_map<type_id_t, detail::service_storage>;
	
	template<typename T>
	static void deleter(alias_t i) KGR_KANGARU_CXX17_NOEXCEPT {
		delete static_cast<T*>(i);
	}
	
	template<typename T, typename... Args, enable_if_t<std::is_constructible<T, Args...>::value, int> = 0>
	static instance_ptr<memory_block<T>> make_instance_ptr(Args&&... args) {
		static_assert(std::is_standard_layout<memory_block<T>>::value,
			"The service memory block must be standard layout"<commit_msg>Fixed Visual studio 2017 build<commit_after>#ifndef KGR_KANGARU_INCLUDE_KANGARU_DETAIL_DEFAULT_SOURCE_HPP
#define KGR_KANGARU_INCLUDE_KANGARU_DETAIL_DEFAULT_SOURCE_HPP

#include "kangaru/detail/config.hpp"

#include "../type_id.hpp"
#include "traits.hpp"
#include "injected.hpp"
#include "service_storage.hpp"

#include <algorithm>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <memory>
#include <iterator>

#include "define.hpp"

namespace kgr {
namespace detail {

struct default_source {
private:
	using alias_t = void*;
	
	template<typename T> using instance_ptr = std::unique_ptr<T, void(*)(alias_t) KGR_KANGARU_CXX17_NOEXCEPT>;
	
	using instance_cont = std::vector<instance_ptr<void>>;
	using service_cont = std::unordered_map<type_id_t, detail::service_storage>;
	
	template<typename T>
	static void deleter(alias_t i) KGR_KANGARU_CXX17_NOEXCEPT {
		delete static_cast<T*>(i);
	}
	
	template<typename T, typename... Args>
	static instance_ptr<memory_block<T>> make_instance_ptr(Args&&... args) {
		static_assert(std::is_standard_layout<memory_block<T>>::value,
			"The service memory block must be standard layout"
{'fraction_non_alphanumeric': 0.11887515977844056, 'fraction_numerical': 0.005538985939497231, 'mean_word_length': 7.355871886120997, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '3941593', 'n_tokens_mistral': 887, 'n_tokens_neox': 820, 'n_words': 163}