1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![allow(non_snake_case)]
#[macro_export]
macro_rules! expand {
($macro:ident, $letter:ident) => {
};
($macro:ident, $letter:ident, $($tail:ident),*) => {
$macro!($letter, $($tail),*);
$crate::expand!($macro, $($tail),*);
};
}
#[macro_export]
macro_rules! impl_for_tuples {
($macro:ident) => {
$crate::expand!($macro, L, K, J, I, H, G, F, E, D, C, B, A);
};
}
#[macro_export]
macro_rules! count {
() => {0usize};
($head:tt $($tail:tt)*) => {1usize + count!($($tail)*)};
}