#include
#include
#include
#include
using namespace std;
template
void times2(ForIter start, ForIter end)
{
while(start != end) {
*start *= 2;
start++;
}
}
int main()
{
int i;
vector vectorObject;
for(i = 0; i <10; i++)
vectorObject.push_back(i);
cout << "Initial Contents of vectorObject: ";
for(i = 0; i cout << vectorObject[ i ] << " ";
cout << endl;
times2(vectorObject.begin(), vectorObject.end());
cout << "Contents of vectorObject doubled: ";
for(i = 0; i cout << vectorObject[ i ] << " ";
cout << endl;
list lst;
list::iterator p;
for(i = 0; i <5; i++)
lst.push_back((float)i*3.1416);
cout << "Initial Contents of lst: ";
for(p=lst.begin(); p!=lst.end(); p++)
cout << *p << " ";
cout << endl;
times2(lst.begin(), lst.end());
cout << "Contents of lst doubled: ";
for(p=lst.begin(); p!=lst.end(); p++)
cout << *p << " ";
cout << endl;
return 0;
}