【error】no type named ‘type’ in ‘class std::result_of<void
Q:
std::thread fs_module(fs_process, prob_orig, fb_sz, line_num, probp, plabel, std::ref(confidence_level)) ;
fs_module.detach();
A:
I could compile your code successfully with MSVC2013. However, thread() works passing copies of its argument to the new thread. This means that if your code would compile on your compiler,
each thread wourd run with its own copy of ht, so that at the end, main's ht would be empty.GCC doesn't compile with this weird message. You can get rid of it by using the reference wraper with thread.
This will compile succesfully. And each reference used by the threads would refer to the same object.
However, there are high chances that you'll get some runtime error or unexpected results. This is because two threads are concurently trying to insert into ht. But unordered_map is not thread safe,
so these racing conditions might cause ht to reach an unstable state (i.e. UB, i.e. potential segfault).
std::thread fs_module(fs_process, prob_orig, fb_sz, line_num, std::ref(probp), std::ref(plabel), std::ref(confidence_level)) ;
fs_module.detach();
re:
【error】no type named ‘type’ in ‘class std::result_of<void的更多相关文章
- 【error】Invalid ADAPTORNAME specified. Type 'imaqhwinfo' for a list of available ADAPTORNAMEs.
前言 使用matlab通过摄像头获取图像进行处理: 问题描述 使用matalb调用摄像头时出现错误: >> imaqhwinfo Warning: No Image Acquisition ...
- 【ERROR】no matching function for call to 'std::basic_ifstream<char>::basic_ifstream
错误记录:QT中使用 no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(QString ...
- /usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std::_Mem_fn<void
/usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std ...
- laravel 【error】MethodNotAllowedHttpException No message
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message 报错原因[原理]CSRF ...
- 【Error】IOError: [Errno 22] invalid mode ('wb') or filename
错误描述: IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Viral Patel\\Documents\\GitHu ...
- 【原创】js中input type=file的一些问题
1.介绍 在开发中,文件上传必不可少,input[type=file] 是常用的上传标签,但是它长得又丑.浏览的字样不能换,但是他长得到底有多丑呢.我们来看看在不同浏览器里的样子吧. <inpu ...
- 【Elasticsearch】清空指定index/type下的数据
1.postman请求接口 http://ip:端口/index/type/_delete_by_query?conflicts=proceed body为: { "query": ...
- 【HDOJ】2577 How to Type
DP. /* 2577 */ #include <cstdio> #include <cstring> #include <cstdlib> #define MAX ...
- 【ERROR】使用jquery的ajax出现error:readyState=4,status=500
使用jquery的ajax出现error:readyState=4,status=500,ajax代码如下: $.ajax({ url : "../toBeFinMisManage/show ...
随机推荐
- VC6的VCVARS32.BAT所在位置
1. C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT 2.
- 动态规划-Largest Sum of Averages
2018-07-12 23:21:53 问题描述: 问题求解: dp[i][j] : 以ai结尾的分j个部分得到的最大值 dp[i][j] = max{dp[k][j - 1] + (ak+1 + . ...
- 用MVVM模式开发中遇到的零散问题总结(1)
https://www.cnblogs.com/tong-tong/archive/2011/11/28/2250948.html
- GetImageURL
Sub GetImageUrl(ByVal URL As String) Dim strText As String Dim i As Long Dim OneImg With CreateObjec ...
- 20170719xlVbaAbsorbProcedure
Sub AbsorbThisProcedure() If Application.VBE.MainWindow.Visible = False Then MsgBox "请先激活VBE编辑窗 ...
- Linux Used内存到底哪里去了?
原创文章,转载请注明: 转载自系统技术非业余研究 本文链接地址: Linux Used内存到底哪里去了? 前几天 纯上 同学问了一个问题: 我ps aux看到的RSS内存只有不到30M,但是free看 ...
- Kali Linux on Android # 实测:小米2s离线安装Kali Linux
小米2s 离线安装Kali Linux 2017年2月4日 by 小甘丶 前段时间也研究过一两天,没弄明白,今天突然来兴致了,说研究一下吧,结果一不小心,就弄明白了! 第一次研究,主要是没弄明白这个 ...
- hdu-5492-dp
Find a path Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HttpServletResponse输出的中文乱码
HttpServletResponse输出有两种格式,一种是字符流,一种是字节流. 1.字符流 // 这句话的意思,是让浏览器用utf8来解析返回的数据,即设置客户端解析的编码 response.se ...
- 51. N-Queens 52. N-Queens II *HARD*
1. 求所有解 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two ...