<commit_before>#ifndef MY_UNITS_HPP_
#define MY_UNITS_HPP_

#include <utility>
#include <ostream>
#include <cmath>

template<int M, int L, int T>
class Quantity
{
public:
	constexpr Quantity() = default;
	constexpr Quantity(const double& val) : m_value{val} {}
	constexpr Quantity(double&& val) : m_value{std::move(val)} {}
	constexpr Quantity(const Quantity& x) : m_value{x.m_value} {}
	constexpr Quantity(Quantity&& other) = default;

	Quantity& operator =(const Quantity& other) = default;
	Quantity& operator =(Quantity&& other) = default;

	Quantity& operator+=(const Quantity& rhs)
    {
        m_value+=rhs.m_value;
        return *this;
    }

    Quantity& operator-=(const Quantity& rhs)
    {
        m_value-=rhs.m_value;
        return *this;
    }

    constexpr Quantity operator -() {
    	return Quantity<M,L,T>(-m_value);
    }

    constexpr  double Convert(const Quantity& rhs)
    {
        return m_value/rhs.m_value;
    }

    constexpr  double getValue() const
    {
        return m_value;
    }

    constexpr operator double()
	{
    	return this->getValue();
	}

private:
    double m_value;
};

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator+(const Quantity<M,L,T>& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs)+=rhs;
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator-(const Quantity<M,L,T>& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs)-=rhs;
}

template <int M1, int L1, int T1, int M2, int L2, int T2>
constexpr Quantity<M1+M2,L1+L2,T1+T2> operator*(const Quantity<M1,L1,T1>& lhs, const Quantity<M2,L2,T2>& rhs)
{
    return Quantity<M1+M2,L1+L2,T1+T2>(lhs.getValue()*rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator*(const double& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs*rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator*(const Quantity<M,L,T>& lhs, const double& rhs)
{
    return rhs * lhs;
}

template <int M1, int L1, int T1, int M2, int L2, int T2>
constexpr Quantity<M1-M2,L1-L2,T1-T2> operator/(const Quantity<M1,L1,T1>& lhs,
            const Quantity<M2,L2,T2>& rhs)
{
    return Quantity<M1-M2,L1-L2,T1-T2>(lhs.getValue()/rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<-M, -L, -T> operator/(const double& x, const Quantity<M,L,T>& rhs)
{<commit_msg>my_units operator+/- without member function<commit_after>#ifndef MY_UNITS_HPP_
#define MY_UNITS_HPP_

#include <utility>
#include <ostream>
#include <cmath>

template<int M, int L, int T>
class Quantity
{
public:
	constexpr Quantity() = default;
	constexpr Quantity(const double& val) : m_value{val} {}
	constexpr Quantity(double&& val) : m_value{std::move(val)} {}
	constexpr Quantity(const Quantity& x) : m_value{x.m_value} {}
	constexpr Quantity(Quantity&& other) = default;

	Quantity& operator =(const Quantity& other) = default;
	Quantity& operator =(Quantity&& other) = default;

	Quantity& operator+=(const Quantity& rhs)
    {
        m_value+=rhs.m_value;
        return *this;
    }

    Quantity& operator-=(const Quantity& rhs)
    {
        m_value-=rhs.m_value;
        return *this;
    }

    constexpr Quantity operator -() {
    	return Quantity<M,L,T>(-m_value);
    }

    constexpr  double Convert(const Quantity& rhs)
    {
        return m_value/rhs.m_value;
    }

    constexpr  double getValue() const
    {
        return m_value;
    }

    constexpr operator double()
	{
    	return this->getValue();
	}

private:
    double m_value;
};

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator+(const Quantity<M,L,T>& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs.getValue() + rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator-(const Quantity<M,L,T>& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs.getValue() - rhs.getValue());
}

template <int M1, int L1, int T1, int M2, int L2, int T2>
constexpr Quantity<M1+M2,L1+L2,T1+T2> operator*(const Quantity<M1,L1,T1>& lhs, const Quantity<M2,L2,T2>& rhs)
{
    return Quantity<M1+M2,L1+L2,T1+T2>(lhs.getValue()*rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator*(const double& lhs, const Quantity<M,L,T>& rhs)
{
    return Quantity<M,L,T>(lhs*rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<M,L,T> operator*(const Quantity<M,L,T>& lhs, const double& rhs)
{
    return rhs * lhs;
}

template <int M1, int L1, int T1, int M2, int L2, int T2>
constexpr Quantity<M1-M2,L1-L2,T1-T2> operator/(const Quantity<M1,L1,T1>& lhs,
            const Quantity<M2,L2,T2>& rhs)
{
    return Quantity<M1-M2,L1-L2,T1-T2>(lhs.getValue()/rhs.getValue());
}

template <int M, int L, int T>
constexpr Quantity<-M, -L, -T> operator/(const double& x, const Quantity<M,L,T>& rhs)
{
{'fraction_non_alphanumeric': 0.15752721298007805, 'fraction_numerical': 0.019716574245224893, 'mean_word_length': 4.067637877211238, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 75, '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': '1772996', 'n_tokens_mistral': 1964, 'n_tokens_neox': 1943, 'n_words': 452}