Skip to main content

apply

Macro apply 

Source
macro_rules! apply {
    (1, $($idx:tt)+) => { ... };
    (2, $($idx:tt)+) => { ... };
    (3, $($idx:tt)+) => { ... };
    (4, $($idx:tt)+) => { ... };
    (5, $($idx:tt)+) => { ... };
}
Expand description

Creates a closure that applies one callable to every field of a tuple.

Tuple arities from one through five are supported. The callable tokens are expanded once for each field and therefore may be evaluated more than once.