'typename'에 해당되는 글 1건

  1. 2008.04.22 [C/C++] Simple example of using 'typename'

[C/C++] Simple example of using 'typename'

Language/C&C++ 2008.04.22 23:38
[[ blog 이사 과정에서 정확한 posting날짜가 분실됨. 년도와 분기 정도는 맞지 않을까? ]]

We can use 'typename' in template class.

class C
    typename T::bT* a;

But, keyword 'typename' cannot be used outside template. So, following is incorrect syntax.

class A;
class B
    A*     a;
    typename A::bT* b; // error here!

So, in this case, class A's definition should be included before definition of class B.

It's just small information about using 'typename'.

tags : ,
Trackback 0 : Comment 0

티스토리 툴바