C1x 从 C++ 继承了什么?
众所周知,C++ 继承了 C 的功能,但 C 也标准化了 C++ 的功能。 C1x 已经获得了完整的表达临时数据(之前它只有序列点临时数据)。 C1x 还借鉴了 C++11 线程工作。
我想知道 C1x 从 C++ 中还继承了哪些其他功能?
It is well known that both C++ takes features from C but that C also standardizes C++ features. C1x has gained full expression temporaries (previously it only had sequence point temporaries). C1x also took from the C++11 threading effort.
I wonder what other features C1x took from C++?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一些相似之处包括:
_Static_assert (constant-express, string-literal);
char16_t
=uint_least16_t
code>)、文字和实用程序。_Generic
_Generic
实际上更像是重载,而不是我们拥有模板的功能。_Generic
的普遍示例是:..但我不确定哪些是从 C++ 明确继承的。
Some similarities include:
_Static_assert ( constant-expression , string-literal );
char16_t
=uint_least16_t
), literals, and utilities._Generic
_Generic
is really more like overloading than what we have with the power of templates. The ubiquitous example of_Generic
is:..but I'm not sure which were inherited expressly from C++.
C1x (5.1.2.4) 的线程部分几乎直接取自 C++11。出于所有实际目的,“冲突”和“原子操作”等术语具有相同的定义。
对齐也受到 C++11 的启发:关键字是
alignof
,最大对齐类型是max_align_t
(删除std::
命名空间) , 当然)。The threading part of C1x (5.1.2.4) is taken almost literally from C++11. Terms like "conflict" and "atomic operations" have identical definitions, for all practical purposes.
Alignment is also inspired by C++11: the keyword is
alignof
, and the maximum aligned type ismax_align_t
(dropping thestd::
namespace, of course).