<commit_before>#pragma once

#include <Windows.h>
#include <boost/utility.hpp>

namespace Framework
{
	namespace Win32
	{
		template <typename PtrType>
		class CComPtr : public boost::noncopyable
		{
		public:
			CComPtr()
			: m_ptr(nullptr)
			{

			}

			~CComPtr()
			{
				if(m_ptr)
				{
					m_ptr->Release();
				}
			}

			operator PtrType*()
			{
				return m_ptr;
			}

			operator PtrType**()
			{
				return &m_ptr;
			}

			PtrType* operator ->()
			{
				return m_ptr;
			}

			PtrType** operator &()
			{
				return &m_ptr;
			}

			PtrType* Detach()
			{
				PtrType* result = m_ptr;
				m_ptr = nullptr;
				return result;
			}

			bool IsEmpty() const
			{
				return (m_ptr == nullptr);
			}

		private:
			PtrType*		m_ptr;
		};
	};
};<commit_msg>Added copy and move constructor/equal operator in CComPtr.<commit_after>#pragma once

#include <Windows.h>

namespace Framework
{
	namespace Win32
	{
		template <typename PtrType>
		class CComPtr
		{
		public:
			CComPtr()
			: m_ptr(nullptr)
			{

			}

			CComPtr(const CComPtr& rhs)
			: m_ptr(nullptr)
			{
				CopyFrom(rhs);
			}

			CComPtr(CComPtr&& rhs)
			: m_ptr(nullptr)
			{
				MoveFrom(std::move(rhs));
			}

			~CComPtr()
			{
				Reset();
			}

			operator PtrType*()
			{
				return m_ptr;
			}

			operator PtrType**()
			{
				return &m_ptr;
			}

			CComPtr& operator =(const CComPtr& rhs)
			{
				if(&rhs != this)
				{
					Reset();
					CopyFrom(rhs);
				}
				return (*this);
			}

			CComPtr& operator =(CComPtr&& rhs)
			{
				Reset();
				MoveFrom(std::move(rhs));
				return (*this);
			}

			PtrType* operator ->()
			{
				return m_ptr;
			}

			PtrType** operator &()
			{
				return &m_ptr;
			}

			PtrType* Detach()
			{
				PtrType* result = m_ptr;
				m_ptr = nullptr;
				return result;
			}

			void Reset()
			{
				if(m_ptr != nullptr)
				{
					m_ptr->Release();
					m_ptr = nullptr;
				}
			}

			bool IsEmpty() const
			{
				return (m_ptr == nullptr);
			}

		private:
			void CopyFrom(const CComPtr& src)
			{
				assert(m_ptr == nullptr);
				m_ptr = src.m_ptr;
				if(m_ptr != nullptr)
				{
					m_ptr->AddRef();
				}
			}

			void MoveFrom(CComPtr&& src)
			{
				std::swap(m_ptr, src.m_ptr);
			}

			PtrType* m_ptr;
		};
	};
};
{'fraction_non_alphanumeric': 0.14260328742780987, 'fraction_numerical': 0.001776988005330964, 'mean_word_length': 2.072305593451569, 'pattern_counts': {'":': 0, '<': 8, '<?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': '2093884', 'n_tokens_mistral': 1214, 'n_tokens_neox': 893, 'n_words': 167}