timer类#include #include "iostream"using namespace std;int _tmain(int argc, _TCHAR* argv[]){ boost::timer t; coutusing namespace std;int _tmain(i...
分类:
编程语言 时间:
2014-07-16 20:25:04
阅读次数:
224
#pragma once
#include
#include
#include
#include
#include
class CountDownLatch : boost::noncopyable
{
public:
explicit CountDownLatch(int count);
void wait();
void countDown();
int getCo...
把项目从VS2008搬到VS2010的时候,导入原来的编译好的boost库居然连接失败,提示:LINK : fatal error LNK1104: 无法打开文件“libboost_system-vc100-mt-1_47.lib” 错误网上找答案,才知道不同的编译器所使用的boost库编译命令是不...
分类:
其他好文 时间:
2014-07-11 21:47:40
阅读次数:
245
shared_ptr::operator->返回的是T*类型指针,非const T*指针。因此通过const shared_ptr&类型的ptr可以直接调用T各个原始的方法,不用担心const与非const问题。具体shared_ptr::operator->实现如下,摘自boost1.52.0版本...
分类:
其他好文 时间:
2014-07-09 23:34:42
阅读次数:
194
一、编译boost库第一步:下载boost库,下载地址http://sourceforge.net/projects/boost/files/boost/1.55.0/第二部:解压boost库,例如解压到F:\Third-party libs\boost\boost_1_55_0第三部:开始->程序...
分类:
其他好文 时间:
2014-07-09 23:06:43
阅读次数:
332
#include
#include
#include
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() //为了注册新的数据类型
using namespace std;
namespace ex{ //定义新的数据类型
struct demo_class
{
int a,b;
};
BOOST_TYPEOF_REG...
分类:
其他好文 时间:
2014-07-04 06:53:55
阅读次数:
323
以下知识点转自:点击打开原文链接
今天拿起手要用C++写个小工具,从指定的目录递归遍历文件,然后做一下处理。又翻了一下boost的filesystem库。小结一下,希望能加深印象,免得下次又要查看文档。
1. path对象就是一个跨平台的路径对象。有许多方法访问路径的各个部分,也用它的iterator迭代路径中的各个部分;
path构造目录结构的时候使用“/”运算符,非常直...
分类:
其他好文 时间:
2014-07-02 07:06:26
阅读次数:
413
boost::scoped_ptr和std::auto_ptr非常类似,是一个简单的智能指针,它能够保证在离开作用域后对象被自动释放。上一段代码,以及其输出: 1 #include 2 #include 3 #include 4 5 class implementation 6 { 7 pu...
分类:
其他好文 时间:
2014-07-01 18:58:19
阅读次数:
261
boost开发文档中实时聊天程序的客户端(加入了详细注释 方便理解)...
分类:
其他好文 时间:
2014-07-01 15:11:08
阅读次数:
233