64,637
社区成员
发帖
与我相关
我的任务
分享
#include <iostream> #include <queue> #include "time.h" #include "math.h" using namespace std; struct plane { int id; //飞机编号 int tm; //到达队列时间 }; int main(void) { vector<plane> a(6) ; vector<plane> b(6) ; queue <plane, vector<plane> > landing(a) ; // queue的类声明需要一个Container 类型,默认为deque<T> queue <plane, vector<plane> > takeoff(b); //等待起飞的飞机(环形)队列,实际扯Size-1 landing.empty() ; return 0 ; } queue的构造函数也只支持声明类的时候用的Container类型的变量,或者空构造函数。
#include <iostream> #include <queue> #include "time.h" #include "math.h" using namespace std; struct plane { int id; //飞机编号 int tm; //到达队列时间 }; int main(void) { vector<plane> a(6) ; vector<plane> b(6) ; queue <plane, vector<plane> > landing(a) ; // queue的类声明需要一个Container 类型,默认为deque<T> queue <plane, vector<plane> > takeoff(b); //等待起飞的飞机(环形)队列,实际扯Size-1 landing.empty() ; return 0 ; } queue的构造函数也只支持声明类的时候用的Container类型的变量,或者空构造函数。
#include <iostream> #include <queue> #include "time.h" #include "math.h" using namespace std; struct plane { int id; //飞机编号 int tm; //到达队列时间 }; int main(void) { vector<plane> a(6) ; vector<plane> b(6) ; queue <plane, vector<plane> > landing(a) ; // queue的类声明需要一个Container 类型,默认为deque<T> queue <plane, vector<plane> > takeoff(b); //等待起飞的飞机(环形)队列,实际扯Size-1 landing.empty() ; return 0 ; } queue的构造函数也只支持声明类的时候用的Container类型的变量,或者空构造函数。
queue没有构造函数queue(int),