• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
一蓑烟雨
C/C++,Linux,语音技术
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Boost研究

智能指针:scoped_ptr and shared_ptr

摘要:1 // boost_ptr.cpp : 定义控制台应用程序的入口点。 2 //智能指针--scoped_ptr,shared_ptr 3 4 #include "stdafx.h" 5 #include <iostream> 6 #include <string> 7 #include <boost/scoped_ptr.hpp> 8 #include <boost/shared_ptr.hpp> 9 class ptr_test10 {11 public:12 ptr_test()13 {14 std::cout < 阅读全文
posted @ 2013-01-30 09:55 lovemu 阅读(1044) 评论(0) 推荐(0)
时间与日期

摘要:1 // timer.cpp : 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <iostream> 6 #include <boost/timer.hpp> 7 #include <boost/progress.hpp> 8 #include <boost/date_time.hpp> 9 10 using namespace std;11 /*记时器*/12 void timer()13 {14 boost::timer t;15 cout << 阅读全文
posted @ 2013-01-29 17:16 lovemu 阅读(399) 评论(0) 推荐(0)
容器

摘要:1 // container.cpp : 定义控制台应用程序的入口点。 2 //any,保存具有不同值类型的单个值的一种安全、泛型的容器,来自 Kevlin Henney. 3 //array - 兼容STL的容器,是固定大小的数组的包装,来自 Nicolai Josuttis. 4 //multi_arry -多维数组 5 #include "stdafx.h" 6 #include <string> 7 #include <vector> 8 #include <iostream> 9 #include <boost/any.h 阅读全文
posted @ 2013-01-29 16:25 lovemu 阅读(245) 评论(0) 推荐(0)
lexical_cast组件

摘要:1 //强制类型转换 2 #include "stdafx.h" 3 #include <iostream> 4 #include <string> 5 #include <boost/lexical_cast.hpp> 6 7 using namespace std; 8 9 int _tmain(int argc, _TCHAR* argv[])10 {11 string str_int="520"; 12 string str_double="520.2314";13 const double 阅读全文
posted @ 2013-01-28 14:44 lovemu 阅读(390) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3