Is anybody using the named boolean operators?(有人使用命名的布尔运算符吗?)
问题描述
还是我们都坚持我们教过的&&, ||, !"怎么办?
Or are we all sticking to our taught "&&, ||, !" way?
对于我们为什么应该使用其中一个有什么想法吗?
Any thoughts in why we should use one or the other?
我只是想知道,因为有几个答案表明代码应该尽可能自然,但我没有看到很多带有and,or,not"的代码,而这更自然.
I'm just wondering because several answers state thate code should be as natural as possible, but I haven't seen a lot of code with "and, or, not" while this is more natural.
推荐答案
以前不支持这些.即使是现在,您也需要对某些编译器进行特殊切换以启用这些关键字.这可能是因为旧代码库可能有一些功能 ||名为and"or"not"的变量.
Those were not supported in the old days. And even now you need to give a special switch to some compilers to enable these keywords. That's probably because old code base may have had some functions || variables named "and" "or" "not".
这篇关于有人使用命名的布尔运算符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有人使用命名的布尔运算符吗?
基础教程推荐
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- c++ STL设置差异 2022-01-01
- 提升 ASIO 流缓冲 2021-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
