fork download
#include 
using namespace std;

enum Status{Idle, Busy};

std::ostream& operator<<(std::ostream& os, const Status status)
{
    switch (status)
    {
        case Idle: return os << "Idle";
        case Busy: return os << "Busy";
        default:   return os << "Status:" << status;
    }

    return os << "";
}

class text
{
    public:
        void SetStatus(Status s);
        Status getStatus();
    private:
        Status s;       
};
void text::SetStatus(Status s)
{
    this->s = s;
}
Status text::getStatus()
{
    return this->s;
}

int main()
{
    text myText;
    myText.SetStatus(Busy);
    cout << myText.getStatus() << endl; //	should output "Busy"
}
Success #stdin #stdout 0s 2724KB
stdin
Standard input is empty
stdout
Busy