枚举类型怎么作为函数返回值啊

#include
using namespace std;
#define maxlen=100;
class queue{
public:enum error_code{underflow,overflow,success};
queue();
bool empty() const;
bool full() const;
error_code get_front(int &x) const;
error_code append(const int x);
error_code serve();
private:int count;
int front,rear;
int data[maxlen];
};
queue::queue(){
count=0;front=rear=0;
}
bool queue::empty() const{
if(count==0)return true;
return false;//return front==rear;
}
bool queue::full() const{
if(count==maxlen-1)return true;
return false;//return (rear+1)%maxlen==front;
}
error_code queue::get_front(elementtype &x) const{
if(empty()) return underflow;
x=data[(front+1)%maxlen];
return success;
}
error_code queue::append(const elementtype x){
if(full()) return overflow;
rear=(rear+1)%maxlen;
x=data[rear];
return success;
}
error_code queue::serve(){
if(empty()) return underflow;
front=(front+1)%maxlen;
return success;
}
queue::error_code(){
if(empty()) return underflow;
if(full()) return overflow;
else return success;
}
void out_number(){
int m,n;queue q;
cout << 1 << endl;
q.append(1);
for(int i=2;i<=7;i++)
{
m=0;
for(int j=1;j<=i-1;j++){
n=q.get_front();
q.serve();
cout <<m+n;
q.append(m+n);
m=n;
}
cout <<1<< endl;
q.append(1);
}
}

一个队列结构输出杨辉三角的问题