CRTP — accessing incomplete type members
问题 Related questions: one, two After trying to understand CRTP for several days it seems that now I understand even less than before:) Consider the following code: 01 #include <iostream> 02 03 template <class IMPL> 04 class Interace 05 { 06 public: 07 typedef typename IMPL::TYPE TYPE; // ERROR: "...invalid use of incomplete type..." 08 void foo() { IMPL::impl(); } // then why does this work? 09 }; 10 11 class Implementation : public Interface<Implementation> 12 { 13 public: 14 typedef int TYPE;