32 using NumericType = N;
39 template <std::convertible_to<N> T>
41 return numeric < static_cast<N>(rhs.numeric) ? std::strong_ordering::less
42 : numeric >
static_cast<N
>(rhs.numeric) ? std::strong_ordering::greater
43 : std::strong_ordering::equal;
45 template <std::convertible_to<N> T>
47 return numeric == N{rhs.numeric};
50 template <std::convertible_to<N> T>
51 std::strong_ordering operator<=>(
const T &rhs)
const {
52 return numeric < static_cast<N>(rhs) ? std::strong_ordering::less
53 : numeric >
static_cast<N
>(rhs) ? std::strong_ordering::greater
54 : std::strong_ordering::equal;
56 template <std::convertible_to<N> T>
57 bool operator==(
const T &rhs)
const {
58 return numeric == N{rhs};
63 template <std::convertible_to<N> T>
65 numeric += N{rhs.numeric};
68 template <std::convertible_to<N> T>
70 numeric -= N{rhs.numeric};
73 template <std::convertible_to<N> T>
75 numeric *= N{rhs.numeric};
78 template <std::convertible_to<N> T>
80 numeric /= N{rhs.numeric};
84 template <std::convertible_to<N> T>
89 template <std::convertible_to<N> T>
94 template <std::convertible_to<N> T>
99 template <std::convertible_to<N> T>
105 template <std::convertible_to<N> T>
107 return {numeric + N{rhs.numeric}, data};
109 template <std::convertible_to<N> T>
111 return {numeric - N{rhs.numeric}, data};
113 template <std::convertible_to<N> T>
115 return {numeric * N{rhs.numeric}, data};
117 template <std::convertible_to<N> T>
119 return {numeric / N{rhs.numeric}, data};
122 template <std::convertible_to<N> T>
124 return {numeric + N{rhs}, data};
126 template <std::convertible_to<N> T>
128 return {numeric - N{rhs}, data};
130 template <std::convertible_to<N> T>
132 return {numeric * N{rhs}, data};
134 template <std::convertible_to<N> T>
136 return {numeric / N{rhs}, data};
169NumericDataContainer<N, D>
operator-(
const T &lhs,
const NumericDataContainer<N, D> &rhs) {
173NumericDataContainer<N, D> operator*(
const T &lhs,
const NumericDataContainer<N, D> &rhs) {
177NumericDataContainer<N, D> operator/(
const T &lhs,
const NumericDataContainer<N, D> &rhs) {
182std::strong_ordering operator<=>(
const T &lhs,
const NumericDataContainer<N, D> &rhs) {
189std::ostream &operator<<(std::ostream &os,
const NumericDataContainer<N, D> &ndc) {