void test_list(ostream& out) { LS ls; ls << "one" << "two" << "three" << "four"; // insert before 'three' LS::iterator li = find(ls.begin(), ls.end(),"three"); ls.insert(li,"three-half"); out << ls << endl; ls.remove("two"); out << ls << endl; LD ld; double d[] = {2.2, 5.3, 6.7, 4.1}; copy(d,d+4,back_inserter(ld)); LD::iterator di; for(di = ld.begin(); di != ld.end(); ++di) out << *di << ' '; out << endl; while (ld.size() > 0) { out << ld.back() << ' '; ld.pop_back(); } out << endl; }
void SubscriptionClientTest::receiveSubsription(LS result){ if(result.empty()) return; cout<<" in SubscriptionClientTest::receiveSubsription print result"<<endl; for(LS::iterator iter = result.begin(); iter != result.end(); iter++){ cout<<*iter<<" "<<endl; } cout<<endl; }