摘要:
原文 我想知道他们@安全和dip1000的目标.确保整个程序的内存安全? 多字变量更新中的数据竞争怎么样? @safe是的,但并不简单,因为main不是唯一可能的入口点,而且存在@trusted. D目前: 必须标记共享数据为"shared".@safe代码无法访问shared数据(仅用-previ 阅读全文
posted @ 2022-02-15 22:09
zjh6
阅读(34)
评论(0)
推荐(0)
摘要:
让球滚动的初始步骤: 1.从druntime和phobos中删除所有复和虚的单元测试. 2.删除/替换druntime编译器库助手. cdouble *_memset128(cdouble*p,cdouble v,size_t c) crreal *_memset160(creal*p,crreal 阅读全文
posted @ 2022-02-15 20:10
zjh6
阅读(16)
评论(0)
推荐(0)
摘要:
struct S { int x; } @safe interface I { int func(ref scope S s) @nogc; } @safe class C : I { int func(ref S s) { return 2*s.x; } } 编译器未检查域属性? 可编译,但问题是 阅读全文
posted @ 2022-02-15 17:37
zjh6
阅读(19)
评论(0)
推荐(0)
摘要:
原文 import std.stdio; @safe: struct ScopeBuffer(T, size_t Len) { this(T[Len] buf, size_t len = 0) { this.buf = buf; this.len = len; } // 用`return`正确发出编 阅读全文
posted @ 2022-02-15 17:25
zjh6
阅读(16)
评论(0)
推荐(0)
摘要:
原文 dip1000隐式去闭包属性失败. struct A { void method() pure @safe nothrow @nogc { } } void test(scope void delegate() del) @safe { } void main() @safe { A a; / 阅读全文
posted @ 2022-02-15 16:28
zjh6
阅读(19)
评论(0)
推荐(0)
摘要:
原文 你不这样, struct MyData { int x; void method() { x++; } } MyData data; data.method(); 而是这样写: struct MyData { int x; } void method(ref MyData mydata) { 阅读全文
posted @ 2022-02-15 16:12
zjh6
阅读(18)
评论(0)
推荐(0)
摘要:
static foreach(name; ["boo", "foo"]) { enum string file_name_info = "file_" ~ name ~ "_info"; string mixin("file_", name) = readText(name ~ ".txt"); s 阅读全文
posted @ 2022-02-15 15:07
zjh6
阅读(11)
评论(0)
推荐(0)
摘要:
代码如下: 元<元<整...>类 G,整...K> 空 碰碰(序列<K...>a,序列<>){G<K...>::动作();} //.4这里基础动作.//最后一步. 元<元<整...>类 G,整...A,整...B,整...I,类 F,类...J>要求(都是<整,F,J...>) 空 碰碰(序列<A. 阅读全文
posted @ 2022-02-15 14:35
zjh6
阅读(19)
评论(0)
推荐(0)
摘要:
#include <常用> 元<元<整...>类 G,整...J> 空 aa(整 i,序列<J...>){ (((i==J)&&(G<J>::动作(),0)),...); } //元<整 J>常式 整 aa(整 i){ // 如(i==J)中 J;异 中 0; //}//序列不能保存,要立即应用. 阅读全文
posted @ 2022-02-15 10:58
zjh6
阅读(23)
评论(0)
推荐(0)
摘要:
#include <常用> 元<整 J> 常式 整 aa(整 i){ 如 常式(J==i){中 J;} 异 中 0; }//序列不能保存,要立即应用. 空 主(){ 整 i=3; 打印(aa<4>(i)); } 阅读全文
posted @ 2022-02-15 10:19
zjh6
阅读(54)
评论(0)
推荐(0)
浙公网安备 33010602011771号