Macro type_level_values::tlist [−][src]
macro_rules! tlist { () => { ... }; (..$rest:ty) => { ... }; ($current:ty) => { ... }; ($element:ty;$repeat:ty) => { ... }; ($current:ty, $($rest:tt)*) => { ... }; }
Type macro for a type-level-list.
This macro uses takes these 2 forms:
-
tlist![U0,U1,U2,U3] : Where one creates an ordered sequence of types, this example is equivalent to TList<U0,TList<U1,TList<U2,TList<U3,Nil>>>>.
-
tlist![False;3] : Repeats the same type 3 times, this example is equivalent to TList<False,TList<False,TList<False,Nil>>>.
Example
use std::borrow::Cow; type FirstPrimes=tlist![ U1,U2,U3,U5,U7,U11,U13,U17,U19,U23 ]; type Strings<'a>=tlist![ String,&'a str,Cow<'a,str> ];