Thanks.
Do you mean contains them all at once? Perhaps you may want to consider
a "union" of enumerated types instead. You can have a "union Unit {}" that
can contain each type of unit. If you want to know which type of
enumeration is contained, consider a "struct" that containes and enumerated
type which defines the type of enumeration contained in the "struct" and the
union of all possible enumerations. (Try saying that 10 times fast.) :)
Regards,
Joe
"Trazom" <ferd...@bouygtel.com> wrote in message
news:167901c04b14$10b3c5a0$48862ecf@cpmsftngxa08...
change this to something like...
enum Units{WeightUnits, TimeUnits, ..., NumberOfUnits,
FirstUnits=WeightUnits, LastUnits = NumberOfUnits-1);
now write
for (int i = FirstUnits; i <= LastUnits; i++) {
Units u = Units(i);
...
}
alternatively, supply an appropriate operator++ for Units and you can write
for (Units u = FirstUnits; u <= LastUnits; u++) {
...
}
--
Roger Onslow
Software Developer
See my articles at http://www.codeguru.com
See the product I am working on at http://www.swishzone.com
"Operator .. give me the number for 911" .. Homer Simpson