5d235b51f3
tmp commit tmp commit v2 Finished reimplementation of propertys. They now can be placed in a holder with different source of type information. Tmp commit
34 lines
837 B
C++
34 lines
837 B
C++
#pragma once
|
|
|
|
#include "storage/model/properties/utils/math_operations.hpp"
|
|
#include "storage/model/properties/utils/unary_negation.hpp"
|
|
#include "utils/total_ordering.hpp"
|
|
|
|
template <class Derived>
|
|
class Number : public TotalOrdering<Derived>,
|
|
public MathOperations<Derived>,
|
|
public UnaryNegation<Derived>
|
|
{
|
|
|
|
public:
|
|
std::ostream &print(std::ostream &stream) const
|
|
{
|
|
return operator<<(stream, this->derived());
|
|
}
|
|
|
|
friend std::ostream &operator<<(std::ostream &s, const Derived &number)
|
|
{
|
|
return s << number.value();
|
|
}
|
|
|
|
friend bool operator==(const Derived &lhs, const Derived &rhs)
|
|
{
|
|
return lhs.value() == rhs.value();
|
|
}
|
|
|
|
friend bool operator<(const Derived &lhs, const Derived &rhs)
|
|
{
|
|
return lhs.value() == rhs.value();
|
|
}
|
|
};
|