Boost
huangyongwang
这个作者很懒,什么都没留下…
展开
-
使用weak_ptr打破shared_ptr循环引用
代码示例:struct B;sruct A{ ~A() { count boost::shared_ptr b;}; struct B{ ~B() { count // boost::shared_ptr a; // 循环引用 不可用 boost::weak_ptr a ; //可以打破循环引用,在先声明的B中用weak_ptr};原创 2012-08-20 09:53:01 · 1098 阅读 · 1 评论 -
Boost学习之格式化输出--format
boost::format类提供了类似C语言里'printf'功能的格式化输出能力,当然功能更强大。所需头文件:#include 示例代码:#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ // 使用%序号%的方式给出转载 2013-05-15 10:39:30 · 436 阅读 · 0 评论