作者查詢 / Dracarys

總覽項目: 發文 | 留言 | 暱稱
作者 Dracarys 在 PTT [ C_and_CPP ] 看板的留言(推文), 共172則
限定看板:C_and_CPP
[問題] 為什麼static 的變數不會被初始化
[ C_and_CPP ]20 留言, 推噓總分: +5
作者: liu2007 - 發表於 2025/03/25 22:11(9月前)
14FDracarys: 會sync但可以用-fno-threadsafe-statics關掉,然後03/26 19:00
15FDracarys: Itanium C++ ABI有規定api讓compiler生code來呼叫runti03/26 19:00
16FDracarys: me來達成這件事03/26 19:00
[問題] 有完整程式碼的資料結構用書推薦
[ C_and_CPP ]18 留言, 推噓總分: +5
作者: amamoimi - 發表於 2024/09/10 12:56(1年前)
6FDracarys: 要有code的話,直接參考leetcode的線上課,跟neetcode09/10 16:16
7FDracarys: 解說吧09/10 16:16
[問題] 大檔案讀寫效能改進方法
[ C_and_CPP ]39 留言, 推噓總分: +16
作者: jacky1989 - 發表於 2024/07/13 13:40(1年前)
1FDracarys: 搜尋The One Billion Row Challenge07/13 14:03
[問題] C++ 變數無法正常創建
[ C_and_CPP ]37 留言, 推噓總分: +7
作者: handofn0xus - 發表於 2024/07/10 16:52(1年前)
22FDracarys: 有可能debug/release builds ABI incompatible 然後lin07/11 21:01
23FDracarys: k錯07/11 21:01
24FDracarys: 看不懂什麼叫private全域變數,可以寫個07/11 21:03
25FDracarys: minimal reproducer放compiler explorer嗎07/11 21:03
[問題] Dev-C++
[ C_and_CPP ]38 留言, 推噓總分: +17
作者: howisfashion - 發表於 2024/06/03 16:42(1年前)
19FDracarys: 2024年推薦用std::println,要先import std;或06/05 13:31
20FDracarys: #include <print>06/05 13:31
[問題] temporary 可以take reference 嗎?
[ C_and_CPP ]40 留言, 推噓總分: +5
作者: amamoimi - 發表於 2024/04/11 20:27(1年前)
6FDracarys: 1. int&可以bind到A::g中的a,因為a是lvalue04/11 21:46
7FDracarys: 2. int& b = foo1(5)違法是因為foo1(5)是prvalue (pure04/11 21:46
8FDracarys: rvalue)04/11 21:46
9FDracarys: 3. foo2在C++20及以前都編得過,但是return的reference04/11 21:46
10FDracarys: 是dangle的,去印出來是未定義行為。C++23 P2266R3開始04/11 21:46
11FDracarys: ,a作為return的operand是xvalue,不能被bound to non-04/11 21:46
12FDracarys: const lvalue reference,int&改成int&&或const int&才04/11 21:46
13FDracarys: 編得過。04/11 21:46
14FDracarys: http://wg21.link/P2266R304/11 21:46
16FDracarys: Non-const lvalue reference只能bind to lvalue04/11 23:10
17FDracarys: 不能rvalue (含xvalue、prvalue)04/11 23:10
18FDracarys: a是不是lvalue跟obj.f()沒關係,通常寫一個變數名都是l04/11 23:16
19FDracarys: value expression ,例外我只想得到C++23改的那個case04/11 23:16
26FDracarys: Value category是expression的屬性,obj.f()跟a是不同e04/12 16:30
27FDracarys: xpr.所以我前面才說沒關係04/12 16:30
[問題] 如何強迫struct使用者另外額外賦值?
[ C_and_CPP ]39 留言, 推噓總分: +9
作者: mmmmei - 發表於 2024/04/09 05:19(1年前)
22FDracarys: 優雅的方式:Reflection?04/10 09:44
23FDracarys: http://wg21.link/p299604/10 09:44
24FDracarys: 怕之後少加field的話,可以看一下X macro pattern04/10 09:47
[問題] C++ DataFrame 編譯問題
[ C_and_CPP ]18 留言, 推噓總分: +3
作者: laughingman - 發表於 2024/03/26 23:00(1年前)
12FDracarys: 你如果要portable,最好別-lpthread而是-pthread讓comp03/28 02:22
13FDracarys: iler driver去判斷,不過這種事最好還是交給CMake。然03/28 02:22
14FDracarys: 後除了樓上說的之外,-Wl後面能接什麼還得看driver用的03/28 02:22
15FDracarys: linker有沒有支援,比如macOS上ld64/ld64.lld 就跟GNU03/28 02:22
16FDracarys: ld/ld.lld很不同,這個都能透過CMake在configure time03/28 02:22
17FDracarys: 確認03/28 02:22
[問題] 此段程式哪裡有問題
[ C_and_CPP ]70 留言, 推噓總分: +28
作者: chiya1908 - 發表於 2024/03/08 16:44(1年前)
19FDracarys: 答案應該是unsigned int有可能無法表達std::size_t所有03/08 22:21
20FDracarys: 的數,可以用T (&A)[N]03/08 22:21
21FDracarys: https://godbolt.org/z/GMxdPcrYz03/08 22:21
22FDracarys: int* A比較正常的說法聽起來怪怪的,因為本來就一樣03/08 22:24
23FDracarys: https://eel.is/c++draft/dcl.fct#5.sentence-303/08 22:24
[問題] 在一個給予的mask中,例舉所有k-bit 組合
[ C_and_CPP ]14 留言, 推噓總分: +6
作者: dnol - 發表於 2024/01/24 11:18(1年前)
1FDracarys: 直覺想到 std::next_permutation01/24 11:52