#include <iostream.h>;
#include <algorithm>; // Need random_shuffle()
#include <vector>; // Need vector
#include <functional>; // Need unary_function
using namespace std;
// Data to randomize
int iarray[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
vector<int>; v(iarray, iarray + 10);
// Function prototype
void Display(vector<int>;& vr, const char *s);
// The FiboRand template function-object class
template <class Arg>;
class FiboRand : public unary_function<Arg, Arg>; {
int i, j;
Arg sequence[18];
public:
FiboRand();
Arg operator()(const Arg& arg);
};
void main()
{
FiboRand<int>; fibogen; // Construct generator object
cout << "Fibonacci random number generator" << endl;
cout << "using random_shuffle and a function object" << endl;
Display(v, "Before shuffle:");
random_shuffle(v.begin(), v.end(), fibogen);
Display(v, "After shuffle:");
}