<commit_before>#pragma once

#include <unordered_set>
#include <functional>
#include <algorithm>

namespace ChaoticLib{

	template <class Derived, class Traits, bool CheckDuplicate=false, bool MultiThread=false>
	class ResourceManager{
		std::unordered_set<typename Traits::Resource*> resources;
		bool create;

	public:
		ResourceManager():
		  create(false)
		{
		}

		~ResourceManager()
		{
			std::for_each(resources.begin(), resources.end(), std::mem_fn(&Traits::Resource::DestroyResource));
		}

		bool WindowProc(HWND, UINT, WPARAM, LPARAM, LRESULT &)
		{
			return true;
		}

		bool CreateResource(const typename Traits::Resource::CreateStruct &cs)
		{
			create = true;
			return std::all_of(
				resources.begin(), resources.end(),
				std::bind(
					&Traits::Resource::CreateResource,
					std::placeholders::_1,
					std::ref(cs)));
		}

		void DestroyResource()
		{
			create = false;<commit_msg>add Direct2D namespace<commit_after>#pragma once

#include <unordered_set>
#include <functional>
#include <algorithm>

namespace ChaoticLib{

	template <class Derived, class Traits, bool CheckDuplicate=false, bool MultiThread=false>
	class ResourceManager{
		std::unordered_set<typename Traits::Resource*> resources;
		bool create;

	public:
		ResourceManager():
		  create(false)
		{
		}

		~ResourceManager()
		{
			std::for_each(resources.begin(), resources.end(), std::mem_fn(&Traits::Resource::DestroyResource));
		}

#ifdef _MSC_VER
		bool WindowProc(HWND, UINT, WPARAM, LPARAM, LRESULT &)
		{
			return true;
		}
#endif

		bool CreateResource(const typename Traits::Resource::CreateStruct &cs)
		{
			create = true;
			return std::all_of(
				resources.begin(), resources.end(),
				std::bind(
					&Traits::Resource::CreateResource,
					std::placeholders::_1,
					std::ref(cs)));
		}

		void DestroyResource()
		{
			create = false;
{'fraction_non_alphanumeric': 0.13498920086393087, 'fraction_numerical': 0.0016198704103671706, 'mean_word_length': 4.684049079754601, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2455184', 'n_tokens_mistral': 698, 'n_tokens_neox': 590, 'n_words': 124}