<commit_before>#pragma once
#include <algorithm>
#include <unordered_map>
#include "snowflake.h"
#include "server.h"
#include "channel.h"

namespace SleepyDiscord {
	template<class _Type>
	using CacheParent = std::unordered_map<typename Snowflake<_Type>::RawType, _Type>;

	//This is basicity an unordered_map made to work with the library
	//only works with Discord Object with an id
	template<class _Type>
	struct Cache : public CacheParent<_Type> {
	public:
		using Type = _Type;
		using Parent = CacheParent<_Type>;
		using typename Parent::unordered_map;
		using Key = typename Snowflake<Type>::RawType;
		Cache() : Parent() {}
		Cache(Parent map) : Parent(map) {}
		template<class InputIterator>
		Cache(InputIterator first, InputIterator last) {
			for (InputIterator it = first; it != last; ++it) {
				emplace(*it);
			}
		}

		class const_iterator {
		public:
			using Value = typename Parent::const_iterator;
			//standard iterator values
			using self_type = const_iterator;
			using value_type = Type;
			using reference = Type&;
			using pointer = Type*;
			using iterator_category = typename Value::iterator_category;
			using difference_type = typename Value::difference_type;
			const_iterator(Value iter) : value(iter) {}
			inline self_type operator++() { return value++; }
			inline self_type operator++(int junk) { return value.operator++(junk); }
			inline reference operator*() { return value->second; }
			inline pointer operator->() { return &value->second; }<commit_msg>msvc++ seems to really hate this line<commit_after>#pragma once
#include <algorithm>
#include <unordered_map>
#include "snowflake.h"
#include "server.h"
#include "channel.h"

namespace SleepyDiscord {
	template<class _Type>
	using CacheParent = std::unordered_map<typename Snowflake<_Type>::RawType, _Type>;

	//This is basicity an unordered_map made to work with the library
	//only works with Discord Object with an id
	template<class _Type>
	struct Cache : public CacheParent<_Type> {
	public:
		using Type = _Type;
		using Parent = CacheParent<_Type>;
		using std::unordered_map<typename Snowflake<_Type>::RawType, _Type>::unordered_map;
		using Key = typename Snowflake<Type>::RawType;
		Cache() : Parent() {}
		Cache(Parent map) : Parent(map) {}
		template<class InputIterator>
		Cache(InputIterator first, InputIterator last) {
			for (InputIterator it = first; it != last; ++it) {
				emplace(*it);
			}
		}

		class const_iterator {
		public:
			using Value = typename Parent::const_iterator;
			//standard iterator values
			using self_type = const_iterator;
			using value_type = Type;
			using reference = Type&;
			using pointer = Type*;
			using iterator_category = typename Value::iterator_category;
			using difference_type = typename Value::difference_type;
			const_iterator(Value iter) : value(iter) {}
			inline self_type operator++() { return value++; }
			inline self_type operator++(int junk) { return value.operator++(junk); }
			inline reference operator*() { return value->second; }
			inline pointer operator->() { return &value->second; }
{'fraction_non_alphanumeric': 0.11463096015676029, 'fraction_numerical': 0.0, 'mean_word_length': 4.779245283018868, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 31, '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': '6621152', 'n_tokens_mistral': 1014, 'n_tokens_neox': 903, 'n_words': 273}