2017年4月24日

STL中remove和remove_if用法

摘要: 转自:http://www.cnblogs.com/coolstand/archive/2012/09/17/2688358.html remove 和 remove_if方法都是包含在<algorithm>头文件当中的,先来看看原型: 这两个方法的前两个参数均相同,第三个参数不同。remove的第 阅读全文

posted @ 2017-04-24 22:37 freshman2014 阅读(2113) 评论(0) 推荐(1) 编辑

c++ boost 可重入锁

摘要: http://blog.csdn.net/huang_xw/article/details/8458061 阅读全文

posted @ 2017-04-24 22:25 freshman2014 阅读(585) 评论(0) 推荐(0) 编辑

可重入锁基本原理

摘要: 转自:http://www.jianshu.com/p/007bd7029faf 简单锁 在讲述简单锁的实现之前,我们先来看一个锁的应用例子: 上面的程序中,由于this.count++这一操作分多步执行,在多线程环境中可能出现结果不符合预期的情况,这段代码称之为 临界区 ,所以需要使用lock来保 阅读全文

posted @ 2017-04-24 22:23 freshman2014 阅读(813) 评论(0) 推荐(0) 编辑

Boost 不同Mutex的大体说明

摘要: 转自:http://www.cppblog.com/ming81/archive/2012/07/18/184028.html 写过多线程程序的人都知道,不能让多个线程同时访问共享的资源是至关重要的。假如一个线程试图改变共享数据的值,而另外一个线程试图去读取该共享数据的值,结果将是未定义的。为了阻止 阅读全文

posted @ 2017-04-24 22:20 freshman2014 阅读(1044) 评论(0) 推荐(0) 编辑

c++ std::find函数

摘要: template <class InputIterator, class T>InputIterator find (InputIterator first,InputIterator last,​ const T& val); first,last 分别指向一个序列中初始及末尾位置的输入迭代器。这 阅读全文

posted @ 2017-04-24 22:16 freshman2014 阅读(2088) 评论(0) 推荐(0) 编辑

istringstream 用法

摘要: istringstream 类用于执行C++风格的串流的输入操作 istringstream用空格作为字符串分隔符 #include <iostream>#include <sstream>#include <string>using namespace std;void test(){ { //i 阅读全文

posted @ 2017-04-24 22:11 freshman2014 阅读(4121) 评论(0) 推荐(0) 编辑

导航