I noticed by accident that this code compiles and works correctly:
struct M { int some_int; };
static_assert(std::is_same<
decltype(M::M::M::M::some_int) /* <- this */,
int>::value, "Types must be int");
Why is this correct (decltype(M::M::M::M::some_int) <=> decltype(M::some_int)
)?
What other constructs one can use this pattern with class::class::...::member
?
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23824.1 for x86