Function tupleops::length[][src]

pub const fn length<Tpl>(_: &Tpl) -> usize where
    Tpl: TupleLength
This is supported on crate features length and feature-const_fn_trait_bound only.
Expand description

Return the length of a tuple.

use tupleops::length;

assert_eq!(0, length(&()));
assert_eq!(1, length(&(1,)));
assert_eq!(2, length(&(1, 2)));
assert_eq!(3, length(&(1, 2, 3)));

See also: TupleLength.