About the author
後端工程師。 不定時張貼一些寫扣時的筆記,有時英文,有時中文。 「如果,我是魔女的話...」
Comments
Join the discussionNo comments yet. Be the first to comment.
後端工程師。 不定時張貼一些寫扣時的筆記,有時英文,有時中文。 「如果,我是魔女的話...」
No comments yet. Be the first to comment.
Hi everyone 👋 I’ve always been drawn to RPG Maker-style games — small towns to explore, characters to talk to, puzzles to solve, and stories that unfold through simple but powerful interactions. When

在 C++ 中,對於陣列的大小處理,sizeof 在函式中有個容易踩雷的陷阱:如果你把陣列當作參數傳入函式,它會退化成指標。這會導致 sizeof 傳回的是指標的大小,而不是陣列的實際大小。 Example #include <iostream> void test1(char (&a)[10]) { std::cout << "test1 called with array of si
解決 omitempty 的限制
起點 讓我們先從 template 出發:foo 需要一個 callback function。 template<typename Func> void foo(Func callback) { // ... callback(); } 但是這會讓編譯錯誤訊息有點模糊:假如 callback 並不是一個可以呼叫的函數指標,或者並不是一個 callable object ,那編譯
事情源於一個 error: #include <algorithm> #include <iostream> int main() { int64_t a = 2; std::cout << std::min(1L, a) << std::endl; // mac 上編不過 std::cout << std::min(1LL, a) << std::endl; // u