Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

C++ 實戰技巧集

面試、工程實踐與開發技巧。

📝 面試準備

C++ 面試題

📖 學習筆記

C++ 知識整理

🔧 開發工具

函數追蹤

💡 實用技巧

面試技巧

  1. 語言特性

    • 理解 RAII
    • 掌握 Move 語意
    • 熟悉智能指標
  2. 性能優化

    • Cache 優化
    • 並發編程
    • 無鎖數據結構
  3. 設計模式

    • CRTP
    • Type Erasure
    • Policy-based Design

工程實踐

  1. 代碼風格

    • 遵循 Google Style Guide
    • 使用 clang-format
    • Code review
  2. 測試

    • Google Test
    • Benchmark 測試
    • 集成測試
  3. 工具鏈

    • CMake 建構系統
    • Sanitizers (ASan, TSan)
    • Valgrind 記憶體檢測

常見陷阱

  1. 記憶體問題

    • 記憶體洩漏
    • Use after free
    • Double free
  2. 並發問題

    • Data race
    • Deadlock
    • Priority inversion
  3. 性能陷阱

    • 不必要的拷貝
    • False sharing
    • 過度優化

最後更新: 2025-12-01