Right now I'm generating a random enumerator using boost's random library. Basically I'm using an implicit conversion to specify the random generator's distribution, getting a random number, and then casting that back to the enumerated type.
Ex: (minColor and maxColor are parameters of the enumerated type)
boost::mt19937 randGen(std::time(0));
boost::uniform_int<> dist(minColor, maxColor);
boost::variate_generator< boost::mt19937&, boost::uniform_int<> >
GetRand(randGen, dist);
return static_cast<Common::Color> (GetRand());
I'm curious whether boost's library supports anything like creating a distribution for an enumerated type, and thus returns a randomly selected enumerator. Something like...
boost::uniform<Common::Color> dist(minColor, maxColor);