Count macro
A macro to allow for compile time counting
How to use this
Every instance of _int_
will be replaced with either a literal or an ident.
count_macro::count
will panic in debug mode if counter exceeds usize.
If you wish to wrap to 0, please use count_macro::wrapping_count
.
Ident to Literal
use count;
let a = count!;
assert_eq!;
Ident to ident
use count;
count!
assert_eq!;
assert_eq!;
In macro
use count;
my_macro!; // Will print from 0 to 3