#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第二个参数可有可无,在打印时它放在所有元素之前(起一个指示作用)
posted on 2010-04-19 13:03
蓝牙 阅读(87)
评论(0) 编辑 收藏 引用