toti

Crates.iototi
lib.rstoti
version0.1.0
sourcesrc
created_at2024-06-15 11:22:29.107431
updated_at2024-06-15 11:22:29.107431
descriptionExpand macro N times for multiple generics
homepagehttps://github.com/LIMPIX31/t0t1
repositoryhttps://github.com/LIMPIX31/t0t1
max_upload_size
id1272755
size18,800
Danil Karpenko (LIMPIX31)

documentation

README

T-Zero, T-One aka toti

Example

#[toti::expand(10)]
macro_rules! impls {
  ($($T:ident),+) => {
    impl<$($T),+> Trait for ($($T,)+) {}
  };
}

Expands into

impl<T0> Trait for (T0,) {}
impl<T0, T1> Trait for (T0, T1) {}
impl<T0, T1, T2> Trait for (T0, T1, T2) {}
impl<T0, T1, T2, T3> Trait for (T0, T1, T2, T3) {}
impl<T0, T1, T2, T3, T4> Trait for (T0, T1, T2, T3, T4) {}
impl<T0, T1, T2, T3, T4, T5> Trait for (T0, T1, T2, T3, T4, T5) {}
impl<T0, T1, T2, T3, T4, T5, T6> Trait for (T0, T1, T2, T3, T4, T5, T6) {}
impl<T0, T1, T2, T3, T4, T5, T6, T7> Trait for (T0, T1, T2, T3, T4, T5, T6, T7) {}
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Trait for (T0, T1, T2, T3, T4, T5, T6, T7, T8) {}
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Trait for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) {}
Commit count: 6

cargo fmt