我只是分裂了一個C++程序,我正在寫入多個文件。頭文件類成員函數聲明錯誤:嵌套名稱說明符中的「不完整類型」名稱
現在我收到每個成員函數聲明的這個錯誤。
我在做什麼錯?
3 class Office{
4 private:
5 static const int IDLE = 0, BUSY = 1;
6 const int num_tellers;
7 int students_served;
8
9 vector<double> que; // a vector que which holds the arrival times of students entering an Office
10 vector<int> tellers; // a vector to hold the status (IDLE or BUSY) of the tellers *** INITIALIZED TO SIZE tellers[num_tellers] IN CONSTRUCTOR ***
11
12
13 variate_generator<mt19937, exponential_distribution<> > serve_time; // random variable, determines the time it takes a teller to serve a student
14
15 public:
16
17 Office(double const office_mean, int const num_tellers) : num_tellers(num_tellers), tellers(vector<int>(num_tellers, IDLE)),
18 serve_time(variate_generator< mt19937, exponential_distribution<> >(mt19937(time(0)), exponential_distribution<>(1/office_mean))){
19 } // initialize tellers vector to size num_tellers w/ tellers[i] = IDLE, accumulated times to , and initializes serve_time random variable
37 int Office::departure_destination(Event* departure) { // returns the next destination of a student departing from an Office
38
39 if (departure->depart_from == AID) {
40 return determine_destination(.15, .15, 0, 0, .70);
41 else if (departure->depart_from == PARKING)
42 return next_destination = determine_destination(.3, 0, 0, 0, .7);
43 else if (departure->depart_from == REGISTRAR)
44 return next_destination = determine_destination(.25, 0, .1, 0, .65);
45 else if (departure->depart_from == BURSAR)
46 return next_destination = determine_destination(0, .1, .2, .1, .60);
47 else
48 return -1;
49 }
50
然後在頭文件
57 int Office::departure_destination(Event* departure);
一些代碼將是一個良好的開端。 – chris
好吧,它就像600線左右,我可以張貼標題,雖然我猜.. – user1647959
做一個較小的例子與一個功能,沒有別的。最好的事情是顯示錯誤的最小可編譯樣本。 – chris