HP에서 Template 컴파일 에러가 나네요..
글쓴이: wideye42 / 작성시간: 화, 2005/10/11 - 6:29오후
HP 에서 컴파일 하다보니 Template 관련 에러가 나는데 무슨 에러인지 모르겠습니다..
환경 : HP-UX 11.x, aCC A.03.60
Error 856: "BaseStructDef.h", line 128 # The definition of template CTArray<tagRPLTSortList,std::allocator<tagRPLTSortList> > contains typename qualification 'CTArray<_Ty,_A>::reference', yet generation of specialization class CTArray<tagRPLTSortList,std::allocator<tagRPLTSortList> > implies that 'CTArray<_Ty,_A>' is 'class CTArray<tagRPLTSortList,std::allocator<tagRPLTSortList> >', and creates a circular definition. CTArray<RPLTSORTEDLIST> mn_arSortedGenericPtList;
CTArray는 std::vector를 캡슐라이즈 한 class이고,
template < class _Ty ,class _A = std::allocator < _Ty > > class CTArray : public std::vector< _Ty , _A > { public: typedef typename CTArray<_Ty, _A>::reference reference; typedef typename CTArray<_Ty, _A>::const_reference const_reference; typedef typename CTArray<_Ty, _A>::size_type size_type; typedef typename CTArray<_Ty, _A>::iterator iterator; typedef typename CTArray<_Ty, _A>::const_iterator const_iterator; public: void Add(const _Ty& X) { push_back(X); }
RPLTSortList 는 일반적인 struct입니다..
컴파일 옵션은
aCC -c -AA
알고 계시면 꼭 도움 부탁드리겠습니다..
그럼.. 좋은하루되세요~
Forums:
순환 정의(circular definition)이라는군요. ^^;ty
순환 정의(circular definition)이라는군요. ^^;
typedef typename CTArray<_Ty, _A>::reference reference는
typedef typename std::vector<_Ty, _A>::reference reference를 의도하신 거죠?
더불어
해결되었습니다..답변에 감사드립니다.좋은 하루 되세요~~
해결되었습니다..답변에 감사드립니다.
좋은 하루 되세요~~
댓글 달기