疑问:
1、element[--listSize].~T();*/ //So the space of array of element will decrease too???????
注意事项:
1、Pay attention to the range of the parameters,especially i.e Index
2、/*this->element = theArrayList.element;*/ //wrong,cause just copy the first elementT类型赋值重载需深复制when theArrayList is deleted,this->element also is deleted
3、After using the other/external function,do not forget to refresh Revelant Variables.
4、Ingore that the quantity relationship between the two sizes,due to the PREJUDICE
i.e ,void changeLength1D(T *&start, int oldSize, int newSize)
收获:
1、Merge similar FUNCTIONs intoto ONE
2、void arrayList<T>::output(ostream& out) const{}
copy(element, element + listSize, ostream_iterator(cout, " "));//Don't forget T
3、//overload<<
4、Invoke the existing funtion/interface(STL booster) to
a decrease the code
b increasse the coupling in order to make it easier to burn the bug by modifying a single function