ML Reference
|
Configurable collection of safe casts for data value conversions. More...
#include "mlTypeDefs.h"
#include "mlErrorMacros.h"
#include "mlErrorOutput.h"
#include "mlSystemWarningsDisable.h"
#include <limits.h>
#include "mlSystemWarningsRestore.h"
Go to the source code of this file.
Configurable collection of safe casts for data value conversions.
Definition in file mlRangeCasts.h.
#define _ML_COMPILE_RANGE_CASTS_WITH_CHECKS |
If this flag is enabled then range casts are compiled as pure casts to suppress precision warnings.
If this flag is enabled then range casts are compiled as inline functions which casts the values and apply checks for valid ranges.
Definition at line 31 of file mlRangeCasts.h.
#define _ML_RANGE_ERROR_TYPE ML_PRINT_FATAL_ERROR |
This definition determines which error type is used to report range errors; the default are fatal errors.
Definition at line 34 of file mlRangeCasts.h.
Referenced by _MLIntegerRangeCheck< true, false, Target, Source >::checked_cast(), _MLIntegerRangeCheck< false, true, Target, Source >::checked_cast(), and _MLIntegerRangeCheck< true, true, Target, Source >::checked_cast().
Target mlrange_cast | ( | Source | arg | ) | [inline] |
Generic version of checked ML casts.
Do a cast to the given target type, with a range check if the value can be represented by the target type (otherwise a fatal error occurs). This is only defined for integer types.
Definition at line 208 of file mlRangeCasts.h.