Lines Matching refs:CheckedNumeric
48 class CheckedNumeric {
52 CheckedNumeric() {} in CheckedNumeric() function
56 CheckedNumeric(const CheckedNumeric<Src>& rhs) in CheckedNumeric() function
60 CheckedNumeric(Src value, RangeConstraint validity) in CheckedNumeric() function
66 CheckedNumeric(Src value) // NOLINT in CheckedNumeric() function
95 return CheckedNumeric<T>::cast(*this).ValueUnsafe(); in ValueFloating()
117 template <typename Src> CheckedNumeric& operator+=(Src rhs);
118 template <typename Src> CheckedNumeric& operator-=(Src rhs);
119 template <typename Src> CheckedNumeric& operator*=(Src rhs);
120 template <typename Src> CheckedNumeric& operator/=(Src rhs);
121 template <typename Src> CheckedNumeric& operator%=(Src rhs);
123 CheckedNumeric operator-() const {
128 return CheckedNumeric<T>(value);
131 return CheckedNumeric<T>(value, validity);
134 CheckedNumeric Abs() const { in Abs()
139 return CheckedNumeric<T>(value); in Abs()
142 return CheckedNumeric<T>(value, validity); in Abs()
145 CheckedNumeric& operator++() {
150 CheckedNumeric operator++(int) {
151 CheckedNumeric value = *this;
156 CheckedNumeric& operator--() {
161 CheckedNumeric operator--(int) {
162 CheckedNumeric value = *this;
171 static CheckedNumeric<T> cast(
179 static CheckedNumeric<T> cast(
180 const CheckedNumeric<Src>& u,
185 static const CheckedNumeric<T>& cast(const CheckedNumeric<T>& u) { return u; } in cast()
201 CheckedNumeric<typename ArithmeticPromotion<T>::type> operator OP( \
202 const CheckedNumeric<T>& lhs, const CheckedNumeric<T>& rhs) { \
206 return CheckedNumeric<T>(lhs.ValueUnsafe() OP rhs.ValueUnsafe()); \
208 return CheckedNumeric<Promotion>( \
215 return CheckedNumeric<Promotion>( \
222 CheckedNumeric<T>& CheckedNumeric<T>::operator COMPOUND_OP(Src rhs) { \
223 *this = CheckedNumeric<T>::cast(*this) OP CheckedNumeric<Src>::cast(rhs); \
228 CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP( \
229 const CheckedNumeric<Src>& lhs, const CheckedNumeric<T>& rhs) { \
232 return CheckedNumeric<Promotion>( \
235 return CheckedNumeric<Promotion>::cast(lhs) \
236 OP CheckedNumeric<Promotion>::cast(rhs); \
240 CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP( \
241 const CheckedNumeric<T>& lhs, Src rhs) { \
244 return CheckedNumeric<Promotion>(lhs.ValueUnsafe() OP rhs, \
246 return CheckedNumeric<Promotion>::cast(lhs) \
247 OP CheckedNumeric<Promotion>::cast(rhs); \
251 CheckedNumeric<typename ArithmeticPromotion<T, Src>::type> operator OP( \
252 Src lhs, const CheckedNumeric<T>& rhs) { \
255 return CheckedNumeric<Promotion>(lhs OP rhs.ValueUnsafe(), \
257 return CheckedNumeric<Promotion>::cast(lhs) \
258 OP CheckedNumeric<Promotion>::cast(rhs); \
271 using internal::CheckedNumeric;