Command Palette
Search for a command to run...
More from this blog
Devlog #0 — Why I’m Building My Own RPG Maker-like Engine in Go
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 I started planning the kind of games I want to ma...

sizeof array
在 C++ 中,對於陣列的大小處理,sizeof 在函式中有個容易踩雷的陷阱:如果你把陣列當作參數傳入函式,它會退化成指標。這會導致 sizeof 傳回的是指標的大小,而不是陣列的實際大小。 Example #include <iostream> void test1(char (&a)[10]) { std::cout << "test1 called with array of size: " << sizeof(a) << " bytes" << st...
Go 1.24 omitzero
解決 omitempty 的限制
簡介 C++ 的 Type Erase (用多型和模板做 Duck Type)
起點 讓我們先從 template 出發:foo 需要一個 callback function。 template<typename Func> void foo(Func callback) { // ... callback(); } 但是這會讓編譯錯誤訊息有點模糊:假如 callback 並不是一個可以呼叫的函數指標,或者並不是一個 callable object ,那編譯器會說錯出在第四行。但是我們都希望,編譯器在呼叫函數時就幫我們指出:這不是 foo 想要的 call...
int64_t Literal Constant?
事情源於一個 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; // ubuntu 20.04 上編不過 return 0; } 無論是 1L 還是 1LL 都沒...
帕秋莉的魔法筆記
45 posts
後端工程師。
不定時張貼一些寫扣時的筆記。