上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: title: ref 参数 date: 2022-12-02T15:41:48Z lastmod: 2022-12-02T16:41:40Z ref 参数 ​ref​ 参数 能够将一个变量带入一个方法中进行改变,改变完成后,再将改变后的值带出方法。 ​ref​ 参数要求在方法外必须为其赋值,而方法内 阅读全文
posted @ 2023-10-04 14:40 天空之城00 阅读(28) 评论(0) 推荐(0)
摘要: title: StringBuilder 类 date: 2022-12-02T16:55:23Z lastmod: 2022-12-05T11:18:13Z StringBuilder 类 创建字符串 StringBuilder sb = new StringBuilder("zhangsan") 阅读全文
posted @ 2023-10-04 14:40 天空之城00 阅读(28) 评论(0) 推荐(0)
摘要: title: 反射 date: 2022-12-05T17:54:49Z lastmod: 2022-12-05T18:11:28Z 反射 Type 类 Type t = typeof(MyClass); 可以通过 t.Name​ 获取类名 可以通过 t.Namespace​ 获取类所在的命名空间 阅读全文
posted @ 2023-10-04 14:39 天空之城00 阅读(22) 评论(0) 推荐(0)
摘要: title: C++运算符重载模仿管道操作 date: 2022-11-27T15:24:59Z lastmod: 2022-11-27T15:26:13Z 重载 + 运算 实现+运算重载 通过类内部实现成员函数operator+​以重载成员运算符+​,并接受一个右操作数为int​类型。返回自己的引 阅读全文
posted @ 2023-10-03 19:32 天空之城00 阅读(83) 评论(0) 推荐(0)
摘要: title: std::source_location date: 2022-11-27T15:17:30Z lastmod: 2022-11-27T15:18:24Z std::source_location 简介 ​source_location​​ 类表示关于源码的具体信息,例如文件名、行号以 阅读全文
posted @ 2023-10-03 19:32 天空之城00 阅读(178) 评论(0) 推荐(0)
摘要: title: C++中switch...case绕过变量初始化 date: 2022-11-27T15:42:36Z lastmod: 2022-11-27T15:43:20Z C++中switch...case绕过变量初始化 之前和同事遇到一个编译错误,顺便了解了一下标签下变量的作用域与绕过初始化 阅读全文
posted @ 2023-10-03 19:32 天空之城00 阅读(90) 评论(0) 推荐(0)
摘要: title: Lambda表达式 date: 2022-11-27T16:25:19Z lastmod: 2022-11-27T17:31:48Z Lambda表达式 Lambda表达式与仿函数 Lambda表达式是C++11时引入的特性 Lambda的本质是一个特殊的、匿名的类类型。它是一个带有 阅读全文
posted @ 2023-10-03 19:31 天空之城00 阅读(25) 评论(0) 推荐(0)
摘要: title: 宏定义污染与规避 date: 2022-11-27T15:44:58Z lastmod: 2022-11-27T15:45:49Z 宏定义污染与规避 问题 众所周知,宏定义是没有名称空间​的限制的,所以宏定义很容易导致的命名冲突。比如下代码: // msvc 2022 #include 阅读全文
posted @ 2023-10-03 19:31 天空之城00 阅读(283) 评论(0) 推荐(0)
摘要: title: 使用const引用延长变量生命周期 date: 2022-11-27T16:00:34Z lastmod: 2022-11-27T16:10:11Z 使用const引用延长变量生命周期 我们都知道const​ 引用在一定情况下会延长临时变量的生命周期,下面我们看一下具体哪些情况能够延长 阅读全文
posted @ 2023-10-03 19:31 天空之城00 阅读(475) 评论(0) 推荐(0)
摘要: title: 使用typeid进行运行时类型识别(RTTI) date: 2022-11-27T15:47:32Z lastmod: 2022-11-27T15:48:52Z Runtime Type Identification RTTI是运行阶段类型识别(Runtime Type Identif 阅读全文
posted @ 2023-10-03 19:31 天空之城00 阅读(80) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页