庫命名方式
自動鏈接
bind 生成函數對象,支持全局函數,成員函數,支持嵌套,支持接口改造 ETC。。。
具體見
綁定到成員變量測試
class a
{
public:
int i;
};
{
public:
int i;
};
int _tmain(int argc, _TCHAR* argv[])
{
a _a;
_a.i=1;
std::cout
<< boost::bind(&a::i,boost::ref(_a))();
{
a _a;
_a.i=1;
std::cout
<< boost::bind(&a::i,boost::ref(_a))();
getchar();
return 0;
}
lambda 表達式,構造匿名函數對象,相同功力下,不如 .NET 寫起來直觀,某種程度上講是麻煩 。。。
function 記錄同型類函數
signal/slot 事件,支持多播,多返回結果過濾,動態增減插槽
測試如下:
class a
{
public:
{
public:
boost::signal<void (const std::string&)> g;
void f(const std::string& s)
{
g(s);
}
};
{
g(s);
}
};
void g(const std::string& s)
{
std::cout
<< s
<< std::endl;
}
{
std::cout
<< s
<< std::endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
{
a* _a=new a;
_a->g.connect(&g);
_a->f("1");
_a->g.connect(&g);
_a->f("1");
getchar();
return 0;
}
return 0;
}
智能指針,管理對象生存期,遠離討厭的 new delete ?。。
具體見
PYTHON Vs c++ 互操作
conversion 類型轉換庫
polymorphic_cast 指針轉換失敗引發異常
lexical_cast 值類型與文本類型相互轉化
array 一維數組
循環緩衝區
any 萬能變量
variant
pool 對象池
Serialization序列化
支持集合,數組,多態類型序列化
有防重複處理
可序列化爲 BINARY,XML等格式
如果有元數據支持,自動序列化。。。
http://dozb.blogchina.com/blog/1692310.html http://blog.csdn.net/vagrxie/archive/2009/04/21/4096147.aspx
ASSERT 斷言
program_options 配置
支持從命令行、配置文件、註冊表讀取配置信息,能配以說明,指定默認值等。該配置爲一維信息(包含集合),使用場合有限。