<commit_before>// Copyright (c) 2017 <NAME>
#pragma once
#include <memory>

namespace Jwl
{
	template<class Derived>
	class Shareable : private std::enable_shared_from_this<Derived>
	{
	protected:
		// If the Derived class must have a private constructor, declare "friend ShareableAlloc;"
		// and make_shared will still be able to instantiate it.
		using ShareableAlloc = std::_Ref_count_obj<Derived>;

	public:
		using Ptr = std::shared_ptr<Derived>;
		using ConstPtr = std::shared_ptr<const Derived>;
		using WeakPtr = std::weak_ptr<Derived>;
		using ConstWeakPtr = std::weak_ptr<const Derived>;

		Ptr GetPtr()
		{
			return shared_from_this();
		}

		ConstPtr GetPtr() const
		{
			return shared_from_this();
		}

		WeakPtr GetWeakPtr()<commit_msg>Fixed incorrect inheritance from enable_shared_from_this<commit_after>// Copyright (c) 2017 <NAME>
#pragma once
#include <memory>

namespace Jwl
{
	template<class Derived>
	class Shareable : public std::enable_shared_from_this<Derived>
	{
		// Hide this function from user code.
		using std::enable_shared_from_this<Derived>::shared_from_this;

	protected:
		// If the Derived class must have a private constructor, declare "friend ShareableAlloc;"
		// and MakeNew() will still be able to instantiate it.
		using ShareableAlloc = std::_Ref_count_obj<Derived>;

	public:
		using Ptr = std::shared_ptr<Derived>;
		using ConstPtr = std::shared_ptr<const Derived>;
		using WeakPtr = std::weak_ptr<Derived>;
		using ConstWeakPtr = std::weak_ptr<const Derived>;

		Ptr GetPtr()
		{
			return shared_from_this();
		}

		ConstPtr GetPtr() const
		{
			return shared_from_this();
		}

		WeakPtr GetWeakPtr()
{'fraction_non_alphanumeric': 0.10290556900726393, 'fraction_numerical': 0.004842615012106538, 'mean_word_length': 4.77972027972028, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '5306057', 'n_tokens_mistral': 596, 'n_tokens_neox': 521, 'n_words': 147}