'반복자는 유형이 아닌'여기 내 코드입니다 : 나는 오류 'iterator is not a type'
를 얻을 수C++ 오류 :
template <typename container_type>
void transfer(container_type container, iterator begin, iterator end) {
for (; begin != end; begin++)
if (!element_in_container(container, *begin))
container.insert(iterator, *begin);
}
가.
또는 container_type::
을 iterator
앞에 추가하려고 시도했지만 도움이되지 않았습니다. 템플릿을 template <typename container_type<typename T> >
으로 정의하고 이터레이터를 container_type<T>::iterator
(운 없음)으로 정의 해 보았습니다. 뭐가 문제 야?
'typename container_type :: iterator'는 어떻습니까? –
실제로 iterator는 타입이 아닙니다. –
가능한 복제본 : [어디서 왜 "템플릿"및 "typename"키워드를 넣어야합니까?] (http://stackoverflow.com/questions/610245/where-and-why-do-i-have- template-and-typename-keywords) –