gpt4 book ai didi

c++ - 我在 C++ 草稿 GitHub 中找不到问题或拉取请求,支持 [basic.start.static]/2 中的以下更改

转载 作者:行者123 更新时间:2023-11-28 01:21:49 26 4
gpt4 key购买 nike

N4791 - 2018-12-07(这与 [basic.start.static]/2 的 current draft 中的措辞一致)

Constant initialization is performed if a variable or temporary object with static or thread storage duration is initialized by a constant initializer (7.7) for the entity. If constant initialization is not performed, a variable with static storage duration (6.6.4.1) or thread storage duration (6.6.4.2) is zero-initialized (9.3). Together, zero-initialization and constant initialization are called static initialization; all other initialization is dynamic initialization. All static initialization strongly happens before (6.8.2.1) any dynamic initialization. [Note: The dynamic initialization of non-local variables is described in 6.8.3.3; that of local static variables is described in 8.7. — end note]

N4778 - 2018-10-08(这是 N4791 之前的草案)

A constant initializer for a variable or temporary object o is an initializer whose full-expression is a constant expression, except that if o is an object, such an initializer may also invoke constexpr constructors for o and its subobjects even if those objects are of non-literal class types. [Note: Such a class may have a non-trivial destructor. — end note] Constant initialization is performed if a variable or temporary object with static or thread storage duration is initialized by a constant initializer for the entity. If constant initialization is not performed, a variable with static storage duration (6.6.4.1) or thread storage duration (6.6.4.2) is zero-initialized (9.3). Together, zero-initialization and constant initialization are called static initialization; all other initialization is dynamic initialization. All static initialization strongly happens before (6.8.2.1) any dynamic initialization. [Note: The dynamic initialization of non-local variables is described in 6.8.3.3; that of local static variables is described in 8.7. — end note]

最佳答案

移动评论中的答案,使该问题从未回答的问题列表中消失:相关的拉取请求是 http://github.com/cplusplus/draft/pull/2442

关于c++ - 我在 C++ 草稿 GitHub 中找不到问题或拉取请求,支持 [basic.start.static]/2 中的以下更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55839117/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com