- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
A class S is a standard-layout class if it:
- has no element of the set M(S) of types as a base class, where for any type X, M(X) is defined as follows.102[Note: M(X) is the set of the types of all non-base-class subobjectsthat may be at a zero offset in X. — end note]
从上面突出显示的句子我们得出结论,如果 S 是 union ,M(S) 是空的,这仅仅是因为 union 没有基类。对我来说,这与下面的 [class.prop]/(3.7.3) 相矛盾。
- If X is a union type, the set M(X) is the union of all M(Ui) and the set containing all Ui , where each Ui is the type of the i thnon-static data member of X.
最佳答案
我错了。查看 zygoloid 的答案 here .
关注@GManNickG,我在 GitHub 中复制了 zygoloid 对我的问题的回答:
The wording is correct as-is. Consider:
struct A {};
union U { A a; };
struct B : A { U u; };Here, B is not standard-layout because M(B) contains A and B has A asa base class. M(B) is defined as U plus M(U), and M(U) is defined asA.
So we need M(U) to be non-empty for M(B) to properly compute "the setof the types of all non-base-class subobjects that may be at a zerooffset in" U, even though U itself can't have base class.
关于c++ - [class.prop]/(3.7) 似乎与 [class.prop]/(3.7.3) 矛盾。我错过了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63973380/
在 Coq 中,我有两个假设 H 和 H0 ,它们相互矛盾。问题是,它们只是在某些特化方面相互矛盾,而在证明的这一刻,上下文并不是那么特化。 此时我的证明上下文如下所示: color : Vertex
根据 RubyMonk section 8.1模块只保存行为而不保存状态,类可以保存行为和状态。 然而,模块是 Ruby 中类的父类(super class)。怎么会这样? 最佳答案 哦兄弟,如果你忘
来自此处的文档:http://facebook.github.io/react/docs/pure-render-mixin.html 脚注说如果复杂数据(深层数据结构)的结构发生变化,你应该使用fo
我有一个简单的类(class) function TrueNinja() { this.vanish = function() { return this; }; } 由此创建一个新对象 var
这个问题在这里已经有了答案: How do Python's any and all functions work? (10 个答案) 关闭 4 年前。 无意中发现了Numpy中的一些东西,实在看不
这个问题在这里已经有了答案: C++ doesn't tell you the size of a dynamic array. But why? (7 个回答) 关闭3年前。 我到处都读到,在 C+
编辑以提供完整的代码示例和特定问题 我正在编写一个函数来生成股票价格的时间序列图。但是,出现以下错误 eval(expr,envir,enclos)中的错误:找不到对象'df1234' 这是该函数的示
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我正在阅读 Stroustrup 的 C++(1997 年第 3 版)以了解他是如何实现 RAII 的,在第 365 页上我发现了这一点: class File_ptr{ FILE* p; p
A class S is a standard-layout class if it: [class.prop]/(3.7) : has no element of the set M(S) of t
我是一名优秀的程序员,十分优秀!