kuikuitage

  博客园  ::  :: 新随笔  :: 联系 ::  :: 管理
macro_rules! assert {
    ($cond:expr) => { ... };
    ($cond:expr,) => { ... };
    ($cond:expr, $($arg:tt)+) => { ... };
}

Asserts that a boolean expression is true at runtime.

在运行时断言布尔表达式为“ true”。

This will invoke the panic! macro if the provided expression cannot be evaluated to true at runtime.

如果提供的表达式在运行时无法评估为true,则将调用[panic!]宏。

即表达式为true则继续运行,为false调用panic宏程序退出。

posted on 2020-08-04 02:02  kuikuitage  阅读(258)  评论(0编辑  收藏  举报