return 0;
}
finsert1.cpp
#include ‹iostream.h›
#include ‹stl.h›
char* array[] = {'laurie', 'jennifer', 'leisa'};
int main() {
deque‹char*› names;
copy(array, array + 3, front_insert_iterator‹deque ‹char*› ›(names));
deque‹char*›::iterator i;
for (i = names.begin(); i!= names.end(); i++) cout ‹‹ *i ‹‹ endl;
return 0;
}
remcpif1.cpp
#include ‹stl.h›
#include ‹iostream.h›
bool odd(int a_) {
return a_ % 2;
}
int numbers[6] = {1, 2, 3, 1, 2, 3};
int result[6] = {0, 0, 0, 0, 0, 0};
int main() {
remove_copy_if(numbers, numbers + 6, result, odd);
for (int i = 0; i ‹ 6; i++) cout ‹‹ result[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
inplmrg1.cpp
#include ‹stl.h›
#include ‹iostream.h›
int numbers[6] = {1, 10, 42, 3, 16, 32};
int main() {
for (int i = 0; i ‹ 6; i++) cout ‹‹ numbers[i] ‹‹ ' ';
cout ‹‹ endl;
inplace_merge(numbers, numbers + 3, numbers + 6);
for (i = 0; i ‹ 6; i++) cout ‹‹ numbers[i] ‹‹ ' ';
cout ‹‹ endl;
return 0;
}
list4.cpp
#include ‹iostream.h›
#include ‹stl.h›
int array1[] = {1, 3, 6, 7};
int array2[] = {2, 4};
int main() {
list‹int› l1(array1, array1 + 4);
list‹int› l2(array2, array2 + 2);
l1.merge(l2);
for (list‹int›::iterator i = l1.begin(); i != l1.end(); i++) cout ‹‹ *i;
cout ‹‹ endl;
return 0;
}
revbit1.cpp
#include ‹iostream.h›
#include ‹stl.h›
int array[] = {1, 5, 2, 3};
int main() {
list‹int› v(array, array + 4);
reverse_bidirectional_iterator‹list‹int›::iterator, int, list‹int›::reference, list‹int›::difference_type› r (v.end());
while (r != v.begin())
cout ‹‹ *r++ ‹‹ endl;
return 0;
}
copy3.cpp