queue<vector<int>> q; 当调用 q.front()时为什么返回值是 void 呢
|  |      1dbskcnc      2020-07-10 10:00:05 +08:00 完全没问题 | 
|  |      2BrettD      2020-07-10 10:07:02 +08:00 via iPhone 你怎么看到返回 void 的? | 
|      3516310189i OP 使用 auto a = q.front();的时候会提示错误 Cant instantiate the variables of type void CLion 里提示也显示 front 返回值是 void | 
|  |      4coderfox      2020-07-10 11:19:01 +08:00 | 
|  |      5wutiantong      2020-07-10 11:20:49 +08:00  1 先改成 std::queue<std::vector<int>>再聊 | 
|  |      6Akiyu      2020-07-10 11:52:10 +08:00 @516310189i  http://www.cplusplus.com/reference/queue/queue/front/ front 不会返回 void(至少不是 void 类型). 而返回 "空" 仅在 queue 为空的情况下. 但是即使这样, 也只会在使用返回值时报错. 而并非在 front 返回的时候. 除非编译器或者标准库做了检查. 但一般不会这样. 方便提供一下原始代码, 库和编译器的版本么? | 
|      7516310189i OP 啊 是 CLion 的问题,CLion 提示错误,但是运行没错,是我傻了。感谢大家:) |