If one of the rust macro arguments takes a boolean constant as argument and expands if/then/else code
base on that boolean constant, does the expanded code annd condition check get optimized based on the macro argument?
For example , if I had the following macro definition and invocaton as below.
Will the compiled code still have code to check if true
? Or will it be optimized out?
macro_rules! condcode {
( $x:expr ) => {
{
if $x {
something if true;
} else {
something if false;
}
}
};
}
condcode!(true);