1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#[macro_export] macro_rules! cfor { ($init: stmt; $cond: expr; $step: expr; $body: block) => { { let mut first = true; $init; while { if first { first = false } else { $step } $cond } $body } } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#[macro_export] macro_rules! cfor { ($init: stmt; $cond: expr; $step: expr; $body: block) => { { let mut first = true; $init; while { if first { first = false } else { $step } $cond } $body } } }