fork(3) download
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. struct Base
  5. {
  6. using Type = int;
  7. };
  8.  
  9. template <typename T>
  10. struct intermediate : Base<T>
  11. {
  12. // 'Type' is not defined here, which is fine
  13. };
  14.  
  15. template <typename T>
  16. struct Derived : intermediate<T>
  17. {
  18. using Type = typename Derived<T>::Type; // Is this legal?
  19. // using Type = typename intermediate<T>::Type; // Normal way of doing it
  20. };
  21.  
  22. int main()
  23. {
  24. Derived<void>::Type b = 1;
  25. std::cout << b << std::endl;
  26. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1