上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 259 下一页
摘要: 为了保护D免受抄袭指控,我不会查看其他编译器源代码.这不仅仅是我的偏执狂,曾多次(错误地)指控我,包括接受律师的采访.“我从没看过他们的代码"是一种非常有效防御方式.在一屋子律师里面,他们很惊讶我这么说,让我确认一下,然后宣布"到此为止”,然后走了出去.再也没有收到他们的消息. 阅读全文
posted @ 2022-10-05 12:53 zjh6 阅读(21) 评论(0) 推荐(0)
摘要: #include <常用> 元<整 N>构 AA{ 整 I;符 p[N]{}; 常式 AA(常 符(&pp)[N]){ 区间们::复制(pp, p);I=N; }; }; 元<AA a>常式 动 符号""d(){ 中 a.p; } 元<AA a>常式 动 符号""z(){ 中 a.I; }//这种思 阅读全文
posted @ 2022-10-03 21:51 zjh6 阅读(16) 评论(0) 推荐(0)
摘要: 元<常符*c>构 字典{ }; 上面这样,输入文件名,在同时用两个字典的子类时,会出现问题,报错1179链接错误,说字典已有comdat. 改为: 元<常符*c,类 T=空>构 字典{ }; 不仅要输入字典名,还要加上T. 阅读全文
posted @ 2022-10-03 18:49 zjh6 阅读(12) 评论(0) 推荐(0)
摘要: 原文 void _messageBox(string title, int style, T...)(T args) { string s = format(args); /* etc... */ } alias _messageBox!(APPNAME, SWT.ICON_INFORMATION) 阅读全文
posted @ 2022-09-28 09:10 zjh6 阅读(15) 评论(0) 推荐(0)
摘要: 是否可绕过IFTI强制显式类型参数.Mayonix有个解决方案 template foobar(T) { T realFoobar(T t) { return t; } alias foobar = realFoobar; } void main() { foobar(3); // 不能从别名推导. 阅读全文
posted @ 2022-09-28 09:03 zjh6 阅读(15) 评论(0) 推荐(0)
摘要: 原文 仅在基类上提供正确重载,而派生类上包含不正确重载时,编译器不会检查基类重载.如果派生类没有任何重载,则它可以工作.例如: struct Foo { void foo(Bar b) { b.bar(this); } } struct Foobar {} struct Foobar2 {} cla 阅读全文
posted @ 2022-09-27 09:51 zjh6 阅读(35) 评论(0) 推荐(0)
摘要: 原文 原文2 原文3 类 客户{ 公: 客户(){ 线=线程([本]{ io环境_.跑(); }); } 简单异步::协程::懒<极>异步连接(动 主机,动 端口){ 极 中=协待 工具::异步连接(主机,端口);//.1 协中 中;//.2 } ~客户(){ io环境_.停止(); 如(线.可合并 阅读全文
posted @ 2022-09-26 15:46 zjh6 阅读(26) 评论(0) 推荐(0)
摘要: 原文 // C++模板类(第3方库) template<typename T, typename X> class Foo { // X为行为开关,但未实例化. T a, b; }; using FooFloat = Foo<float>; // 自己的 C++ 函数: void bar(FooFl 阅读全文
posted @ 2022-09-26 08:45 zjh6 阅读(10) 评论(0) 推荐(0)
摘要: 原文 typedef union value_u { void *p; } value_t; typedef struct data_s { void *p; } data_t; void fn() { value_t a; const value_t b; // 错误:无法隐式转换`const(v 阅读全文
posted @ 2022-09-22 10:40 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 原文 import std.algorithm : filter, map; import std.stdio; struct S { bool flag; auto method() { return [ 1 ].filter!(e => flag); } } void main() @safe 阅读全文
posted @ 2022-09-22 10:23 zjh6 阅读(14) 评论(0) 推荐(0)
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 259 下一页