Lines Matching refs:value

20   static_assert(std::is_arithmetic<T>::value,
31 : state_(rhs.state_.value(), rhs.IsValid()) {}
39 constexpr CheckedNumeric(Src value) // NOLINT(runtime/explicit)
40 : state_(value) {
41 static_assert(std::is_arithmetic<Src>::value, "Argument must be numeric.");
48 StrictNumeric<Src> value) // NOLINT(runtime/explicit)
49 : state_(static_cast<Src>(value)) {}
57 IsValueInRangeForNumericType<Dst>(state_.value());
60 // AssignIfValid(Dst) - Assigns the underlying value if it is currently valid
72 ? ((*result = static_cast<Dst>(state_.value())), true)
76 // ValueOrDie() - The primary accessor for the underlying value. If the
79 // parameter, which will trigger a CHECK if the value is not in bounds for
83 // the underlying value, and it is not available through other means.
87 ? static_cast<Dst>(state_.value())
92 // current value if the state is valid, and the supplied default_value for
100 ? static_cast<Dst>(state_.value())
144 return MustTreatAsConstexpr(state_.value()) || !std::is_signed<T>::value ||
145 std::is_floating_point<T>::value
147 NegateWrapper(state_.value()),
148 IsValid() && (!std::is_signed<T>::value ||
149 std::is_floating_point<T>::value ||
150 NegateWrapper(state_.value()) !=
157 InvertWrapper(state_.value()), IsValid());
161 return !IsValueNegative(state_.value()) ? *this : -*this;
173 IsGreater<T, R>::Test(state_.value(), Wrapper<U>::value(rhs))
174 ? state_.value()
175 : Wrapper<U>::value(rhs)),
188 IsLess<T, R>::Test(state_.value(), Wrapper<U>::value(rhs))
189 ? state_.value()
190 : Wrapper<U>::value(rhs)),
195 // integer of the same width as the source type, containing the absolute value
200 SafeUnsignedAbs(state_.value()), state_.is_valid());
209 CheckedNumeric value = *this;
211 return value;
220 CheckedNumeric value = *this;
222 return value;
235 Math::Do(Wrapper<L>::value(lhs), Wrapper<R>::value(rhs), &result);
245 Math::Do(state_.value(), Wrapper<R>::value(rhs), &result);
255 bool success = CheckedSubOp<T, T>::Do(T(0), state_.value(), &result);
260 constexpr CheckedNumeric(Src value, bool is_valid)
261 : state_(value, is_valid) {}
268 static constexpr Src value(Src value) { return value; }
276 static constexpr Src value(const CheckedNumeric<Src> v) {
277 return v.state_.value();
284 static constexpr Src value(const StrictNumeric<Src> v) {
292 constexpr bool IsValidForType(const CheckedNumeric<Src> value) {
293 return value.template IsValid<Dst>();
298 const CheckedNumeric<Src> value) {
299 return value.template ValueOrDie<Dst>();
304 const CheckedNumeric<Src> value,
306 return value.template ValueOrDefault<Dst>(default_value);
313 const T value) {
314 return value;