mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 20:54:28 +02:00
Concepts enabled for customization points
This commit is contained in:
@@ -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 {
|
||||||
|
|
||||||
|
@@ -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); }
|
||||||
|
@@ -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>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user