zauważyłem przez przypadek, że ten kod kompiluje i działa poprawnie:Dlaczego decltype (klasa klasa :: :: :: członkiem klasy) ważny
struct M { int some_int; };
static_assert(std::is_same<
decltype(M::M::M::M::some_int) /* <- this */,
int>::value, "Types must be int");
Dlaczego jest to poprawne (decltype(M::M::M::M::some_int) <=> decltype(M::some_int)
)?
Jakie inne konstrukcje można użyć tego wzoru z class::class::...::member
?
Compiler: Microsoft (R) C/C++ Compiler Wersja 19.00.23824.1 Optymalizacja dla x86
Och, chłopcze, załóżcie, że upiory wpadają w coś, co oczywiście jest [duplikatem] (http://stackoverflow.com/q/12135498). –