在Java中,我使用
if (a != null && a.fun());
通过充分利用短路评估和表达从左到右进行评估?
在C++中,我可以这样做吗?它们是否保证可以跨不同平台和编译器移植?
if (a != 0 && a->fun());
c++ java
c++ ×1
java ×1