next up previous contents
Next: enum_base Class Variables Up: The Type Base Classes Previous: integer_base Class Instantiation

The Enumeration Base Class

The enumeration base class includes a single member variable of type char which stores the actual data value. Each enumeration item is associated with an unique integer value.

Example:

class enum_base {
public:
  char value;
  enum_base(const int a=0) { value = a; }
  enum_base(const enum_base &a) { value = a.value; }
  enum_base &operator=(const enum_base a) {
    value = a.value;
    return *this;
  }
  operator int() const { return value; }
};



 


1998-11-17