Macro place_macro::head

source ·
head!() { /* proc-macro */ }
Expand description

Expans to the first token if present

Examples

use place_macro::head;

let n = head!(5 + 3 + 2);
assert_eq!(n, 5);

let n = head!((5 + 3) + 2);
assert_eq!(n, (5 + 3));

// expands to nothing
head!();