dimensioned::count_args! [] [src]

macro_rules! count_args {
    ($arg:ident, $($args:ident),+) => (
        1 + count_args!($($args),+);
    );
    ($arg:ident) => (
        1
    );
}

Counts the number of arguments its called with and gives you the total.

Example

#[macro_use]
extern crate dimensioned;

fn main() {
    let x = count_args!(a, b, cat, banana);
    assert_eq!(4, x);
}