大约寒假开始的时候我就已经把std::sort的源码阅读完毕并理解其中的做法了,到了寒假结尾,姑且把它写出来 这是我的第一篇源码阅读笔记,以后会发更多的,包括算法和库实现,源码会按照我自己的代码风格格式化,去掉或者展开用于条件编译或者debug检查的宏,依重要程度重新排序函数,但是不会改变命名方式(虽然MSVC的STL命名实在是我不能接受的那种),对于代码块的解释会在代码块后(下面)用注释标明. template<class _RanIt, class _Diff, class _Pr> in…
初始化: std::pair<int, float> p; //initialize p.first and p.second with zero std::pair<int, const char*> p(42, "hello"); make_pair(42, "hello"); // no need for the var name, it's returned by make_pair make_pair<int, float&g…