上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 259 下一页
摘要: 原文 noreturn(无中)是无值类型.声明noreturn类型是空操作.只是给当前域加一个符号.无初化,也不必初化. 也即不能求值noreturn式(如noreturn.init),因此,不可能成功调用带noreturn参的函数.或者进入无穷循环,抛异常,终止程序等.像 throw new Ex 阅读全文
posted @ 2022-01-16 10:00 zjh6 阅读(14) 评论(0) 推荐(0)
摘要: 原文 我受够了C++了. 新语言的要求是:编译,强类型,易于学习和使用,与现有C系和操作系统兼容. go无泛型.rust太丑.D主要是GC(垃集),但可编程禁用垃集.通过实践,喜欢D原因: betterC D没有C++后向兼容的包袱.同时与他们二进制兼容且语法类似. 可在一天内学会D,这里.没有预处 阅读全文
posted @ 2022-01-13 10:52 zjh6 阅读(41) 评论(0) 推荐(0)
摘要: 原文 我想静态索引我的类: struct Point { double x; double y; alias expand = typeof(this).tupleof; alias expand this; } unittest { Point p = Point(1.2,3.4); assert 阅读全文
posted @ 2022-01-13 10:00 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: void g(scope void delegate(scope int*) @safe cb) @safe { int x = 42; cb(&x); } void main() @safe { int* p; void f(scope int* i) @safe { p = i; } g(&f) 阅读全文
posted @ 2022-01-13 09:46 zjh6 阅读(12) 评论(0) 推荐(0)
摘要: import std.parallellism, std.process; foreach (frame; frames.parallel) { execute([ "povray" ] ~ povrayOpts ~ [ "+I", frame.infile, "+O", frame.outfile 阅读全文
posted @ 2022-01-13 09:27 zjh6 阅读(45) 评论(0) 推荐(0)
摘要: 典型排序构造: struct ThreadsafeQueue(T) { void QueueItem(T*) shared; T* UnqueueItem() shared; }//两个共享 struct SpecialWorkList { struct Job { ... } void MakeJ 阅读全文
posted @ 2022-01-12 20:58 zjh6 阅读(28) 评论(0) 推荐(0)
摘要: //CT和RT类型信息 immutable abstract class NewTypeInfo { size_t tsize(); } //给定T的实现. immutable class NewTypeInfoImpl(T) : NewTypeInfo { override size_t tsiz 阅读全文
posted @ 2022-01-12 12:59 zjh6 阅读(6) 评论(0) 推荐(0)
摘要: 1, 静 动 f=[&](位信&a){中 a.原.大小();}; 这里写错了. 2,函数名重复了,另外取一个名字. 3,未包含相应文件. 4,一个容器不用暴露,提供方法的接口. 5,用的是有一个,忘记加对象了. 6,类用了模板就要加模板参数,真是烦得很,连默认参数都不能用. 7,缺了文件处理. 8, 阅读全文
posted @ 2022-01-11 21:30 zjh6 阅读(15) 评论(0) 推荐(0)
摘要: function ff(){ ysa(".index_content__expand_ipad_10b#content__expand"); } setTimeout("ff()",1000); 阅读全文
posted @ 2022-01-10 22:11 zjh6 阅读(10) 评论(0) 推荐(0)
摘要: 原文 pointers ~= &str; //为何@安全中禁止 pointers ~= &strings[i]; // 而这里又可以呢? 在@safe代码中禁止取局部变量地址,只要在函数体内声明,即使串为堆分配串变量引用,也算局部变量.因而禁止. 原代码在此: module test; import 阅读全文
posted @ 2022-01-10 14:37 zjh6 阅读(15) 评论(0) 推荐(0)
上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 259 下一页