C++
missshirly
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++构造函数调用顺序
C++构造函数调用顺序1、创建派生类的对象,基类的构造函数函数优先被调用(也优先于派生类里的成员类);2、如果类里面有成员类,成员类的构造函数优先被调用;3、基类构造函数如果有多个基类则构造函数的调用顺序是某类在类派生表中出现的 顺序而不是它们在成员初始化表中的顺序;4、成员类对象构造函数如果有多个成员类对象则构造函数的调用顺序是对象在类中 被声明的转载 2013-08-05 23:31:54 · 539 阅读 · 0 评论 -
开源网站收藏
<br />http://www.e2bb.cn C源码下载站<br />原创 2010-06-03 15:37:00 · 847 阅读 · 1 评论 -
priority_queue and unordered_multimap
struct cmp{bool operator()(const Class &a, const Class &b) const{return a.x > b.x;}};int main(){list reqs = ReadFile();priority_queue , cmp > q;for (auto it = reqs.begin原创 2016-04-25 15:49:43 · 582 阅读 · 0 评论 -
推荐一个用C++实现类关系的英文博文
收藏一个用c++实现association,composition和aggregation类关系的博文。有时间再翻译。http://www.go4expert.com/articles/association-aggregation-composition-t17264/转载 2016-04-21 12:22:16 · 1067 阅读 · 0 评论 -
C++ frequent type conversion
1.string => int / double / floatstoi(string) / stod(string) / stof(string)e.g. string s = "10";int x = stoi(s);double y = stod(s);float z = stof(z);2.string => c-style string strin原创 2016-04-22 11:04:07 · 456 阅读 · 0 评论 -
用std::pair做Unordered_map的key(C++)
默认情况下unordered_map只支持primitive type作为其key,若使用用户自定义的key,需要传入用户自定义的hash function。代码如下struct pair_hash {template std::size_t operator () (const std::pair &p) {auto h1 = std::hash{}(p.first)原创 2016-04-24 03:21:26 · 6814 阅读 · 0 评论 -
收藏C++ STL 使用的博文
http://www.cnblogs.com/nirvana-phoenix/archive/2012/05/29/2524344.htmlhttp://blog.youkuaiyun.com/sup_heaven/article/details/8036982转载 2016-04-24 05:34:03 · 531 阅读 · 0 评论
分享