24.3.3 Function Objects (cont.)
Generalize
rand_one_hundred
Return values between
a
and
b
, not known until run time
Create function objects, initialized w/the bounds:
class RandomInt { public: RandomInt(int ia, int ib); int operator()(); private: int a, b; };
prev
|
top
|
next