这里向大家介绍一个C++的字符串格式化库,叫cpptempl,这个库支持对字符串格式的条件,循环,变量插入.看上去很不错,只不过其是基于boost库的. 下面是一个例子: 1 2 3 4 5 6 7 8 // The text template wstring text = L"I heart {$place}!" ; // Data to feed the template engine cpptempl::data_map data ; // {$place} => Okin…
最近开了boost库的学习,就先从日期时间库开始吧,boost的date_time库是一个很强大的时间库,用起来还是挺方便的.以下算是我学习的笔记,我把它记录下来,以后便于我复习和查阅. #include<iostream>#include<boost/date_time/gregorian/greg_month.hpp>#include<boost/date_time/gregorian/gregorian.hpp> using namespace std;using…