subobject

What is dynamic type of object

馋奶兔 提交于 2019-12-18 02:51:37
问题 What i think is that dynamic type means dynamically allocated object using new . In the following case, do you say p points to dynamic type or static type of object? In standard, it doesn't say about dynamic type being dynamic object. 1.3.3 - The type of the most derived object (1.8) to which the lvalue denoted by an lvalue expression refers. [Example: if a pointer (8.3.1) p whose static type is "pointer to class B" is pointing to an object of class D, derived from B (clause 10), the dynamic

What is dynamic type of object

僤鯓⒐⒋嵵緔 提交于 2019-11-28 23:42:56
What i think is that dynamic type means dynamically allocated object using new . In the following case, do you say p points to dynamic type or static type of object? In standard, it doesn't say about dynamic type being dynamic object. 1.3.3 - The type of the most derived object (1.8) to which the lvalue denoted by an lvalue expression refers. [Example: if a pointer (8.3.1) p whose static type is "pointer to class B" is pointing to an object of class D, derived from B (clause 10), the dynamic type of the expression *p is "D." References (8.3.2) are treated similarly. ] Also what does it the