随笔分类 - 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 <
阅读全文
时间与日期
摘要: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 <<
阅读全文
容器
摘要: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
阅读全文
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
阅读全文
浙公网安备 33010602011771号