Vincent Lee

@vincentlee

Joined on Dec 24, 2018

  • class Rectangle { public: Rectangle(unsigned int w, unsigned int h) : width(w), height(h) { } private: unsigned int width; unsigned int height; };
     Like 1 Bookmark
  • 良好的API設計下,如果user寫錯,compile應該會失敗。 最近剛好要改寫一段code,大概是像這樣: #include <iostream> #include <string> using namespace std; // 好孩子不要亂加這行,我只是寫範例 class Encryptor { public:
     Like 1 Bookmark
  • autotime.h #ifdef _WIN32 #include <windows.h> #else #include <sys/time.h> #endif #include <string> class AutoTimer {
     Like  Bookmark
  • Windows今年感覺有很多不錯的新功能,今天看到Windows Terminal正式release的消息,就裝來玩看看。 安裝 https://www.microsoft.com/zh-tw/p/windows-terminal-preview/9n0dx20hk701 直接從Store裝就好 安裝新版Power shell https://github.com/PowerShell/PowerShell/releases 我自己是安裝6.2.5,本來的版本是5,可以並存沒有問題
     Like  Bookmark
  • https://conan.io/ 先講古 C/C++ libraries header files static/dynamic link binaries C/C++ libraries
     Like  Bookmark
  • 前言 之前在開發的時候,遇過一次把A branch merge回B branch之後,發現在A branch上的修改沒有正確被merge,和預期的結果不一樣 當時的狀況是A branch cherry-pick了B branch的一個commit,但是在A branch上又用了git revert,revert了這個commit的修改 A1 ---A2 ---------------- A3 --------------------A4 \ cherry-pick / merge B3 \ / B1 --- A2' --- git revert A2' --- B2 ------- B3
     Like  Bookmark
  • 今天同事把一個map replace成unordered_map,因為沒有排序的需求,結果就遇到static assertion static_assert(__check_hash_requirements<_Key, _Hash>::value, "the specified hash does not meet the Hash requirements"); 我好奇點進去看這個 __check_hash_requirements 到底幹了什麼好事 template <class _Key, class _Hash> using __check_hash_requirements = integral_constant<bool, is_copy_constructible<_Hash>::value &&
     Like 2 Bookmark
  • Polymorphism 一個介面,不同行為 Dynamic Polymorphism Virtual function class Shape { public: virtual ~Shape() = default; virtual void Draw() = 0;
     Like  Bookmark
  • 2:29:40~2:34:11 Squash Bugs and Improve Code Quality Debugger 效能改善 [color=red]原來之前debugging這麼吃記憶體 Just My Code 可以藉由修改 .natjmc 來定義哪些是屬於user code,哪些不是 [color=red]這之前就有了?
     Like  Bookmark