refactor: 💥 basic_concepts, quantity and quantity_cast refactored

BREAKING CHANGE:  ScalableNumber renamed to QuantityValue

Resolves #107
This commit is contained in:
Mateusz Pusz
2020-10-06 18:17:52 +02:00
parent 40f205b381
commit cfc90f4aac
96 changed files with 1620 additions and 1017 deletions
+6 -3
View File
@@ -22,7 +22,6 @@
#pragma once
#include <units/concepts.h>
#include <limits>
#include <type_traits>
@@ -37,9 +36,13 @@ namespace units {
*
* @tparam Rep a representation type for which a type trait is defined
*/
template<ScalableNumber Rep>
template<typename Rep>
inline constexpr bool treat_as_floating_point = std::is_floating_point_v<Rep>;
template<typename T>
requires requires { typename T::value_type; }
inline constexpr bool treat_as_floating_point<T> = treat_as_floating_point<typename T::value_type>;
/**
* @brief A type trait that defines zero, one, min, and max for a representation type
*
@@ -49,7 +52,7 @@ inline constexpr bool treat_as_floating_point = std::is_floating_point_v<Rep>;
*
* @tparam Rep a representation type for which a type trait is defined
*/
template<ScalableNumber Rep>
template<typename Rep>
struct quantity_values {
static constexpr Rep zero() noexcept { return Rep(0); }
static constexpr Rep one() noexcept { return Rep(1); }