2016-02-14 00:59:48 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-10 16:39:02 +08:00
|
|
|
#include "storage/model/properties/floating.hpp"
|
|
|
|
#include "storage/model/properties/number.hpp"
|
|
|
|
#include "storage/model/properties/utils/modulo.hpp"
|
2016-02-14 00:59:48 +08:00
|
|
|
|
|
|
|
template <class Derived>
|
2016-02-21 00:53:09 +08:00
|
|
|
struct Integral : public Number<Derived>, public Modulo<Derived>
|
2016-02-14 00:59:48 +08:00
|
|
|
{
|
|
|
|
using Number<Derived>::Number;
|
2016-02-21 00:53:09 +08:00
|
|
|
|
|
|
|
template <class T, typename = std::enable_if_t<
|
2016-08-10 16:39:02 +08:00
|
|
|
std::is_base_of<Floating<T>, T>::value>>
|
2016-02-21 00:53:09 +08:00
|
|
|
operator T() const
|
|
|
|
{
|
|
|
|
return T(this->derived().value);
|
|
|
|
}
|
2016-02-14 00:59:48 +08:00
|
|
|
};
|