템플릿에서 반복자 타입 정의가 안 됩니다.

purewell의 이미지

소스

#include 
using namespace std;

template
class MyClass
{
public:
    typedef T type;
    typedef T* type_ptr;
    typedef vector vtype;
    typedef vtype::iterator vtype_itr;   //! 여기서 오류가 납니다.
};

오류 내용

template.cpp:11: error: type `std::vector >' is not derived from type `MyClass'
template.cpp:11: error: ISO C++ forbids declaration of `iterator' with no type
template.cpp:11: error: expected `;' before "vtype_itr"

@ ,.@) 무엇이 문제인가요?

purewell의 이미지

자답입니다.

typedef typename vtype::iteartor vtype_itr;

------------------------------------------------
언제나 맑고픈 샘이가...
http://yubink.com - 강아지 필요하세요?
http://purewell.biz - 헙!!

_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz