Concepts enabled for customization points

This commit is contained in:
Mateusz Pusz
2020-03-26 16:37:47 +01:00
parent 4637985b7a
commit ecb158eaa7
3 changed files with 4 additions and 3 deletions

View File

@@ -27,7 +27,6 @@
#include <units/bits/external/hacks.h> #include <units/bits/external/hacks.h>
#include <units/bits/external/numeric_concepts.h> #include <units/bits/external/numeric_concepts.h>
#include <units/bits/external/type_traits.h> #include <units/bits/external/type_traits.h>
#include <units/customization_points.h>
namespace units { namespace units {

View File

@@ -22,6 +22,7 @@
#pragma once #pragma once
#include <units/concepts.h>
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
@@ -36,7 +37,7 @@ namespace units {
* *
* @tparam Rep a representation type for which a type trait is defined * @tparam Rep a representation type for which a type trait is defined
*/ */
template<typename Rep> template<Scalar Rep>
inline constexpr bool treat_as_floating_point = std::is_floating_point_v<Rep>; inline constexpr bool treat_as_floating_point = std::is_floating_point_v<Rep>;
/** /**
@@ -48,7 +49,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 * @tparam Rep a representation type for which a type trait is defined
*/ */
template<typename Rep> template<Scalar Rep>
struct quantity_values { struct quantity_values {
static constexpr Rep zero() noexcept { return Rep(0); } static constexpr Rep zero() noexcept { return Rep(0); }
static constexpr Rep one() noexcept { return Rep(1); } static constexpr Rep one() noexcept { return Rep(1); }

View File

@@ -23,6 +23,7 @@
#pragma once #pragma once
#include <units/concepts.h> #include <units/concepts.h>
#include <units/customization_points.h>
#include <units/bits/dimension_op.h> #include <units/bits/dimension_op.h>
#include <cassert> #include <cassert>