如何在c ++中返回deque数组?
private:
deque<int> iHouses[3];
public:
deque<int> getHouses();
//在实现函数时给我一个错误 - 但是我应该在哪里放括号?
deque<int> GameEngine::getHouses() {
return this->iHouses;
}
答案 0 :(得分:4)
只需使用std :: array
即可#include <array>
....
private:
using my_house_cont = std::array<std::deque<int>, 3>;
my_house_cont m_houses;
public:
my_house_cont getHouses();