Function nekolib::utils::buf_range::check_bounds_range
source · pub fn check_bounds_range(i: usize, range: impl RangeBounds<usize> + Debug)
Expand description
境界チェックを行う。
Examples
use nekolib::utils::check_bounds_range;
let a = [0, 1, 2];
check_bounds_range(2, 0..a.len());
check_bounds_range(3, 0..=a.len());
ⓘ
use nekolib::utils::check_bounds_range;
let a = [0, 1, 2];
// panicked at 'index out of bounds: the range is 0..=3 but the index is 4'
check_bounds_range(4, 0..=a.len());