View Single Post
Old 05-03-2005, 05:17 PM   #2 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Yes, all you need to do is to pass an identifier of the enum type:
Code:
#include <iostream>

using namespace std;

enum MyEnum
{
  NIL, ONE, TWO, THREE
};

ostream& operator<<(ostream& os, const MyEnum& me)
{
  if(me == ONE)
  return os<<1;
  //etcetera
}

int main()
{
  MyEnum theEnum;
  cout<<ONE<<endl;

  cin.get();
  return 0;
}
__________________
Valmont is offline   Reply With Quote