#include <iostream>
using namespace std;
template<class T>
inline void PRINT_ELEMENTS(const T& coll,const char* optcstr=" ")
{
typename T::const_iterator pos;
cout<<optcstr;
for(pos=coll.begin();pos!=coll.end();++pos)
{
cout<<*pos<< " ";
}
cout<<endl;
}
注:PRINT_ELEMENTS第二个参数可有可无,在打印时它放在所有元素之前(起一个指示作用)