템플릿에서 반복자 타입 정의가 안 됩니다.
글쓴이: purewell / 작성시간: 수, 2006/03/29 - 7:37오후
소스
#includeusing 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"
@ ,.@) 무엇이 문제인가요?
Forums:
자답입니다. typedef
자답입니다.
typedef typename vtype::iteartor vtype_itr;
------------------------------------------------
언제나 맑고픈 샘이가...
http://yubink.com - 강아지 필요하세요?
http://purewell.biz - 헙!!
_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz
댓글 달기