C++ 将内存分配给std::数组时出错

C++ 将内存分配给std::数组时出错,c++,stdarray,C++,Stdarray,我的意图是使用中的示例将队列中的图像缓冲区传递给其他函数(另一个线程中)进行处理。但是,我得到了以下错误: error: request for member ‘data’ in ‘frame’, which is of non-class type ‘std::array<unsigned char, 345600>()’ 错误:请求“frame”中的成员“data”,该成员为非类类型“std::array() 及 错误:调用“std::deque::push_back(std

我的意图是使用中的示例将队列中的图像缓冲区传递给其他函数(另一个线程中)进行处理。但是,我得到了以下错误:

error: request for member ‘data’ in ‘frame’, which is of non-class type ‘std::array<unsigned char, 345600>()’
错误:请求“frame”中的成员“data”,该成员为非类类型“std::array()

错误:调用“std::deque::push_back(std::array(&)()”时没有匹配的函数”
这是我的代码,我想知道错误在哪里

// Declaration of array  
std::deque<std::array<unsigned char, FRAME_WIDTH * FRAME_HEIGHT>> frameQueue;

// some processing
// some processing take place and the output is some buffer buf , type unsigned char 

// declare an array object
std::array<unsigned char, FRAME_HEIGHT * FRAME_WIDTH> frame();

// set the array with memory from buf
std::memcpy (frame.data(), buf, FRAME_HEIGHT * FRAME_WIDTH);

// push it into queue
frameQueue.push_back(frame);
//数组的声明
std::deque frameQueue;
//一些加工
//进行了一些处理,输出是一些缓冲区buf,输入unsigned char
//声明数组对象
std::数组帧();
//使用buf中的内存设置阵列
std::memcpy(frame.data(),buf,frame\u HEIGHT*frame\u WIDTH);
//把它推到队列里
帧队列。向后推(帧);

谢谢

我认为您不应该在这行的框架前面使用括号:

std::数组帧()

正确的命令是:


std::阵列帧

声明一个数组对象
实际上是一个函数的声明。拉苏尔:我被纠正了……我犯了这个错误,真傻
// Declaration of array  
std::deque<std::array<unsigned char, FRAME_WIDTH * FRAME_HEIGHT>> frameQueue;

// some processing
// some processing take place and the output is some buffer buf , type unsigned char 

// declare an array object
std::array<unsigned char, FRAME_HEIGHT * FRAME_WIDTH> frame();

// set the array with memory from buf
std::memcpy (frame.data(), buf, FRAME_HEIGHT * FRAME_WIDTH);

// push it into queue
frameQueue.push_back(frame);