上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 259 下一页
摘要: 原文 概述 该DIP为函数定义提出了短语法.新语法使用=>分隔函数头和函数体来代替左大括号和右大括号: int add(int x, int y) pure => x + y; 已在D语言中作为预览实现 原理(一致/简洁) D语言已支持函数字面的短语法.如: const succ = (int x) 阅读全文
posted @ 2022-09-21 20:03 zjh6 阅读(21) 评论(0) 推荐(0)
摘要: 原文 目前在预览开关后面,C位域不好,仅有好处:让编译器帮助打包私有的,仅供内部使用的结构到更紧凑的内存布局中.不保证公共abi. D位域可能很好 假想的: ulong fields { msb : 1, _reserved: 62, lsb: 1, }; 可分解现有字段按定义来取结构中包含的位字段 阅读全文
posted @ 2022-09-20 10:01 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: { "buildTypes": { "debug-cov": { "buildOptions": ["debugMode", "debugInfo", "coverage"] } } } 定义新构建. 阅读全文
posted @ 2022-09-19 19:41 zjh6 阅读(18) 评论(0) 推荐(0)
摘要: 原文 void main() { struct One { int entry = 1; @disable this(this); } One[] ones = [One(), One()]; import std.algorithm.iteration: map; import std.algor 阅读全文
posted @ 2022-09-19 09:26 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 原文 auto res = firstAttr; while (res) { if (res.localName != localName || res.namespaceURI != namespaceURI) res = res._nextAttr; else break; } return r 阅读全文
posted @ 2022-09-18 09:53 zjh6 阅读(11) 评论(0) 推荐(0)
摘要: 原来都实现了,参考这里 空 串大小(串&a,整&i){i=a.大小();} //基函数. 元<类...T>空 f(T&&...t){ 静 常式 整 I=型长...(T);静断(I%2==0); 每列<I/2>(串大小,t...); } 空 主(){ 串 a{"啊"},b{"啊啊"};整 i,j; f 阅读全文
posted @ 2022-09-17 21:38 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 元<动...N>空 动作(整 c,符*参[]){ 串 e;解析参数(c,参,e);//只1个参. d.动作<N...>(e); }//N为值模板参数,主模板参数. 这里,元<动...N>,用动作模板参数,N可以自动匹配非类型参数,不然,以其他作为参数,只会限制你的模板能力. 这样,用动来表示非类型模 阅读全文
posted @ 2022-09-17 18:44 zjh6 阅读(13) 评论(0) 推荐(0)
摘要: fun! Dkdml() "打开当目录,当前目录.直接取,还没用" let s:sta="start ." silent call system(s:sta) endf 要上面这样打开,自己用start 加上目录,结果报错,说什么打开临时文件错误. 阅读全文
posted @ 2022-09-17 18:01 zjh6 阅读(72) 评论(0) 推荐(0)
摘要: 串 s=打印串("啊啊",i,j,m); 这里的,啊啊被弄成什么符[4]类型. 元<可转为串...N>串 打印串(N&...n){ } 在这里却通不过,因为原来的概念是这样: 元<类 T>概念 可转为串=有一个<T,串,整,极> 如果,改成 元<类 T>概念 可转为串=有一个<T,串,整,极,常符* 阅读全文
posted @ 2022-09-16 09:53 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: 原文 struct c { uint a, b;} __gshared const c d = { 3, 4}; __gshared const e = &d.a; 我想: struct c { uint32_t a, b; uint32_t[] arr; } 取不了常成员地址. 在内存中的地址不是 阅读全文
posted @ 2022-09-14 10:46 zjh6 阅读(11) 评论(0) 推荐(0)
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 259 下一页