[][src]Macro type_name_value::name

macro_rules! name {
    ($val:expr) => { ... };
}

Create a Named with a given value. This will create an anonymous type that's unique to the macro invokation. Note that since this gives a type that's impossible to name properly, use wildcards and generics when passing them around.

Examples

let x: Named<u32, _> = name!(5);
fn is_five<Name>(val: Named<u32, Name>) -> bool {
    *val.unname_ref() == 5
}