
























#[cfg(debug_assertions)]
macro_rules! debug {
() => (std::println!());
($($arg:tt)*) => ({
println!($($arg)*);
})
}
#[cfg(not(debug_assertions))]
macro_rules! debug {
() => {};
($($arg:tt)*) => {};
}
fn main() {
debug!("debug");
debug!("debug {} {} {:?}", 1, 2, 3);
}
可以不加 () => (std::println!());
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。