C/C++
lambda_tea
这个作者很懒,什么都没留下…
展开
-
boost生成随机数
[code="c++"] /*输入参数:随机数位数*/ /*输出参数:随机数*/ boost::mt19937 m_oBoostRandomSeed_; GetRandomNumber(int nDigits) { double dRangeMin = pow((double)10,nDigits); double dRangeMax = pow((double)10,nDigi...2011-07-04 17:19:51 · 421 阅读 · 0 评论 -
boost_foreach
1 #include <string> 2 #include <iostream> 3 #include <boost/foreach.hpp> 4 5 #define foreach BOOST_FOREACH 6 7 8 int main() 9 { 10 std::string h...原创 2011-07-15 14:12:52 · 102 阅读 · 0 评论 -
boost::split
#include "boost/algorithm/string.hpp" #include <stdio.h> #include <string> #include <vector> using namespace std; using namespace boost; int main(int argc,char* argv[]) { ...原创 2011-07-18 09:55:11 · 92 阅读 · 0 评论 -
获取当前时间字符串
//get current time string char szTime[32] = {0}; time_t lTM = time(NULL); tm *pstTM = localtime(&lTM); strftime(szTime, 32, "%Y-%m-%d %H:%M:%S", pstTM); //struct timeval_a old; struct t...原创 2011-07-18 10:05:08 · 204 阅读 · 0 评论 -
vector&&map
#include <algorithm> #include <map> #include <vector> //std::map在insert后是自动排序的,查找的时候可以使用 find std::map<int,string> mapDemo_; if(mapDemo_.find(nKey) != mapDemo_.end())...原创 2011-07-18 10:09:30 · 47 阅读 · 0 评论 -
boost::string
<boost/algorithm/string.hpp> <boost/algorithm/string/case_conv.hpp> <boost/algorithm/string/classification.hpp> <boost/algorithm/string/compare.hpp> <boost/algorithm/...原创 2011-07-18 10:20:47 · 97 阅读 · 0 评论 -
loki::typelist
loki的typelist用来形成class的list 依赖于递归行为 只不过在编译期执行 namespace loki { class NullType; struct EmptyType {}; template<class T, class u> struct TypeList { typedef T Head; type...原创 2011-07-21 10:56:57 · 95 阅读 · 0 评论 -
boost::phoenix3
#include <vector> #include <algorithm> #include <iostream> #include <boost/phoenix/core.hpp> #include <boost/phoenix/operator.hpp> int main() { using boo...原创 2011-07-26 10:10:15 · 149 阅读 · 0 评论