为什么替代关键字并不代替内置的ascii运营商?

时间:2013-05-14 07:03:55

标签: c++ coding-style operators keyword

C++ keywords列表中,运营商可以选择其他选项,例如:

&&  and
&=  and_eq
&   bitand
|   bitor
~   compl
!   not
!=  not_eq
||  or
|=  or_eq
^   xor
^=  xor_eq

事实上我个人觉得:

if(not s.empty())

更直观
if(!s.empty())

在许多脚本语言中,这样的词是唯一的选择 为什么他们不是在C ++中对运营商而言很有名?是否与编码风格有关,或者仅仅是品味问题。

0 个答案:

没有答案