如下,
T* ptr; if ((ptr = func()) && ...) { ... } // 上面为前,下面为后. T* ptr; if ((ptr = func()) !is null && ...) { ... } // 更可读了.
关键是,要提供迁移路径.
迁移