robot.h:11:20: error: expected identifier before numeric constant Queue SQ(10);Üye değişken başlatma hatayı Bu konuda bir hata alıyorum neden anlamıyorum
struct Robot
{
string m_name; //robot name
Queue<string> SQ(10); //queue of services
int m_timer; //time til robot is done
string m_lastService; //most recent service
};
verir. (10) 'u aldığımda, varsayılan kurucuyu kullandı ve iyi çalışıyor. İşte sıra sınıfı.
template <typename T>
class Queue : public AbstractQueue<T>
{
private:
T* m_array;
int m_front;
int m_back;
int m_capacity;
int m_size;
public:
Queue();
Queue(int max);
void setMax(int max);
bool isEmpty() const;
const T& front() const throw (Oops);
const T& back() const throw (Oops);
void enqueue(const T& x);
void dequeue();
void clear();
~Queue();
};
Ben Kuyruk sınıfın başka beyanı kullanılan ve ana çalıştı, ama nedense o yapı içinde çalışmaz, burada ana
Queue<Robot> R(10);