xo-umbrella2/xo-unit/include/xo/unit/numeric_concept.hpp
Roland Conybeare d1fa15f248 Add 'xo-unit/' from commit 'b531e382c2'
git-subtree-dir: xo-unit
git-subtree-mainline: e9ee6992ca
git-subtree-split: b531e382c2
2025-05-10 21:29:43 -05:00

34 lines
907 B
C++

/* @file numeric_concept.hpp */
#pragma once
#include <concepts>
namespace xo {
namespace qty {
/** @concept numeric_concept
* @brief Concept for values that participate in arithmetic operations (+,-,*,/) and comparisons
*
* Intended to include at least:
* - built-in integral and floating-point types
* - xo::raio<U>
* - xo::unit::quantity<U,R>
*
* Intend numeric_concept to apply to types suitable for
* xo::unit::quantity::repr_type.
**/
template <typename T, typename U = T>
concept numeric_concept = requires(T x, U y)
{
{ -x };
{ x - y };
{ x + y };
{ x * y };
{ x / y };
{ x == y };
{ x != y };
};
} /*namespace qty*/
} /*namespace xo*/
/* end numeric_concept.hpp */