随笔分类 -  C++ 语法

摘要:引用折叠和完美转发 - 知乎 auto&&、万能引用和完美转发 - 知乎 测试 点击查看代码 #include <iostream> using std::cout; using std::cerr; using std::endl; #include <type_traits> using std 阅读全文
posted @ 2022-06-18 09:58 Gyan083 阅读(84) 评论(0) 推荐(0)
摘要:#include <iostream> class test { protected: typedef int int_type; typedef std::string str_type; typedef std::allocator<int_type> _Int_alloc; typedef s 阅读全文
posted @ 2022-06-03 14:49 Gyan083 阅读(242) 评论(0) 推荐(0)
摘要:问题引入 STL std::pair 中的 swap 函数是这样实现的:(来自 stl_pair.h,仅展示部分源代码) namespace std { template<typename _T1, typename _T2> struct pair { _T1 first; ///< The fi 阅读全文
posted @ 2022-06-02 21:03 Gyan083 阅读(1212) 评论(0) 推荐(0)
摘要:剖析STL内存分配器 三张图带你弄懂stl内存分配器 阅读全文
posted @ 2022-05-14 13:48 Gyan083 阅读(53) 评论(0) 推荐(0)
摘要:百度百科: 在计算机科学中,字面量(literal)是用于表达源代码中一个固定值的表示法(notation)。 C++ 中,字面量分为以下几种: 整型字面量 integer literal 浮点型字面量 floating-point literal 布尔型字面量 boolean literal 字符 阅读全文
posted @ 2022-04-09 17:01 Gyan083 阅读(2911) 评论(0) 推荐(2)