I use this example for circular buffering.
To test test I created next three functions:
void cnt(ScreenStreamer &SS, cv::Mat & img)
{
CVUtils::Image m_img;
SS >> m_img;
img = m_img.matRef();
cv::imshow("",img);
cv::waitKey();
}
void snd1(circ_buffer<cv::Mat > & CM, cv::Mat & M)
{
CM.send(M);
}
void rcv1(circ_buffer<cv::Mat > & CV, cv::Mat & M)
{
M = CV.receive();
}
And then run it in main function:
int main()
{
ScreenStreamer stream;
CVUtils::Image m_img;
cv::Mat bufImg;
cv::Mat inpImg;
int key = 0;
circ_buffer<cv::Mat > F1;
F1.set_capacity(50);
std::thread m1( snd1, F1, &inpImg );
std::thread m2( rcv1, F1, &bufImg );
std::thread m3( cnt, stream, &inpImg);
m1.join();
m2.join();
m3.join();
return 0;
}
Unfortunatelly I get this error
Error C2664 'std::tuple<void (__cdecl *)(circ_buffer<cv::Mat> &,cv::Mat &),circ_buffer<cv::Mat>,cv::Mat *>::tuple(std::tuple<void (__cdecl *)(circ_buffer<cv::Mat> &,cv::Mat &),circ_buffer<cv::Mat>,cv::Mat *> &&)': cannot convert argument 1 from 'void (__cdecl &)(circ_buffer<cv::Mat> &,cv::Mat &)' to 'std::allocator_arg_t' CVUtilsExperimental C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory 1630
Does it come from template implementation or from function implementations? What to google to solve it?