-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
An id-expression that denotes a non-static class member may be used in a
`sizeof` expression or a `decltype` expression. This allows obtaining the
corresponding value without having an instance of the class containing the
member.
For example, if we have this class:
```
struct X { int x; };
```
then `sizeof(X::x)` equals `sizeof(int)`, and `decltype(X::x)` is `int`.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
`sizeof` expression or a `decltype` expression. This allows obtaining the
corresponding value without having an instance of the class containing the
member.
For example, if we have this class:
```
struct X { int x; };
```
then `sizeof(X::x)` equals `sizeof(int)`, and `decltype(X::x)` is `int`.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html