<commit_before>/*
 * shared_ptr-impl.hpp - Copyright (C) 2007 by <NAME>
 * Implementation of shared_ptr class template.
 */
 
// Declaration of container for the refcounts
#ifdef _MSC_VER
	typedef stdext::hash_map<void *, int> refcounts_t;
#else
	struct ptr_hash
	{
		size_t operator () (void *v) const
		{
			static __gnu_cxx::hash<unsigned int> H;
			return H((unsigned int)v);
		}
	};
	typedef __gnu_cxx::hash_map<void *, int, ptr_hash> refcounts_t;
#endif
extern refcounts_t refcounts_;

/*
 * shared_ptr <T> implementation
 */

template <typename T>
shared_ptr<T>::shared_ptr (T* ptr_): ptr(ptr_)
{
	++refcounts_[ptr];
}

template <typename T>
shared_ptr<T>::shared_ptr (const shared_ptr<T>& rhs): ptr(rhs.ptr)
{
	++refcounts_[ptr];
}

template <typename T>
template <typename U>
shared_ptr<T>::shared_ptr (const shared_ptr<U>& rhs):
	ptr(static_cast<T*>(rhs.ptr))
{
	++refcounts_[ptr];
}

template <typename T>
template <typename U>
shared_ptr<T>& shared_ptr<T>::operator = (const shared_ptr<U>& rhs)
{
	release();
	ptr = static_cast<T*>(rhs.ptr);
	++refcounts_[ptr];
	return *this;
}

template <typename T>
T* shared_ptr<T>::get () const
{
	return ptr;
}

template <typename T>
T* shared_ptr<T>::operator * () const
{
	return ptr;
}

template <typename T>
T* shared_ptr<T>::operator -> () const
{
	return ptr;<commit_msg>Fixed one more lingering reference to release() in shared_ptr<commit_after>/*
 * shared_ptr-impl.hpp - Copyright (C) 2007 by <NAME>
 * Implementation of shared_ptr class template.
 */
 
// Declaration of container for the refcounts
#ifdef _MSC_VER
	typedef stdext::hash_map<void *, int> refcounts_t;
#else
	struct ptr_hash
	{
		size_t operator () (void *v) const
		{
			static __gnu_cxx::hash<unsigned int> H;
			return H((unsigned int)v);
		}
	};
	typedef __gnu_cxx::hash_map<void *, int, ptr_hash> refcounts_t;
#endif
extern refcounts_t refcounts_;

/*
 * shared_ptr <T> implementation
 */

template <typename T>
shared_ptr<T>::shared_ptr (T* ptr_): ptr(ptr_)
{
	++refcounts_[ptr];
}

template <typename T>
shared_ptr<T>::shared_ptr (const shared_ptr<T>& rhs): ptr(rhs.ptr)
{
	++refcounts_[ptr];
}

template <typename T>
template <typename U>
shared_ptr<T>::shared_ptr (const shared_ptr<U>& rhs):
	ptr(static_cast<T*>(rhs.ptr))
{
	++refcounts_[ptr];
}

template <typename T>
template <typename U>
shared_ptr<T>& shared_ptr<T>::operator = (const shared_ptr<U>& rhs)
{
	reset();
	ptr = static_cast<T*>(rhs.ptr);
	++refcounts_[ptr];
	return *this;
}

template <typename T>
T* shared_ptr<T>::get () const
{
	return ptr;
}

template <typename T>
T* shared_ptr<T>::operator * () const
{
	return ptr;
}

template <typename T>
T* shared_ptr<T>::operator -> () const
{
	return ptr;
{'fraction_non_alphanumeric': 0.15618060695780903, 'fraction_numerical': 0.0029607698001480384, 'mean_word_length': 5.242494226327945, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 59, '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': '799989', 'n_tokens_mistral': 1051, 'n_tokens_neox': 1014, 'n_words': 249}