[][src]Macro tensor_macros::pairs

macro_rules! pairs {
    ($_1:literal, $_2:literal $(,$tail:literal)*) => { ... };
    ($_1:literal, $_2:literal $(,$tail:literal)*; $($x:literal, $y:literal),*) => { ... };
    ($_1:literal; $($x:literal, $y:literal),*) => { ... };
}

Generate consecutive pairs from a list of inputs

Used internally by other macros. Takes the first two values, adds them both to the end and discards the first one

Example

use tensor_macros::pairs;
let v = pairs!(1, 2, 3, 4, 5);
assert_eq!(v, ((1, 2), (2, 3), (3, 4), (4, 5)));