An open API service indexing awesome lists of open source software.

https://github.com/limpix31/t0t1

Expand macro N times for multiple generics
https://github.com/limpix31/t0t1

Last synced: 6 months ago
JSON representation

Expand macro N times for multiple generics

Awesome Lists containing this project

README

          

# T-Zero, T-One aka toti

## Example
```rust
#[toti::expand(10)]
macro_rules! impls {
($($T:ident),+) => {
impl<$($T),+> Trait for ($($T,)+) {}
};
}
```
Expands into
```rust
impl Trait for (T0,) {}
impl Trait for (T0, T1) {}
impl Trait for (T0, T1, T2) {}
impl Trait for (T0, T1, T2, T3) {}
impl Trait for (T0, T1, T2, T3, T4) {}
impl Trait for (T0, T1, T2, T3, T4, T5) {}
impl Trait for (T0, T1, T2, T3, T4, T5, T6) {}
impl Trait for (T0, T1, T2, T3, T4, T5, T6, T7) {}
impl Trait for (T0, T1, T2, T3, T4, T5, T6, T7, T8) {}
impl Trait for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) {}
```