#include "stdafx.h"
#include
#include
#include
#include
#include
using boost::asio::ip::tcp;
#define max_len 1024
class clientSession
:public boost::enable_shared_from_this
{
public:
clientS...
分类:
其他好文 时间:
2015-03-03 20:43:52
阅读次数:
189
这篇文章主要介绍 boost中的智能指针的使用。(转自:http://www.cnblogs.com/sld666666/archive/2010/12/16/1908265.html) 内存管理是一个比较繁琐的问题,C++中有两个实现方案: 垃圾回收机制和智能指针。垃圾回收机制因为性能等原因不被....
分类:
其他好文 时间:
2015-03-03 13:32:29
阅读次数:
189
先了解一下:函数对象 重载函数调用操作符的类,其对象常称为函数对象(function object),即它们是行为类似函数的对象。[1]? 一个类对象,表现出一个函数的特征,就是通过“对象名+(参数列表)”的方式使用一个...
分类:
其他好文 时间:
2015-03-03 00:00:29
阅读次数:
219
// FirstTest.cpp : 定义控制台应用程序的入口点。
//UUID是University Unique Identifier的缩写,它是一个128位的数字(16字节),不需要有一个中央认证机构就可以创建全国唯一的标示符。别名:GUID
#include "stdafx.h"
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2015-03-02 16:59:48
阅读次数:
142
在C++的算法和函数之间,以类对象作为参数的情况很非常常见的问题,一般情况下传值语义是可行的,但也有很多特殊情况,作为参数的函数对象拷贝代价过高(具有复杂的内部状态),或者不希望拷贝对象(内部状态不应该被改变),甚至拷贝是不可行的(noncopyable、单件)。 boost.ref应用代理模式,....
分类:
其他好文 时间:
2015-03-02 16:40:44
阅读次数:
174
// FirstTest.cpp : 定义控制台应用程序的入口点。
//ptree解析ini文件,get(treename, translator) :translator类型实例
#include "stdafx.h"
#include
#include
#include
using namespace std;
int main()
{
boost::property...
分类:
其他好文 时间:
2015-03-02 11:18:22
阅读次数:
124
错误一:????undefined reference to `boost::system::generic_category()‘ ?????????undefined reference to `boost::system::generic_category()‘ ?????????undefined reference to `boo...
#include class Test : public boost::enable_shared_from_this{ // ......};boost::shared_ptr tt(new Test);上面定义的Test类派生自boost::enable_shared_from_this,获取....
分类:
其他好文 时间:
2015-03-01 20:57:32
阅读次数:
161
类名: timer
特点:timer接口简单,elapsed_min() elapsed_max() 代表了timer的能力,它不适合高精度的时间测量,也不适合跨度较大的时间段测量,它能提供的最大时间段也就几百小时
类名:progress_timer
特点:继承类timer的全部特点,用法更简单,析构的时候调用elapsed()输出时间段,花括号可以定义其生命周期,构造函数指定一个输出流,默...
分类:
其他好文 时间:
2015-02-28 18:41:59
阅读次数:
122
// FirstTest.cpp : 定义控制台应用程序的入口点。
//function 存放方法的地址,函数的包装器(function wrapper)
//*iterator1 内容为参数传入function
#include "stdafx.h"
#include
#include
#include
using namespace std;
using namespace boos...
分类:
其他好文 时间:
2015-02-28 14:39:29
阅读次数:
146