Crates.io | num_alias |
lib.rs | num_alias |
version | 0.1.7 |
source | src |
created_at | 2018-01-06 16:46:34.936946 |
updated_at | 2018-01-09 10:45:58.751658 |
description | simple macros to declare 'type checked' aliases for integers and floats. |
homepage | |
repository | https://github.com/kngwyu/num-alias |
max_upload_size | |
id | 45732 |
size | 11,922 |
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;
}