xo-umbrella2/xo-unit/include/xo/unit/numeric_concept.hpp
Roland Conybeare 60f796b770 git subrepo clone git@github.com:Rconybea/xo-unit.git xo-unit
subrepo:
  subdir:   "xo-unit"
  merged:   "f1e698bf"
upstream:
  origin:   "git@github.com:Rconybea/xo-unit.git"
  branch:   "main"
  commit:   "f1e698bf"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:22:52 -04: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 */