2015年7月19日

摘要: /**************************************************************技术博客http://www.cnblogs.com/itdef/技术交流群群号码:324164944欢迎c c++ windows驱动爱好者 服务器程序员沟通交流*****... 阅读全文
posted @ 2015-07-19 11:08 itdef 阅读(447) 评论(0) 推荐(0)

2015年6月28日

摘要: 关于学习 《深入应用c++11》的代码笔记:c++11之前是这么实现的templateclass Singleton{public: static T* Instance(){ if (m_pInstance == nullptr) m_pInstance = new T(); return... 阅读全文
posted @ 2015-06-28 22:56 itdef 阅读(1133) 评论(0) 推荐(0)

2015年6月22日

摘要: #ifndef MY_QUEUE_H__#define MY_QUEUE_H__#include#include#include#include#include template class SyncQueue{public: SyncQueue(int maxSize = 10) :maxSiz... 阅读全文
posted @ 2015-06-22 12:48 itdef 阅读(348) 评论(0) 推荐(0)

2015年6月8日

摘要: 从windows角度来说,condition_variable类似event。 阻塞等待出发,不过condition_variable可以批量出发。 代码如下: 显示如下: start...thread 7thread 3thread 2thread 9thread 6thread 5thread 阅读全文
posted @ 2015-06-08 21:21 itdef 阅读(471) 评论(0) 推荐(0)

2015年6月7日

摘要: // 1111111.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include int gcounter = 0;std::mutex gmtx; std::mutex gmtxOutput;voi... 阅读全文
posted @ 2015-06-07 21:29 itdef 阅读(337) 评论(0) 推荐(0)
摘要: 没啥好讲的 c++11 thread类的基本使用#include "stdafx.h"#include #include void Func(int n){ for (int i = 0; i < 3; ++i) std::cout << "func " << i << std::endl;}vo... 阅读全文
posted @ 2015-06-07 21:11 itdef 阅读(400) 评论(0) 推荐(0)

2015年5月31日

摘要: 最近没时间捣鼓啥,也没什么内容可写。先把自己捣鼓的几个基础类放上来,已做记录namespace DEF{ class Noncopyable { protected: Noncopyable() {} ~Noncopyable() {} priva... 阅读全文
posted @ 2015-05-31 17:18 itdef 阅读(311) 评论(0) 推荐(0)

2015年5月29日

摘要: http://www.af360.com/html/2015/03/03/201503031538584471.shtmlhttp://fangluo.blog.bokee.net/http://www.af360.com/html/2015/03/03/201503031538584471.sht... 阅读全文
posted @ 2015-05-29 11:15 itdef 阅读(283) 评论(0) 推荐(0)

2015年3月29日

摘要: /********************************************************************/* @file* @author def* @blog http://www.cnblogs.com/itdef/ * @brief/************... 阅读全文
posted @ 2015-03-29 12:37 itdef 阅读(211) 评论(0) 推荐(0)

2015年3月26日

摘要: traits使用的场景一般有三种 分发到不同处理流程 解决C++代码中某些无法编译的问题 比如一个图书馆的代码,接受书籍并收入到不同类别中 template<class T> // T表示接受的是何种书籍 void AcceptBooks(T books) { ... //do something 阅读全文
posted @ 2015-03-26 21:51 itdef 阅读(394) 评论(0) 推荐(0)

导航