
cpp
chen802311
qq: 727690080
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++ lambda闭包
templateT lambdaTEST(string& name){ auto mylam = [&](int age) { cout << "my name is: " << name << ", age is: " << age << endl; }; return mylam;}int main(){ string name = "CPP"; auto&& h原创 2016-10-25 10:05:24 · 398 阅读 · 0 评论 -
给容器快速赋值
#include #include using namespace std;template class InsertPoxy{ T & m_poxyContain;public: InsertPoxy(T & poxyContain):m_poxyContain(poxyContain){ }; template InsertPoxy& operator()(U elem)原创 2016-10-22 22:39:29 · 1249 阅读 · 0 评论 -
boost系列化c++对象
#include #include #include using namespace std;// 包含以简单文本格式实现存档的头文件#include #include #include #include #include // 系列化map必须包含此文件#include #include class testclass;struct myinfo;namesp原创 2016-10-26 17:58:00 · 339 阅读 · 0 评论 -
c++11之模板别名(using)
#include using namespace std;// 定义一个具体类型的别名, using 与 typedef 一样的效果// 但是模板的别名只能用using(如果typedef也能的话,cpp11就不会加using这个特性了)// 以下效果一样using u_flags = std::ios_base::fmtflags;typedef std::ios_base::原创 2016-11-02 15:02:13 · 1920 阅读 · 0 评论 -
一个ini配置文件解析器
test.ini:#begin[system]#参数1param1=12 ;参数2param2=12,13,14,15#支持多行模式param3=12, 13,14 ,15,18,19,20#参数4param4 = chen: hui:zong:hao:haoparam5=trueparam6 =true,false,aaa,bbbb, true[op原创 2016-12-09 16:42:36 · 508 阅读 · 0 评论 -
世界上最好的c++ json解析器
url: https://github.com/button-chen/tinyjson使用只需包含一个头文件(header only).读取相当复杂的json,也很简单。#include "tinyjson.hpp"#include <string>#include <iostream>using namespace std;string jsonstri...原创 2017-08-12 12:09:51 · 4744 阅读 · 1 评论 -
c++封装简易http(基于microhttpd)
使用例子:#include "httpservice.hpp"#include "boost/bind.hpp"#include using namespace std;void handle_test1(boost::shared_ptr res, boost::shared_ptr req){ res->write(req->body());}class CLAS原创 2018-01-29 17:35:34 · 1845 阅读 · 0 评论 -
世界上最好的c++ rpc实现基于c++14标准
代码量很少,就两个hpp文件,新手学习好材料。server:#include "buttonrpc.hpp"int foo(int age, int mm){ return age + mm;}int main(){ buttonrpc server; server.as_server(5555); server.bind("foo", foo); server.run()...原创 2018-04-29 07:19:42 · 14392 阅读 · 11 评论