摘要: C++模板推导 code int a = 10; int &b = a; template<typename T> void func(T t) { } template<typename T> void bar(T& t) { } int main() { func(b);// using T = 阅读全文
posted @ 2026-07-22 01:09 杨忆州 阅读(3) 评论(0) 推荐(0)
摘要: C++ if语句 语法 if(xxx) true_branch_statement else false_branch_statement 注意:这里的是statement。 而if语句也是statement,所以我们经常见到以下写法 if(condition_0) statement_0 else 阅读全文
posted @ 2026-07-19 01:03 杨忆州 阅读(2) 评论(0) 推荐(0)
摘要: cmake try_compile 踩坑 踩坑的代码 function(cxx_flags result) set(multi_values_keyword COMPILER_FLAGS LINKER_FLAGS) cmake_parse_arguments( arg "" "" "${multi_ 阅读全文
posted @ 2026-07-16 23:06 杨忆州 阅读(1) 评论(0) 推荐(0)
摘要: target_source BASE_DIRS和FILES的联动 FILES选项 An optional list of files to add to the file set. Each file must be in one of the base directories, or a subd 阅读全文
posted @ 2026-07-12 15:33 杨忆州 阅读(2) 评论(0) 推荐(0)
摘要: StanderdLayout 标准布局类要求所有非静态数据成员都具有相同的可访问性。 这是因为在C++内存模型中,凡处于同一个access section的数据,必定保证以其声明顺序出现在内存布局当中。然而被放置在多个access sections中的各笔数据,排列顺序就不一定了。这就要求所有所有非 阅读全文
posted @ 2024-05-16 16:48 杨忆州 阅读(14) 评论(0) 推荐(0)