나는 개인 구성원으로 목록 개체와 템플릿 클래스를 만드는 오전과 C++의 목록 작성 :초기 용량
이.
.
.
private:
list<E> listObject;
};
첫 번째 생성자 (10)의 용량 목록 객체를 생성한다을 어떻게 것 그렇게?
template<class T, class E>
Queue<T,E>::Queue()
{
listObject.resize(10);
}
또는
template<class T, class E>
Queue<T,E>::Queue()
{
listObject = new list<E>(10);
}
또는 다른 생각
?
아직 컴파일하고 실행 해 보셨습니까? –
[[std :: list'] (http://en.cppreference.com/w/cpp/container/list)에 대한 참조, 특히 [생성자] (http : // en. cppreference.com/w/cpp/container/list/list). 그 후에 ['std :: queue'] (http://en.cppreference.com/w/cpp/container/queue)에 대해 읽어보십시오. –
나는이 단계에서 [좋은 입문서] (http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)를 읽는 것이 더 생산적 일 것이라고 생각한다. – juanchopanza