diff options
| author | untodesu <kirill@untode.su> | 2025-09-14 19:16:44 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-14 19:16:44 +0500 |
| commit | 8bcbd2729388edc63c82d77d314b583af1447c49 (patch) | |
| tree | 460c2b509372077f6adf95d72c4245988a580aed /core/config | |
| parent | 7fc7fdb001bea8674fe0dbc1b962f3ec2702debb (diff) | |
| download | voxelius-8bcbd2729388edc63c82d77d314b583af1447c49.tar.bz2 voxelius-8bcbd2729388edc63c82d77d314b583af1447c49.zip | |
Cleanup math with qfengine ports again
Diffstat (limited to 'core/config')
| -rw-r--r-- | core/config/number.hh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/config/number.hh b/core/config/number.hh index 5533459..59d3f47 100644 --- a/core/config/number.hh +++ b/core/config/number.hh @@ -6,7 +6,7 @@ namespace config
{
-template<math::Arithmetic T>
+template<math::arithmetic T>
class Number : public IValue {
public:
explicit Number(T default_value = T(0));
@@ -59,7 +59,7 @@ public: };
} // namespace config
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline config::Number<T>::Number(T default_value)
{
m_value = default_value;
@@ -68,7 +68,7 @@ inline config::Number<T>::Number(T default_value) m_string = std::to_string(default_value);
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline config::Number<T>::Number(T default_value, T min_value, T max_value)
{
m_value = default_value;
@@ -77,7 +77,7 @@ inline config::Number<T>::Number(T default_value, T min_value, T max_value) m_string = std::to_string(default_value);
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline void config::Number<T>::set(std::string_view value)
{
T parsed_value;
@@ -89,38 +89,38 @@ inline void config::Number<T>::set(std::string_view value) }
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline std::string_view config::Number<T>::get(void) const
{
return m_string;
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline T config::Number<T>::get_value(void) const
{
return m_value;
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline void config::Number<T>::set_value(T value)
{
m_value = std::clamp(value, m_min_value, m_max_value);
m_string = std::to_string(m_value);
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline T config::Number<T>::get_min_value(void) const
{
return m_min_value;
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline T config::Number<T>::get_max_value(void) const
{
return m_max_value;
}
-template<math::Arithmetic T>
+template<math::arithmetic T>
inline void config::Number<T>::set_limits(T min_value, T max_value)
{
m_min_value = min_value;
|
