
环境编程
文章平均质量分 66
ciengwu
这个作者很懒,什么都没留下…
展开
-
boost中cannot bind rvalue reference of type to lvalue of type问题
1.问题引出最近在新的环境上编译以前使用过boost的c++程序,发现对boost的相关调用部分报错了,而且报错发生在boost的内部的hpp文件中报错内容:cannot bind rvalue reference of type to lvalue of type通过实际查看boost报错部分的代码,发现报错部分的代码类似于这样:main.cpp:#include <stdio.h>template<typename T>void f1(const T&原创 2022-04-09 12:36:58 · 3440 阅读 · 0 评论 -
条件变量的使用注意
linux下多线程编程时,随着主线程的结束,在整个进程结束时,仍然有正在运行的子线程,那么这些子线程也会一并结束(注意,主线程的结束并不会影响子线程的结束),但是当子线程中有条件变量正在wait时,会出现~condition_variable_any():Assertion '!pthread_mutex_destroy(&internal_mutex)' failed.的错误,大概意思是说互斥变原创 2017-09-18 21:12:11 · 751 阅读 · 0 评论