I have a macro that accepts 3 intagers. I want to cause a compile error if any one of them is out of range. However, when I use the compile_error! macro, it will always cause a compile error, even if that code is not reached (i.e if $r > 255 { compile_error!("value out of range");} will cause a compile error even if $r if 20). How would I do this?
Example macro:
macro_rules! example {
($r:expr) => {
if $r > 255 {
// code that will only cause a compile error if this code is reached
}
}
}