【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 ...
随机推荐
- VMware Workstation Pro12安装RedHat6.4 64位
1.打开VM12软件,并新建一个虚拟机. 点击 下一步. 默认即可,点击 下一步. 选择 稍后安装操作系统(S). 这一项,基本上都是默认的.点击 下一步. 这里 客户机操作系统 就选择 L ...
- spring boot开发 @autowired注入失败
@autowired注入失败 会出现如下错误提示: 2018-05-28 08:39:41.857 INFO 8080 --- [ restartedMain] org.hibernate.Versi ...
- YOLO V1论文理解
摘要 作者提出了一种新的物体检测方法YOLO.YOLO之前的物体检测方法主要是通过region proposal产生大量的可能包含待检测物体的 potential bounding box,再用分类器 ...
- Python 爬虫-股票数据的Scrapy爬虫
2017-08-06 19:52:21 目标:获取上交所和深交所所有股票的名称和交易信息输出:保存到文件中 技术路线:scrapy 获取股票列表:东方财富网:http://quote.eastmone ...
- ArcGIS API for Silverlight——小滑块
Widgets翻译过来是小玩具.如果使用过Dojo或者ExtJS等js框架肯定会了解到这个“小玩具”也有大用处,能够在很大程度上减少我们的工作量,快速完成功能需求.能减少多大工作量呢?让我们先来,点击 ...
- 20170711xlVBA自定义分类汇总一例
Public Sub CustomSubTotal() AppSettings On Error GoTo ErrHandler Dim StartTime, UsedTime As Variant ...
- OAuth简介(包含简明使用教程)
SSO:用户一次登陆后在多个系统免登录. 博客gem 'doorkeeper' https://i.cnblogs.com/EditPosts.aspx?postid=9255973 OAuth:用 ...
- NOJ-1581 筷子 (线性DP)
题目大意:有n支筷子,已知长度,定义一双筷子的质量等于长度的平方差,问能否分成k双?若能,输出所有筷子的最小质量和. 题目分析:先将筷子按长度从小到大排序,定义状态dp(i,j)表示将前 i 支筷子分 ...
- 正向代理到指定泛域名的nginx配置
resolver 8.8.8.8; #必须配置!!!不然无法代理 server { listen default_server; listen [::]: default_server; server ...
- JavaScript学习总结(十一)——Object类详解
一.Object类介绍 Object类是所有JavaScript类的基类(父类),提供了一种创建自定义对象的简单方式,不再需要程序员定义构造函数. 二.Object类主要属性 1.constructo ...