上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 259 下一页
摘要: 原文 dub也有很多方便.看下面项目结构: A项目正在使用B库. 现在,B模块有如下代码: module b; void print(string s){imported!"std.stdio".writeln(s);} else version(Have_A) { void printA(stri 阅读全文
posted @ 2022-11-14 10:16 zjh6 阅读(35) 评论(0) 推荐(0)
摘要: 原文 pragma(msg, size_t.sizeof); // 4 pragma(msg, ulong.sizeof); // 8 printf("%lu", ulong.init); 报错,%lu必须是正,而不是正长.对长也是: printf("%ld", long.init); %ld必须是 阅读全文
posted @ 2022-11-14 09:37 zjh6 阅读(24) 评论(0) 推荐(0)
摘要: 原文 理由:目前,查看通过别名参数传递给模板重载集时,不能提取重载集.一般,可用: __traits(getOverloads, __traits(parent, sym), __traits(identifier, sym)) 但只要重载集包含别名或其他模块,此操作就会失败.而 __traits( 阅读全文
posted @ 2022-11-12 17:02 zjh6 阅读(16) 评论(0) 推荐(0)
摘要: [win+ctrl]配合左右方向键可以快速切换不同桌面; [Win+Ctrl+D]直接新建桌面; [Win+Ctrl+F4]删除当前桌面 这些东西,毛用没有,尽是影响你. 可以先禁止快捷键,用窗口+tab来删掉. 一直按Ctrl+Win+F4,可一直关闭桌面. 阅读全文
posted @ 2022-11-12 13:20 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 原文 如果你是C++程序员,考虑共针/独针, 如果想让代码更通用,可考虑通用的空*(void*)类型.但有更好方法.看看: import core.stdc.stdlib; void* myInt = malloc(int.sizeof); *(cast(int*)myInt) = 500; wri 阅读全文
posted @ 2022-11-12 10:11 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: 原文 struct S { private import std.traits : FieldNameTuple; float x = 0; } void main() { S x; foreach(v; x.FieldNameTuple!S) {} import std.stdio; writel 阅读全文
posted @ 2022-11-12 09:30 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 原文 b.d void first(int) { } a.d import b : foo = first; import c : foo = second; void main() { foo(1); // works foo("hello"); // works alias overloads 阅读全文
posted @ 2022-11-11 09:24 zjh6 阅读(19) 评论(0) 推荐(0)
摘要: 原文 像这样: A[] arr; A fragment = new A; ... arr.remove(fragment); 你可以这样: import std.algorithm; arr = arr.remove(arr.countUntil(fragment)); 阅读全文
posted @ 2022-11-11 09:23 zjh6 阅读(32) 评论(0) 推荐(0)
摘要: 原文 import std; class Test { float[3] _position = [0,0,0]; float[3] position() { writeln("Get"); return _position; } float[3] position(float[3] value) 阅读全文
posted @ 2022-11-11 09:02 zjh6 阅读(16) 评论(0) 推荐(0)
摘要: let s:dx=[] "放在外部.表已初化." fun! Ddq() "多逗清,多个逗号清理," let i=Dhhb(s:dx) let @+=i let s:dx=[] "清理,然后可以使用剪切板." endf "用两个函数实现`.k`清理.`.j`加,再`.k`就有了." fun! Ddj( 阅读全文
posted @ 2022-11-10 18:16 zjh6 阅读(37) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 259 下一页