num_alias 0.1.7

simple macros to declare 'type checked' aliases for integers and floats.
Documentation

num_alias

Crates.io: num_alias Documentation Build Status License: MIT Provides simple and useful macros to declare 'type and range checked' aliases for integers and floats.

#[macro_use]
extern crate num_alias;
fn main() {
    // declare alias with range[3, 6)
    int_alias!(Val, i32, 3 => 6);
    let a = Val(5);
    let b = Val(4);
    // this code panics
    let c = a * b;
}