[][src]Macro iter_comprehensions::sum

macro_rules! sum {
    ($($rest:tt)*) => { ... };
}

A sum expression.

The macro takes as first argument a type.

Example

The following expression corresponds to the mathematical expression $\sum_{i=1}^{10} i$.

use iter_comprehensions::sum;
assert_eq!(sum!(i in 1..=10, i), 55);