Tools.h++ Class Reference

Table Of Contents
Persistence
Isomorphic
Example
In this example, a double-ended queue of ints is exercised.
//
// tvdqint.cpp
//
#include <rw/tvdeque.h>
#include <iostream.h>
/*
* This program partitions integers into even and odd numbers
*/
int main(){
RWTValDeque<int> numbers;
int n;
cout << "Input an assortment of integers (EOF to end):"
<< endl;
while (cin >> n) {
if (n % 2 == 0)
numbers.pushFront(n);
else
numbers.pushBack(n);
}
while (numbers.entries()) {
cout << numbers.popFront() << endl;
}
return 0;
}
Program Input:
1 2 3 4 5
<eof>
Program Output: