Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::NumericCastImpl< TO, FROM, false > Struct Template Reference

Static Public Member Functions

static TO Convert (FROM val)
 

Member Function Documentation

◆ Convert()

template<class TO , class FROM >
static TO duckdb::NumericCastImpl< TO, FROM, false >::Convert ( FROM  val)
inlinestatic
3494 {
3495 // some dance around signed-unsigned integer comparison below
3496 auto minval = NumericLimits<TO>::Minimum();
3497 auto maxval = NumericLimits<TO>::Maximum();
3498 auto unsigned_in = static_cast<typename MakeUnsigned<FROM>::type>(val);
3499 auto unsigned_min = static_cast<typename MakeUnsigned<TO>::type>(minval);
3500 auto unsigned_max = static_cast<typename MakeUnsigned<TO>::type>(maxval);
3501 auto signed_in = static_cast<typename MakeSigned<FROM>::type>(val);
3502 auto signed_min = static_cast<typename MakeSigned<TO>::type>(minval);
3503 auto signed_max = static_cast<typename MakeSigned<TO>::type>(maxval);
3504
3505 if (!NumericLimits<FROM>::IsSigned() && !NumericLimits<TO>::IsSigned() &&
3506 (unsigned_in < unsigned_min || unsigned_in > unsigned_max)) {
3507 ThrowNumericCastError(val, static_cast<TO>(unsigned_min), static_cast<TO>(unsigned_max));
3508 }
3509
3510 if (NumericLimits<FROM>::IsSigned() && NumericLimits<TO>::IsSigned() &&
3511 (signed_in < signed_min || signed_in > signed_max)) {
3512 ThrowNumericCastError(val, static_cast<TO>(signed_min), static_cast<TO>(signed_max));
3513 }
3514
3515 if (NumericLimits<FROM>::IsSigned() != NumericLimits<TO>::IsSigned() &&
3516 (signed_in < signed_min || unsigned_in > unsigned_max)) {
3517 ThrowNumericCastError(val, static_cast<TO>(signed_min), static_cast<TO>(unsigned_max));
3518 }
3519
3520 return static_cast<TO>(val);
3521 }

The documentation for this struct was generated from the following file: