d

    0熱度

    1回答

    執行異步io的D方式是什麼?我正在討論基於select/epoll的單個(主要)線程操作。 我正在考慮鏈接到lib_uv,然後用C風格編程(或者寫一些圍繞lib_uv調用的整潔類),但那是最好的選擇嗎? 我所希望做的是這樣的: // pseudo code Server server; server.listen(address, port, callback); void callba

    1熱度

    1回答

    這裏就是我想要做: void x(function int(int) f){ f(555); } void main(){ x(function int(int q){ }); } 錯誤消息是令人困惑: funcs.d(4): Error: basic type expected, not function funcs.d(4): Error: found 'in

    1熱度

    1回答

    我試圖每天早上8:00在vibe.d web應用程序中運行一項任務。 目前,我使用setTimer函數,定期參數爲true。但這樣,我無法精確控制任務觸發的時間。有沒有簡單的方法來做到這一點振動?

    2熱度

    2回答

    我有這些C宏,並希望將它們轉換爲純D(因爲與原始C文件接口)。 #define __KS_TYPE(type_t) \ typedef struct __kstream_t { \ unsigned char *buf; \ int begin, end, is_eof; \ type_t f; \ } kstream_t; #defi

    0熱度

    1回答

    我有範圍MySQLTablesRange。這包括像數據: aa_1 aa_3 aa_2 bb_2 bb_1 bb_3 我要像創建對: aa_1 bb_1 aa_2 bb_2 aa_3 bb_3 std.algorithm有方法group,這樣做類似的事情,但我不知道如何把它寫在代碼中。我所做的: MySQLTablesRange.each!(a => a.split("_")[1].array.g

    1熱度

    1回答

    我需要創建Tuple。我這樣做: auto historyTuple = Tuple!(string, "gps", string, "sensor"); 我想用數據進行初始化。 我得到錯誤: Error: type Tuple!(string, "gps", string, "sensor") has no value

    1熱度

    1回答

    我從Variant類型獲取數據庫數據。在強制它之前,我需要檢查變量是否有任何數據。 cargpspoint.speed = point[0].coerce!int; 如果point[0]將null我會得到異常。我只有在變量有價值時才需要強制執行。有很長的路要走: if(point[0].hasValue && point[0].peek!(int) !is null) 有什麼辦法可以縮短它

    1熱度

    1回答

    我已經讀過,如果我經常分配字符串,我應該使用Appender,但是Appender的原理與~運算符有什麼不同? 它們的兩個(afaik)都是用於存儲器分配的use GC。那麼區別是什麼呢?哪一個更好呢?

    1熱度

    1回答

    struct vec_struct { alias field this; bool b; int8 field; // ymm } SIMD字段,當你在用GDC生成的輸出64位的代碼似乎是做了很好的工作,因爲它已經得到了這個代碼的對齊偏移正確的256位YMM'字段'正確。 Q:D是否自動將字段上的對齊限制傳播到堆棧上靜態結構或結構的分配? 在這種情況下

    1熱度

    2回答

    我試圖編譯文件hello-world.d與LLVM d編譯器和得到這個消息: Error: module hello-world has non-identifier characters in filename, use module declaration instead 我找的是一個模塊聲明的文檔,然後加入 module hello_world; 到我的文件頂部。然後編譯hello