//arrayList.h
template<class T>
class arrayList{
public:
// constructor, copy constructor and destructor
arrayList(int initialCapacity = 10);
arrayList(const arrayList<T>&);
~arrayList();
// iterators to start and end of list
class iterator;
class seamlessPointer;
seamlessPointer begin();
seamlessPointer end() ;
protected:
T* position;
}; // end of iterator class
protected:
T* element;
int arrayLength;
int listSize;
};
//main.cpp
int main() {
...........嵌套迭代器錯誤
sort(dict.begin, dict.end(),compare_nocase); ////
return 0;
}
兩個錯誤是:
..\src\test.cpp: In function 'int main()':
..\src\test.cpp:50:44: error: no matching function for call to 'sort(<unresolved overloaded function type>, arrayList<std::basic_string<char> >::seamlessPointer, bool (&)(std::string, std::string))'
..\src\/arrayList.h: In member function 'arrayList<T>::seamlessPointer arrayList<T>::end() [with T = std::basic_string<char>]':
..\src\test.cpp:50:28: instantiated from here
..\src\/arrayList.h:114:3: error: 'arrayList<T>::seamlessPointer::seamlessPointer(T*) [with T = std::basic_string<char>]' is private
..\src\/arrayList.h:49:44: error: within this context
爲什麼我得到這些錯誤?
編輯
的問題就解決了。由於
我解決了這個問題。但是還有更多的錯誤。 – Sean 2011-02-02 05:28:43