macro_rules! const_rev_for {
(($i:ident in $end:tt.. $start:tt) $code:expr) => { ... };
}Expand description
Allows reversed for loop in constant context.
Start ($start) index is not inclusive.
ⓘ
// This loop:
const_rev_for!((i in 0..10) {
// loop body here
});
// is similar to the following loop:
for i in (0..10).rev() {
// loop body here
}
// Will runs from 9 till 0 (not including 0).