fork download
  1. template<typename T>
  2. struct Q
  3. {
  4. typedef T t;
  5. };
  6.  
  7. template<typename T>
  8. void foo(Q<T> q)
  9. {
  10. using q_t = Q<T>;
  11. //typedef Q<T> q_t; // if we uncomment this and comment 'using' the example compiles
  12. typename q_t::t qwe; // <<<<<<<<<< Error: no type named ‘t’ in ‘using q_t = struct Q<T>’
  13. }
  14.  
  15. int main(int argc, char *argv[])
  16. {
  17. Q<int> q;
  18. foo(q);
  19. return 0;
  20. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty