#include <algorithm>
#include <functional>
#include <cstdlib>
#include <vector>
#include <iostream>
using namespace std;
template <class T>
void print(T& c){
for( typename T::iterator i = c.begin(); i != c.end(); i++ ){
std::cout << *i << endl;
}
}
int main( )
{
vector<int> random( 8 );
// fill the container with random numbers
generate( random.begin(), random.end(), rand );
print( random );
}
|