<commit_before>#pragma once

#include <memory>
#include <polar/core/deltaticks.h>

namespace polar::support::integrator {
	class integrable_base {
	  public:
		virtual ~integrable_base() {}
		virtual bool hasderivative(const unsigned char = 0)             = 0;
		virtual integrable_base &getderivative(const unsigned char = 0) = 0;
		virtual void integrate(const DeltaTicks::seconds_type)          = 0;
		virtual void revert()                                           = 0;
	};

	template<typename T> class integrable : public integrable_base {
	  private:
		typedef std::unique_ptr<integrable<T>> derivative_t;
		T previousValue;
		T value;
		derivative_t deriv;

	  public:
		template<typename... Ts>
		integrable(Ts &&... args) : value(std::forward<Ts>(args)...) {
			previousValue = value;
		}

		inline T &get() { return value; }
		inline T &getprevious() { return previousValue; }
		template<typename _To> inline _To to() {
			return static_cast<_To>(value);
		}
		template<typename _To> inline _To to_previous() {
			return static_cast<_To>(previousValue);
		}
<commit_msg>integrable: mark const, add conversion operator<commit_after>#pragma once

#include <memory>
#include <polar/core/deltaticks.h>

namespace polar::support::integrator {
	class integrable_base {
	  public:
		virtual ~integrable_base() {}
		virtual bool hasderivative(const unsigned char = 0)             = 0;
		virtual integrable_base &getderivative(const unsigned char = 0) = 0;
		virtual void integrate(const DeltaTicks::seconds_type)          = 0;
		virtual void revert()                                           = 0;
	};

	template<typename T> class integrable : public integrable_base {
	  private:
		typedef std::unique_ptr<integrable<T>> derivative_t;
		T previousValue;
		T value;
		derivative_t deriv;

	  public:
		template<typename... Ts>
		integrable(Ts &&... args) : value(std::forward<Ts>(args)...) {
			previousValue = value;
		}

		inline operator const T &() const { return get(); }

		inline const T &get() const { return value; }
		inline const T &getprevious() const { return previousValue; }
		template<typename _To> inline _To to() {
			return static_cast<_To>(value);
		}
		template<typename _To> inline _To to_previous() {
			return static_cast<_To>(previousValue);
		}

{'fraction_non_alphanumeric': 0.11526616805983282, 'fraction_numerical': 0.005279366476022877, 'mean_word_length': 3.4155339805825244, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1878343', 'n_tokens_mistral': 771, 'n_tokens_neox': 666, 'n_words': 184}