ZThread::ThreadLocal:ERROR C4716 must return a value的解决
首先看如下代码:
#include <zthread/ThreadLocal.h> int main()
{
ZThread::ThreadLocal<unsigned int> value;
value.set();
value.set(value.get() + );
return ;
}
在Windows下编译的话你会发现如下错误(编译器CL.exe)
e:...\include\zthread\threadlocal.h(304) : error C4716: "ZThread::ThreadLocal,ZThread::ThreadLocalImpl::UniqueChildValueFn,ZThread::ThreadLocalImpl::InheritableValueFn>::Value::operator=": must return a value.
解决方案:点此链接
我上stackoverflow问了一下找到了原因
其实就是因为ZThread确实是上了年纪的库了,一些旧的编译器能接受的语法,在新的编译器下就是ERROR
把zthread/ThreadLocal.h大概第304行的代码const Value& operator=(const T& v) { value = v; }
修改为const Value& operator=(const T& v) { value = v; return *this; }
好了 大功告成
ZThread::ThreadLocal:ERROR C4716 must return a value的解决的更多相关文章
- Cocos2d-x 3.2编译生成Android程序出错Error running command, return code: 2的解决方法
用Cocos2d-x 3.2正式版创建项目,结果使用cocos compile -p android编译生成APK程序,结果悲剧了,出现以下错误. Android NDK: Invalid APP_S ...
- Description Resource Path Location Type Error executing aapt: Return code -1073741819 Client line 1
Logcat报错:Description Resource Path Location Type Error executing aapt: Return code -1073741 ...
- Error executing aapt: Return code -1073741819
在做andrid项目的时候,本来想把a项目中的a功能模块复制到b项目中,但是复制过程中出现xml文件id的问题, Error executing aapt: Return code -10737418 ...
- java.lang.Error: Unresolved compilation problems: Syntax error on token "return", delete this token Type mismatch: cannot convert from Init to String
java.lang.Error: Unresolved compilation problems: Syntax error on token "return", delete ...
- MyBatis:Error evaluating expression ''''. Return value () was not iterable错误
Error evaluating expression ''''. Return value () was not iterable 出现原因:xml文件中遍历List 时,该参数的实际值为非Lis ...
- System Error. Code:1722. RPC服务器不可用解决办法
原文链接(转载请注明出处):System Error. Code:1722. RPC服务器不可用解决办法 问题 最近在软件设计上机课的时候,使用 starUML 建模工具画UML图的时候总是弹出一条如 ...
- gSoap的“error LNK2001: 无法解析的外部符号 _namespaces”解决方法
错误 2 error LNK2001: 无法解析的外部符号 _namespaces 解决方法: 1. 在工程中定义 WITH_NONAMESPACES 宏 2.尝试 "#include &q ...
- sqlplus连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0解决
sqlplus连接数据库报错SP2-0642: SQL*Plus internal error state 2130, context 0:0:0解决 sqlplus 连接数据库报错SP2-0642: ...
- error Unexpected use of comma operator no-sequences解决过程
error Unexpected use of comma operator no-sequences解决过程 报错内容: ERROR in ./pages/course/_id.vue friend ...
随机推荐
- java性能监控器VisualVM
1.mac系统启动文件位置:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/jvisualvm 2.linux ...
- nginxtomca负载均衡
Nginx 是一个高性能的 Web 和反向代理服务器, 它具有有很多非常优越的特性: 作为 Web 服务器:相比 Apache,Nginx 使用更少的资源,支持更多的并发连接,体现更高的效率,这点使 ...
- phantomjs 无法打开https网站解决方案
最近测试原来的爬虫程序,发现phantomjs 无法打开https网站了,经过网上查下,发现需要在phantomjs定义的加以下参数 self.driver = webdriver.PhantomJS ...
- mysql结构相同的三张表查询一条记录\将一张表中的数据插入另外一张表
将一张表中的数据插入另外一张表 1.两张表结构相同 insert into 表1名称 select * from 表2名称 2.两张结构不相同的表 insert into 表1名称(列名1,列名2,列 ...
- Discuz常见小问题2-如何清空,删除,清除全部DIY的数据
如果所有diy都不想要了,手动清空_common_block._common_diy_data与_common_template_block表,然后删除\data\diy\下的所有子文件夹,保证你以前 ...
- 浅析php中抽象类和接口的概念以及区别[转]
//抽象类的定义: abstract class ku{ //定义一个抽象类 abstract function kx(); ...... } function aa extends ku{ //实现 ...
- Apple 远程推送APNS 服务
APP注册APNS流程 http://mobiforge.com/design-development/programming-apple-push-notification-services 服务器 ...
- Android中Word转Html
一.POI方式 1.先看word效果图 2.再看下在android上使用WebView显示的效果 3. 生成的html的代码,如下: <html> <head> <M ...
- 单元测试JUnit 4(二)——keeps the bar green to keeps the code clean
1.Failure和Error Failure是指测试失败 Error是指测试程序本身出错 (int a=10/0) 2.JUnit常用注解 2.1 @RunWith: 可以更改测试运行器(继承o ...
- 转:maven3常用POM属性及Settings属性介绍
原文:http://blog.csdn.net/lgm277531070/article/details/6922645 A.pom.xml属性介绍: project: pom的xml根元素. par ...