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".
这篇关于有人使用命名的布尔运算符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有人使用命名的布尔运算符吗?
基础教程推荐
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 从 std::cin 读取密码 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07