First rule #1:
For operator
>> and
<< always return the stream at the end:
Code:
istream& / ostream& operator<</>>(istream/ostream& iostr, T& t)
{
//code
return iostr;
}
Now for your extraction operator:
Are you sure what you are doing? What are you trying to achieve? Something is fishy about overloading an extraction operator for the enum type... do you see why?
As for your answer:
What means this:
Code:
#include <iostream>
#include <ios>
using namespace std;
enum AnEnum {A, B, C, D};
int main()
{
AnEnum MyEnum;
//What???
cin>>MyEnum;
//Optional. Depends on IDE: prevents "console flashing".
cin.get();
return 0;
}
And this?
Code:
//Come again?
if(MyEnum == "Hi")
{
//Whatever.
}
With tons of fantasy, I maybe could find a use for overloading the extraction operator for enum types. But you may ask yourself how sane that is

.
Many employers threaten to fire programmers if they come up with such code. You have been warned.